15.4 DBMS_OFFLINE_OG: Performing Site InstantiationWhen you add a new site to your replicated environment, you must not only create the replicated objects, but also populate snapshots and replicated tables with a copy of the current data. Although you can set the copy_rows parameter to TRUE in your call to the DBMS_REPCAT package's CREATE_MASTER_REPOBJECT or ADD_MASTER_DATABASE procedure, this option is not practical for schemas that are large or complex. The DBMS_OFFLINE_OG package provides a more feasible method of site instantiation. The general idea is that you export data from an existing master site and import it into the new master site. While the import is taking place, the existing master sites queue data updates to the new site, but do not actually send the updates until the load is complete. 15.4.1 Getting Started with DBMS_OFFLINE_OGThe DBMS_OFFLINE_OG package is created when the Oracle database is installed. The dbmsofln.sql script (found in the built-in packages source directory, as described in Chapter 1) contains the source code for this package's specification. This script is called by catrep.sql , which must be run to install the advanced replication packages. The wrapped sql script prvtofln.plb creates the public synonym DBMS_OFFLINE_OG. No EXECUTE privileges are granted on DBMS_OFFLINE_OG; only the owner (SYS) and those with the EXECUTE ANY PROCEDURE system privilege may execute the package. The programs in DBMS_OFFLINE_OG are listed in Table 15.5 .
15.4.2 DBMS_OFFLINE_OG InterfaceThis section describes the programs available in the DBMS_OFFLINE_OG package. 15.4.2.1 The DBMS_OFFLINE_OG.BEGIN_INSTANTIATION procedureThe BEGIN_INSTANTIATION procedure is called from the master definition site to flag the beginning of offline instantiation. Here's the specification: PROCEDURE DBMS_OFFLINE_OG.BEGIN_INSTANTIATION (gname IN VARCHAR2, new_site IN VARCHAR2); Parameters are summarized in the following table.
15.4.2.1.1 ExceptionsThe BEGIN_INSTANTIATION procedure may raise the following exceptions:
15.4.2.1.2 RestrictionsThe procedures in DBMS_OFFLINE_OG must be called in the appropriate order from the appropriate sites. The following example illustrates the proper use of this package. 15.4.2.1.3 ExampleThe following table summarizes the steps you should follow when you use the procedures in the DBMS_OFFLINE_OG package.
The following scenario shows how instantiate a new site. Here we add the site D7NY.BIGWHEEL.COM to the replication group SPROCKET using DBMS_OFFLINE_OG. Assume that the master definition site is D7CA.BIGWHEEL.COM.
15.4.2.2 The DBMS_OFFLINE_OG.BEGIN_LOAD procedureCall the BEGIN_LOAD procedure from the new master site before you begin importing data. The specification follows: PROCEDURE DBMS_OFFLINE_OG.BEGIN_LOAD (gname IN VARCHAR2, new_site IN VARCHAR2); These parameters are identical to those described for the BEGIN_INSTANTIATION procedure. See that section as well for an example of using the procedures in the DBMS_OFFLINE_OG procedure. 15.4.2.2.1 ExceptionsThe BEGIN_LOAD procedure may raise the following exceptions:
15.4.2.2.2 RestrictionsThe procedures in DBMS_OFFLINE_OG must be called in the appropriate order from the appropriate sites. The example under BEGIN_INSTANTIATION illustrates the proper use of this package. 15.4.2.3 The DBMS_OFFLINE_OG.END_INSTANTIATION procedureYou call the END_INSTANTIATION procedure from the master definition site to flag the end of offline instantiation. The specification follows: PROCEDURE DBMS_OFFLINE_OG.END_INSTANTIATION (gname IN VARCHAR2, new_site IN VARCHAR2); These parameters are identical to those described for the BEGIN_INSTANTIATION procedure. See that section as well for an example of using the procedures in the DBMS_OFFLINE_OG package. 15.4.2.3.1 ExceptionsThe END_INSTANTIATION procedure may raise the following exceptions:
15.4.2.3.2 RestrictionsThe procedures in DBMS_OFFLINE_OG must be called in the appropriate order from the appropriate sites. The example under BEGIN_INSTANTIATION illustrates the proper use of this package. 15.4.2.4 The DBMS_OFFLINE_OG.END_LOAD procedureCall the END_LOAD procedure from the new master site when you are finished importing data. The specification follows: PROCEDURE DBMS_OFFLINE_OG.END_LOAD (gname IN VARCHAR2, new_site IN VARCHAR2); These parameters are identical to those described for the BEGIN_INSTANTIATION procedure. See that section as well for an example of using the procedures in the DBMS_OFFLINE_OG package. 15.4.2.4.1 ExceptionsThe END_LOAD procedure may raise the following exceptions:
15.4.2.4.2 RestrictionsThe procedures in DBMS_OFFLINE_OG must be called in the appropriate order from the appropriate sites. The example under BEGIN_INSTANTIATION illustrates the proper use of this package. 15.4.2.5 The DBMS_OFFLINE_OG. RESUME_SUBSET_OF_MASTERS procedureCall this procedure from the master definition site to resume replication activity for existing sites while the new site is instantiated. The specification follows: PROCEDURE DBMS_OFFLINE_OG.RESUME_SUBSET_OF_MASTERS (gname IN VARCHAR2, new_site IN VARCHAR2); These parameters are identical to those described for the BEGIN_INSTANTIATION procedure. See that section as well for an example of using the procedures in the DBMS_OFFLINE_OG package. 15.4.2.5.1 ExceptionsThe RESUME_SUBSET_OF_MASTERS procedure may raise the following exceptions:
15.4.2.5.2 RestrictionsThe procedures in DBMS_OFFLINE_OG must be called in the appropriate order from the appropriate sites. The example under BEGIN_INSTANTIATION illustrates the proper use of this package.
Copyright (c) 2000 O'Reilly & Associates. All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|