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 p
Trang 115.4.2.2 The DBMS_OFFLINE_OG.BEGIN_LOAD procedure
Call 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 Exceptions
The BEGIN_LOAD procedure may raise the following exceptions:
Name Number Description
badargument −23430 gname is NULL or ` '
missingrepgroup −23373 Group gname does not exist
wrongsite −23433 Raised if BEGIN_LOAD or END_LOAD is executed at a site other than
new_site wrongstate −23431 Group gname is not in NORMAL state at the master definition site
15.4.2.2.2 Restrictions
The 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 procedure
You 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 Exceptions
The END_INSTANTIATION procedure may raise the following exceptions:
Name Number Description
badargument −23430 gname is NULL or ` '
missingrepgroup −23373 Group gname does not exist
nonmasterdef −23312 Routine is not being called from master definition site
sitealreadyexists −23432 New_site already exists
wrongstate −23431 Group gname is not in NORMAL state at the master definition site
[Appendix A] What's on the Companion Disk?
Trang 215.4.2.3.2 Restrictions
The 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 procedure
Call 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 Exceptions
The END_LOAD procedure may raise the following exceptions:
Name Number Description
badargument −23430 gname is NULL or ` '
missingrepgroup −23373 Group gname does not exist
wrongsite −23433 Raised if BEGIN_LOAD or END_LOAD is executed at a site other than
new_site wrongstate −23431 Group gname is not in NORMAL state at master definition site
15.4.2.4.2 Restrictions
The 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 procedure
Call 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 Exceptions
The RESUME_SUBSET_OF_MASTERS procedure may raise the following exceptions:
Name Number Description
badargument −23430 gname is NULL or ` '
missingrepgroup −23373 Group gname does not exist
nonmasterdef −23312 Routine is not being called from master definition site
Trang 3sitealreadyexists −23432 New_site already exists
wrongstate −23431 Group gname is not in NORMAL state at master definition site
15.4.2.5.2 Restrictions
The 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.3 DBMS_REPCAT:
Replication Environment
Administration
15.5 DBMS_RECTIFIER_DIFF:
Comparing Replicated Tables
Copyright (c) 2000 O'Reilly & Associates All rights reserved.
[Appendix A] What's on the Companion Disk?
Trang 415.5 DBMS_RECTIFIER_DIFF: Comparing Replicated Tables
If you are not sure whether the data at two sites are identical, you can use the DBMS_RECTIFIER_DIFF package to find out The DIFFERENCES procedure compares the data in a table at a master site with the same table at a reference site After determining the differences, you can use DBMS_RECTIFIER_DIFF.RECTIFY
to synchronize the tables
15.5.1 Getting Started with DBMS_RECTIFIER_DIFF
The DBMS_RECTIFIER_DIFF package is created when the Oracle database is installed The dbmsrepc.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 prvtrctf.sql creates the public synonym
DBMS_RECTIFIER_DIFF No EXECUTE privileges are granted on DBMS_RECTIFIER_DIFF; only the owner (SYS) and those with the EXECUTE ANY PROCEDURE system privilege may execute the package Table 15.6 summarizes the DBMS_RECTIFIER_DIFF programs
Table 15.6: DBMS_RECTIFIER_DIFF.DIFFERENCES Programs
DIFFERENCES Determines differences between truth table and comparison table No
RECTIFY Synchronizes comparison table with truth table No
15.5.2 DBMS_RECTIFIER_DIFF Interface
This section describes the programs available in the DBMS_RECTIFIER_DIFF package
15.5.2.1 The DBMS_RECTIFIER.DIFFERENCES procedure
The DIFFERENCES procedure compares the data in a table at a master site with the same table at a reference site The reference need not be the master definition site
The procedure stores discrepancies between the reference table and comparison table in a "missing rows" table, which the user must create It populates the table specified by the missing_rows_oname1 parameter with rows that exist in the reference table but not the comparison table, and rows that exist in the comparison table but not the reference table The table identified by the missing_rows_oname2 parameter has one record for every record in missing_rows_oname1, which identifies which site has the record
Here is the specification:
PROCEDURE DBMS_RECTIFIER_DIFF.DIFFERENCES
(sname1 IN VARCHAR2,
oname1 IN VARCHAR2,
699
Trang 5reference_site IN VARCHAR2 := '',
sname2 IN VARCHAR2,
oname2 IN VARCHAR2,
comparison_site IN VARCHAR2 := '',
where_clause IN VARCHAR2 := '',
{column_list IN VARCHAR2 := '' |
array_columns IN dbms_utility.name_array,},
missing_rows_sname IN VARCHAR2,
missing_rows_oname1 IN VARCHAR2,
missing_rows_oname2 IN VARCHAR2,
missing_rows_site IN VARCHAR2 := '',
max_missing IN INTEGER,
commit_rows IN INTEGER := 500);
Parameters are summarized in the following table
sname1 Name of schema that owns oname1
oname1 Table at reference_site (truth table)
reference_site The global_name of site with truth table If NULL or ` ' (default), truth table is
assumed to be local
sname2 Name of schema that owns oname2
oname2 The comparison table
comparison_site or ` ', table is assumed to be local
where_clause Optional predicate that can be used to limit set of rows compared (e.g.,`WHERE
STATE = `CA'')
column_list Comma−separated list of one or more columns whose values are to be compared If
NULL or ` ' (default), then all columns are used There should not be any whitespace after the commas
array_columns PL/SQL table of column names; either column_list or array_columns can be passed,
not both
missing_rows_sname Name of schema that owns missing_rows_oname1
missing_rows_oname1 Name of table containing records that do not exist in both truth table and comparison
table
missing_rows_oname2 Table that holds information telling which table owns each record in
missing_rows_oname1
missing_rows_site The global_name of site where tables missing_rows_oname1 and
missing_rows_oname2 exist; if NULL or ` ' (default), tables are assumed to be local max_missing The maximum number or rows to insert into missing_rows_oname1 before exiting;
can be any value > 1
comming_rows Commit rows inserted into missing_row_oname1 after this many records
15.5.2.1.1 Exceptions
The DIFFERENCES procedure may raise the following exceptions:
badmrname −23377 The oname1 is the same as missing_rows_oname1
badname −23368 The sname, oname, missing_rows_sname,
[Appendix A] What's on the Companion Disk?