Oracle8i Replication Management API Reference Release 2 (8.1.6) Part Number A76958-01 |
|
Manage Replicated Environment with APIs, 2 of 9
As your data delivery needs change due to growth, shrinkage, or emergencies, you are undoubtedly going to need to change the configuration of your replication environment. This section is devoted to managing the master sites of your replication environment, which will help you alter and reconfigure your master sites.
Many replication administrative tasks can be performed only from the master definition site. Use the DBMS_REPCAT.RELOCATE_MASTERDEF procedure to move the master definition site to another master site. This API is especially useful when the master definition site becomes unavailable and you need to specify a new master definition site (see "Option 2").
If all master sites are available, complete the following:
Executed As: Replication Administrator
Executed At: Any Master Site
Replication Status: Normal
CONNECT repadmin/repadmin@orc1.world BEGIN DBMS_REPCAT.RELOCATE_MASTERDEF ( gname => 'SCOTT_MG', old_masterdef => 'ORC1.WORLD', new_masterdef => 'ORC2.WORLD', notify_masters => TRUE, include_old_masterdef => TRUE); END; /
If the old master definition site is NOT available, complete the following:
Executed As: Replication Administrator
Executed At: Any Master Site
Replication Status: Normal
CONNECT repadmin/repadmin@orc3.world BEGIN DBMS_REPCAT.RELOCATE_MASTERDEF ( gname => 'SCOTT_MG', old_masterdef => 'ORC1.WORLD', new_masterdef => 'ORC2.WORLD', notify_masters => TRUE, include_old_masterdef => FALSE); END; /
As your replicated environment expands, you can use the ADD_MASTER_DATABASE procedure to add additional master sites to an existing master group. Executing this procedure replicates existing master objects to the new site.
Before you add a new master site, be sure that you properly set up your new master site for replication. Make sure that you follow the steps described in the "Set Up Master Sites" section .
Executed As: Replication Administrator
Executed At: Master Definition Site
Replication Status: Quiesced
CONNECT repadmin/repadmin@orc1.world -- If the replication status is normal, change the status to quiesced. BEGIN DBMS_REPCAT.SUSPEND_MASTER_ACTIVITY ( gname => 'SCOTT_MG'); END; / BEGIN DBMS_REPCAT.ADD_MASTER_DATABASE ( gname => 'SCOTT_MG', master => 'ORC4.WORLD', use_existing_objects => TRUE, copy_rows => TRUE, propagation_mode => 'ASYNCHRONOUS'); END; / --NOTE: You should wait until the DBA_REPCATLOG view is empty. This view has --temporary information that is cleared after successful execution. Execute --the following SELECT statement in another SQL*Plus session to monitor --the DBA_REPCATLOG view: -- --SELECT * FROM dba_repcatlog WHERE gname = 'SCOTT_MG'; BEGIN DBMS_REPCAT.RESUME_MASTER_ACTIVITY ( gname => 'SCOTT_MG'); END; /
When it becomes necessary to remove a master site from a master group, use the REMOVE_MASTER_DATABASES procedure to drop one or more master sites.
Executed As: Replication Administrator
Executed At: Master Definition Site
Replication Status: Quiesced
CONNECT repadmin/repadmin@orc1.world -- If the replication status is normal, change the status to quiesced. BEGIN DBMS_REPCAT.SUSPEND_MASTER_ACTIVITY ( gname => 'SCOTT_MG'); END; / BEGIN DBMS_REPCAT.REMOVE_MASTER_DATABASES ( gname => 'SCOTT_MG', master_list => 'ORC4.WORLD'); END; / --NOTE: You should wait until the DBA_REPCATLOG view is empty. Execute --the following SELECT statement in another SQL*Plus session to monitor --the DBA_REPCATLOG view: -- --SELECT * FROM dba_repcatlog WHERE gname = 'SCOTT_MG'; BEGIN DBMS_REPCAT.RESUME_MASTER_ACTIVITY ( gname => 'SCOTT_MG'); END; /
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|