), there is also a U (corresponding to the UPDATE operation ).
SQL> insert into t_pk values (1, 'A', 5 );One row has been created.SQL> insert into t_pk values (2, 'B', 7 );One row has been created.SQL> insert into t_pk values (3, 'C', 9 );One row has been created.SQL> update t_pk set name = 'C' where id = 1;1 row updated.SQL> update t_pk set id = 4 where id = 2;1 row updated.SQL> delete t_pk where id = 3;One row has been deleted.SQL> select id, dmltype $, old_new $ from mlog $ _ t_pk;ID D O----
ORA-12034: The materialized view log on SCOTT. "USER_TABLE" is newer than the last refresh
Recently, when I handed over my work, I found that several schedule jobs were not successfully executed. I have shown that one of them is due to database migration, if the IP address of the host that calls dblink is not changed in tnsnames, an error cannot be reported in
In 11.2, materialized view logs also add features that, for local materialized views, can now be refreshed using the commit SCN instead of the timestamp method in the previous version.
Look at a simple example:
Sql> SELECT * from V$version;
BANNER
--------------------------------------------------------------------------------
Oracle database11genterprise Ed
: reduces the high watermark line of Materialized view log tables.Use triggers to customize the materialized view refresh: You can create a trigger on the materialized view to customize
materialized views are managed together with tables, in PLSQL tools that are frequently used, you cannot delete a table by deleting it. (You cannot right-click the table and select 'drop' to delete the materialized view.) You can use the following statement to delete the table: dr
016-09-27 14:36:09,802 ERROR [500.jsp]-Could not commit JDBC transaction; Nested exception is java.sql.sqlexception:ora-12048: Refreshes the materialized view "the". Check_form "Error
ORA-12034: "Teenagers". The materialized view log on Ch_task is newer than what was last re
);1 rows have been created.Sql> commit;Submit complete.sql> exec Dbms_mview.refresh (' Mv_t_name ')The PL/SQL process has completed successfully.Sql> Select ID, name, m_row$$, snaptime$$, dmltype$$ from mlog$_t;Sql> Select Mview_name, Last_refresh_date, staleness from User_mviews;Materialized view Mv_t_name refreshes each record in the materialized
refresh_fast_after_onetab_dml sum_num, count (expr) is not provided)Refresh_fast_after_any_dml yangtk. mv_abc MV log no serial numberRefresh_fast_after_any_dml view the reason why refresh_fast_after_onetab_dml is disabled
Based on the above information, we can determine the cause of the problem. sum (column) is used for clustering materialized views, but count (
: Refers to materialized views without any refreshes.
There are two types of materialized views: On demand and on commitOn demand: As the name suggests, only when the materialized view "needs" is refreshed is it refreshing (refresh), that is, updating materialized views to e
, completely refresh on demand -- refresh method start with sysdate -- first refresh time next sysdate + 1/12 -- refresh interval as select 1 id 'A' name FROM dual;
During execution in PLSQL, materialized views may fail to be created due to comments. Therefore, delete comments during creation.
To modify the refresh frequency in some cases, run the following command to modify the refresh interval:
ALTER MATERIALI
materialized view, or you cannot use the incremental refresh--3, PRIMARY key update, table must have primary key--About Delete--Delete is log and materialized view to be deleted separatelyDROP materialized
2014-06-08 Baoxinjian1. usage
A materialized view is a database object that includes a query result, which is a local copy of the remote data, or is used to generate a summary table based on the sum of the data tables.Materialized views store data based on remote tables and can also be referred to as snapshots. For replication, materialized views allow you
(incremental FAST), FORCE refresh, not refresh (NEVER)
FAST: Incremental FAST refresh
Exec dbms_mview.refresh ('table name', 'F ')Exec dbms_mview.refresh ('dbtest. t', 'F ');
COMPLETE: full refresh
Exec dbms_mview.refresh ('table name', 'C ');Exec dbms_mview.refresh ('dbtest. t', 'C ');
FORCE: determines whether a Refresh can be performed quickly. If a Refresh can be performed quickly, perform fast refresh. If not, perform complete refresh.
NEVER: Do not refresh
3. Delete
(incremental FAST), FORCE refresh, not refresh (NEVER)
FAST: Incremental FAST refresh
Exec dbms_mview.refresh ('table name', 'F ')
Exec dbms_mview.refresh ('dbtest. t', 'F ');
COMPLETE: full refresh
Exec dbms_mview.refresh ('table name', 'C ');
Exec dbms_mview.refresh ('dbtest. t', 'C ');
FORCE: determines whether a Refresh can be performed quickly. If a Refresh can be performed quickly, perform fast refresh. If not, perform complete refresh.
NEVER: Do not refresh
3. Delete
entire materialized view. If you choose force, Oracle will be refreshed to determine whether a quick refresh can be done, if you can use the fast method, otherwise use the complete method. Never refers to materialized views without any refreshes.
For a materialized view tha
Soo. release_no = dsso. release_no and Soo. sequence_no = dsso. sequence_no; --- the creation and deletion of materialized views are the same as those of tables or view DDL: Drop materialized view log on materialized_view_log_nam
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.