1

My friend has created a materialized view but the View does not receive new data from Mater Table. The view is receiving data only in creation, after it the news data are not included.

Anyone can help me to resolve this issue?

Fallow below my materialized view.

    CREATE or REPLACE MATERIALIZED VIEW DATABASE.MyMatView
    LOGGING
    TABLESPACE SDBANCO
    PCTFREE 10
    INITRANS 2
    STORAGE
    (
        INITIAL 65536
        NEXT 1048576
        MINEXTENTS 1
        MAXEXTENTS UNLIMITED
        BUFFER_POOL DEFAULT
    )
    NOCOMPRESS
    NOCACHE
    NOPARALLEL
    REFRESH ON DEMAND
    FORCE
    DISABLE QUERY REWRITE
AS
    SELECT * FROM .....

Thanks,

Matheus Lozano

LozanoMatheus
  • 368
  • 1
  • 7
  • 12

2 Answers2

5

Assuming you did this but... just to be sure... you did issue the command to refresh the mview, right? You don't expect it to refresh by itself, when you have the option REFRESH ON DEMAND right there in the view definition, right?

3

If you want the materialized view to be refreshed automatically you should use ON COMMIT refresh method. Since you have specified an ON DEMAND refresh you will have to manually refresh the materialized view using DBMS_MVIEW.REFRESH method.

There are lot of considerations for refreshing a materialized view. I would recommend that you read the following Oracle documentation.

https://docs.oracle.com/database/121/DWHSG/refresh.htm#DWHSG8360

phonetic_man
  • 1,088
  • 8
  • 12
  • Can I use view into the MView with ON COMMIT ? – LozanoMatheus Jun 10 '16 at 18:53
  • I don't think so. Since ON COMMIT requires an MV log on the underlying tables. Can you use the query of the view itself as the source for the mview? You can also leverage the EXPLAIN MVIEW procedure to check the capabilities of the mview. Please read this https://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_mview.htm#CEGGEHHC – phonetic_man Jun 11 '16 at 07:13