Method for read-only physicalized view sites in a replication environment

xiaoxiao2021-03-06  50

Purpose: Create an entity view site, timing refresh, get changes in the specified table in the primary site, this physical site can be used as a query server

step:

1. Create an entity view log table at the primary site

Create Materialized View Log on Kamus.account2004;

2. Create a public database link on the physicalized view site

Conn System / Password

CREATE PUBLIC DATABASE LINK ORCL USING 'ORCL'

3. Create a refresh group on the physicalized view site, this example is refreshed once

Conn System / Password

Begin dbms_refresh.make (name => 'kamus.test_repg', list => ', new_date => sysdate, interval =>' sysdate 3 / (24 * 60) ', IMPLICIT_DESTROY => False, rollback_seg =>' , Push_deferred_rpc => true, refresh_after_ERRORS => false); end; / commit; Note: You must commit here, otherwise the created refresh group does not really take effect.

4. Create a private database link on the physical view site

CONN KAMUS / PASSWORD

Create Database Link Orcl Connect To Kamus Identified by Password;

5. Create a physicalized view at the physicalized view site

CONN KAMUS / PASSWORD

Create Materialized View Kamus.account2004 Refresh Fast With Primary Key As SELECT * from kamus.account2004@orcl;

6. Added views on the physicalized view site to join the refresh group

CONN KAMUS / PASSWORD

Exec dbms_refresh.add (name => 'kamus.test_repg', list => 'kamus.account2004', lax => true);

7. Test, update the Account2004 table in the primary site, check the entity to try the view in the site in 3 minutes, and the discovery update has been copied.

The simpler method for establishing a read-only physicalized view site:

You don't need to create any other users, such as the communicator required by the replication environment, refreshing, recipients, etc.

No need to create any replication group

No need to generate any copy objects, do not need to generate replication support for any object

转载请注明原文地址:https://www.9cbs.com/read-115788.html

New Post(0)