# \[Oracle Extensions\] \[CreateMaterializedView\] Change values of REFRESH parameters ( REFRESH\_MODE, REFRESH\_METHOD )

**URL:** https://forum.liquibase.org/t/oracle-extensions-creatematerializedview-change-values-of-refresh-parameters-refresh-mode-refresh-method/7922
**Category:** General Discussion
**Created:** [March 16, 2023, 1:50pm UTC](https://forum.liquibase.org/t/oracle-extensions-creatematerializedview-change-values-of-refresh-parameters-refresh-mode-refresh-method/7922 "2023-03-16T13:50:51Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![gallipi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/gallipi/32/610_2.png) [@gallipi](https://forum.liquibase.org/u/gallipi)
#### Post date: [March 16, 2023, 1:50pm UTC](https://forum.liquibase.org/t/oracle-extensions-creatematerializedview-change-values-of-refresh-parameters-refresh-mode-refresh-method/7922/1 "2023-03-16T13:50:51Z")

</div>

Hi all,  
I have been working with Materialized Views, and as far as I have seen, the MV refreshing parameters always have the same values:  
REFRESH\_MODE=DEMAND  
REFRESH\_METHOD=FORCE

I need to configure them differently:  
REFRESH\_MODE=COMMIT  
REFRESH\_METHOD=FAST

In addition, it is necessary to create a MATERIALIZED VIEW LOG to apply this configuration.  
So, the question is,  
Is it possible to do this with Oracle Extension?  
Is it even possible to do it with Liquibase?

An example of a Materialized View I have created:

```auto
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
    xmlns:pro="http://www.liquibase.org/xml/ns/pro"
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.19.xsd
        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd
        http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-4.19.xsd ">
<changeSet author="liquibase" id="baseline_vm_grctx-1">
	<comment>Create VM GRCTX</comment>
	<ext:createMaterializedView 
		subquery="SELECT column-1,column-2,column-n FROM table-1"
		tableSpace="${tablespace_data}"
		columnAliases="alias-1, alias-2,alias-n"
		viewName="GRCTX"/>
</changeSet>

<changeSet author="liquibase" id="baseline_vm_grctx-2">
	<comment>Create unique constraint UNIQUE_COLUMN-1</comment>
	<addUniqueConstraint 
		columnNames="column-1"
		constraintName="UNIQUE_COLUMN-1"
		tableName="GRCTX"
		tablespace="${tablespace_index}"/>
</changeSet>
</databaseChangeLog>

```

Oracle 19c  
 ![ora19_vm_params_values](https://us1.discourse-cdn.com/flex020/uploads/liquibase1/original/1X/7205d5e360d265ffc603008d71612e55f06a2871.jpeg)

Any help would be appreciated!

---

<div class="post-metadata">

### Author: ![daryldoak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/daryldoak/32/764_2.png) [@daryldoak](https://forum.liquibase.org/u/daryldoak)
#### Post date: [March 16, 2023, 5:48pm UTC](https://forum.liquibase.org/t/oracle-extensions-creatematerializedview-change-values-of-refresh-parameters-refresh-mode-refresh-method/7922/2 "2023-03-16T17:48:23Z")

</div>

Why not just use custom sql to create the MV with all of the parameters that you need?

```auto
<changeSet author="liquibase" id="baseline_vm_grctx-1">
	<comment>Create VM GRCTX</comment>
    <sql> 
		CREATE MV SQL HERE...
    </sql>
</changeSet>

```

---

<div class="post-metadata">

### Author: ![gallipi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/gallipi/32/610_2.png) [@gallipi](https://forum.liquibase.org/u/gallipi)
#### Post date: [March 23, 2023, 10:46am UTC](https://forum.liquibase.org/t/oracle-extensions-creatematerializedview-change-values-of-refresh-parameters-refresh-mode-refresh-method/7922/3 "2023-03-23T10:46:33Z")

</div>

You have made my day!

I read somewhere that Materialized Views were specific to Oracle. Therefore I thought the only way to create them was by using the Liquibase Oracle extension.

Thanks, life is much easy now.
