Alibabacloud.com offers a wide variety of articles about oracle create materialized view, easily find your oracle create materialized view information here online.
Oracle databases support materialized views-not virtual tables based on base tables, but based on actual tables that are actually present in a table-materialized views are stored on nonvolatile storage devices.The following experiment creates the Fast refresh mode on COMMIT, which is implemented in MySQL with the trigger INSERT, UPDATE, delete refresh operation1,
Today, someone asked me a materialized view query rewrite problem, finally found that the problem and materialized view of the function is not much relationship, but the implicit conversion caused by the problem.
Let's illustrate the problem by example:
Sql> CREATE TABLE T
In query rewrite, we can see that this technology is inseparable from one thing, the materialized view, mview for short. this is the first Technology launched by Oracle in 8i. In addition to using query rewrite, mview also plays an important role in master-slave replication, here we are mainly concerned about query rewrite. O
The refresh of materialized views is actually not fundamentally different from normal SQL execution, so you can customize the refresh operation by creating triggers on materialized views.
Just two days ago, someone asked me on the blog, if you add a timestamp column to the materialized view and automatically maintain
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 refreshed
Org.springframework.transaction.T
Oracle dblinke+ materialized view the new requirement of synchronizing data items for two databases is to synchronize parts of the two Oracle databases, and now try several methods in the experimental environment, and then record the Dblink and materialized views synchronize
Build a Test tableCREATE TABLE T_table nologging as SELECT * from Dba_objects;create table T_table_1 nologging as SELECT * from Dba_tables;--Create a log recordCreate materialized view Log on t_table with ROWID, sequence (Object_name,object_type,owner) including new Values;create
)
1.3 Modifying Tnsnames.ora files
The main site and materialized view site in the Tnsnames.ora parameter files are added below, note that you need to modify the host's IP address, as well as the service_name value, port generally defaults to 1521.
MAIN =
(DESCRIPTION =
(Address_list =
(address = (PROTOCOL = TCP) (HOST = 19.168.2.105) (PORT = 1521))
)
(Connect_data =
(service_name = portal)
)
)
Two Oracle 10g databases to synchronize data with materialized views in a specific implementation process
Source Library is 192.168.1.81
Target Library is 192.168.1.96
The server used for the statistics library is 81
Create a read-only user snap_query on the Statistics Gallery 81 for querying
Conn/as SYSDBA
Create
Oracle Stored Procedure refresh materialized view SQL:
Create or replace package body REFRESH_MVIEW IS
-- Author: 241433-- Created: 4:25:04-- Purpose: This PKG is for REFRESH MVIEW
-- Public type declarationsCONS_BCR_LIST VARCHAR2 (40): = 'wb_ui_block_list_all_vw ';CONS_BCR_LIST_QUERY VARCHAR2 (40): = 'wb_ui_block_list
Tags: art limited to_date zed LIS creat rom Upper testI. Creating a remote materialized view log SOURCE side: CREATE materialized VIEW LOG on Tozwdb.test tablespace tozwdb_data with ROWID; Ii. Rights of payment Target Library Create
limitations of the fast refresh of three materialized views are very different, but not the other way. You can specify several options when you create a materialized view, following a brief description of several major choices:Creation mode (Build Methods): Includes two types of build immediate and build deferred. Bui
commits , the materialized view is immediately refreshed to make the data and the base table consistent.2. On demand materialized viewThe creation of materialized views is inherently complex and requires optimization of parameter settings, especially for large production database systems. But
problem:
-Stop the refresh of at least one other materialized view that is using the materialized view log beforeCreating the new one.-In production system the previous option might not be possible. for this situation, a temporary materialized
. This is evidenced by the query results of user_segment;
Parameters related to materialized views:
COMPATIBLE must be later than 8.1.0
QUERY_REWRITE_ENABLED = TRUE enable query rewriting (default
QUERY_REWRITE_INTEGRITY =
ENFORCED-only restrictions and rules ENFORCED and guaranteed by Oracle are used for query (default );
TRUSTED-in addition to Oracle's mandatory and guaranteed constraints and rules, the
data and the base table consistent2. On demand materialized view: the creation of materialized views is inherently complex and requires optimization of parameter settings, especially for large production database systems. But Oracle allows this to be done in the simplest way, similar to a normal
Today, we will mainly discuss the correct use of MQT materialized query tables in the DB2 materialized view, the following is a detailed description of the main content of the correct use of the MQT materialized query table in the materialized
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.