DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: materialized view

  1. #1
    Join Date
    Jun 2001
    Posts
    316
    i create a mat view like:
    CREATE MATERIALIZED VIEW test_name
    BUILD IMMEDIATE
    REFRESH
    COMPLETE
    ON DEMAND
    ENABLE QUERY REWRITE
    AS
    SELECT * FROM TEST_SAM

    select * from test_name;

    1 s
    2 a
    3 r

    now i create :

    CREATE VIEW test_name1 AS SELECT * FROM TEST_SAM;

    select * from test_name1;

    1 s
    2 a
    3 r

    now i do
    insert into test_sa values (4,'h');
    inserted
    commit;

    now i do

    select * from test_name;
    it gives again

    1 s
    2 a
    3 r

    while

    select * from test_name1;

    1 s
    2 a
    3 r
    4 h

    why does normal views refresh and the materialized view not!!!

    can any1 pls explain
    thanx in advance

  2. #2
    Join Date
    Feb 2001
    Location
    Paris, France
    Posts
    809
    you wrote :
    REFRESH COMPLETE ON DEMAND

    and you wonder why it does not refresh ???

    RTM !!!

  3. #3
    Join Date
    Jun 2001
    Posts
    316
    so u say that i remove the "on demand" clause and it would give the refreshed data....?
    or do i have to run some package for it to happen?
    thanx

  4. #4
    Join Date
    Feb 2001
    Location
    Paris, France
    Posts
    809
    you have to :

    RTM

    PS : Read The Man

  5. #5
    Join Date
    Aug 2001
    Location
    Hyderabad, India
    Posts
    29

    Smile

    In the Normal view, the Sql statement will be stored. Whenever you query the View, it will execute the statement and retrieves the data.

    Where as in the Materialized View, It will maintains a snapshot. The snapshot will be refreshed based on the defination of the Materialized view you created.
    Venkateshwarlu.K

  6. #6
    Join Date
    Jun 2001
    Posts
    316
    I removed and recreated it.....wihtout the o demand clause
    but still it doesnt give me the refeshed data..

    CREATE MATERIALIZED VIEW test_name
    BUILD IMMEDIATE
    REFRESH
    complete
    ENABLE QUERY REWRITE
    AS
    SELECT * FROM TEST_SAM

    this is wat i used....

    thanx

  7. #7
    Join Date
    Aug 2001
    Location
    Waterloo, On
    Posts
    547
    I think you have to specify intervals at which Oracle will refresh data in your materialised view, in addition to refresh type.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width