gname Name of the replication group to which priority group pgroup belongs pgroup Priority group to which new value and priority are being added value Literal value that is being assigne
Trang 1NUMBER
DATE
RAW
NCHAR (Oracle8 only)
NVARCHAR2 (Oracle8 only)
Parameters are summarized in the following table
gname Name of the replication group to which priority group pgroup belongs
pgroup Priority group to which new value and priority are being added
value Literal value that is being assigned added to pgroup
sname (Oracle7 only) Not used
16.3.4.2.1 Exceptions
The DROP_PRIORITY_<datatype> procedure may raise the following exceptions:
missingprioritygroup −23336 Priority group pgroup does not exist
missingrepgroup −23373 Replication group gname does not exist
nonmasterdef −23312 Calling site is not the master definition site
paramtype −23325 Datatype of value is not the same as the datatype for priority group pgroup
16.3.4.2.2 Restrictions
You must call DROP_PRIORITY_<datatype> from the master definition site
16.3.4.2.3 Example
You can specify the member to be dropped by its data value rather than its priority (as was done with
DROP_PRIORITY) In the following example, we drop the member of the PG_PRODUCTION_STATUS priority group whose value is CONCEPT:
BEGIN
DBMS_REPCAT.DROP_PRIORITY_VARCHAR2(
gname => 'SPROCKET',
pgroup => 'PG_PRODUCTION_STATUS',
value => 'CONCEPT');
END;
As with DROP_PRIORITY, this change takes effect after
DBMS_REPCAT.GENERATE_REPLICATION_SUPPORT has been run for any object in the replication group
16.2 Column Groups with
DBMS_REPCAT
16.4 Site Priority Groups with DBMS_REPCAT
Trang 2Copyright (c) 2000 O'Reilly & Associates All rights reserved.
[Appendix A] What's on the Companion Disk?
Trang 316.4 Site Priority Groups with DBMS_REPCAT
The site priority group technique resolves conflicts by accepting the data that originated from the site with the highest priority
16.4.1 About Site Priority Groups
The procedures for creating and maintaining site priority groups are almost completely analogous to those
used for priority groups The similarity arises because a site priority group is actually a special case of a
priority group in which the range of data values is the range of global names in the replicated environment In fact, Oracle stores the information about priority groups and site priority groups in the same data dictionary views (DBA_REPPRIORITY_GROUP and DBA_REPPRIORITY) However, unlike in the priority group technique, you should base site priority group rankings on your confidence in the data from each site, as opposed to the business rules associated with a workflow
Use the following programs to maintain site priority groups:
DBMS_REPCAT.ADD_SITE_PRIORITY_SITE
DBMS_REPCAT.ALTER_SITE_PRIORITY
DBMS_REPCAT.ALTER_SITE_PRIORITY_SITE
DBMS_REPCAT.COMMENT_ON_SITE_PRIORITY
DBMS_REPCAT.DEFINE_SITE_PRIORITY
DBMS_REPCAT.DROP_SITE_PRIORITY
DBMS_REPCAT.DROP_SITE_PRIORITY_SITE
16.4.2 Creating, Maintaining, and Dropping Site Priorities
DBMS_REPCAT's DEFINE_SITE_PRIORITY and DROP_SITE_PRIORITY procedures allow you to create and drop site priorities Use the COMMENT_ON_SITE_PRIORITY procedure to maintain the comment on the site priority
16.4.2.1 The DBMS_REPCAT.DEFINE_SITE_PRIORITY procedure
The DEFINE_SITE_PRIORITY procedure creates a site priority group You can add sites to this group later Specifications differ for Oracle7 and Oracle8 as follows
Here is the Oracle7 specification:
PROCEDURE DBMS_REPCAT.DEFINE_SITE_PRIORITY
(gname IN VARCHAR2 := '',
name IN VARCHAR2,
comment IN VARCHAR2 := NULL,
sname IN VARCHAR2 := '');
Here is the Oracle8 specification:
738
Trang 4PROCEDURE DBMS_REPCAT.DEFINE_SITE_PRIORITY
(gname IN VARCHAR2 := '',
name IN VARCHAR2,
comment IN VARCHAR2 := NULL)
Parameters are summarized in the following table
gname Name of the replication group containing the site priority group
name Name of the site priority group
comment Comment, visible in DBA_REPPRIORITY_GROUP data dictionary view
sname (Oracle7 only) Not used
16.4.2.1.1 Exceptions
The DEFINE_SITE_PRIORITY procedure may raise the following exceptions:
duplicateprioritygroup −23335 Site priority group name already exists
missingrepgroup −23373 Replication group gname does not exist
nonmasterdef −23312 Calling site is not the master definition site
16.4.2.1.2 Restrictions
You must call DBMS_REPCAT.DEFINE_SITE_PRIORITY from the master definition site
16.4.2.1.3 Example
The following call creates a site priority group called SP_NORTH_AMERICA:
BEGIN
DBMS_REPCAT.DEFINE_SITE_PRIORITY(
gname => 'SPROCKET',
name => 'SP_NORTH_AMERICA',
comment => 'Site Priority for North American Locations'); END;
These changes take effect after the next call to DBMS_REPCAT.GENERATE_REPLICATION_SUPPORT for an object in the SPROCKET replication group
16.4.2.2 The DBMS_REPCAT.DROP_SITE_PRIORITY procedure
The DROP_SITE_PRIORITY procedure drops an existing site priority group that is no longer in use
Specifications differ for Oracle7 and Oracle8 as follows
Here is the Oracle7 specification:
PROCEDURE DBMS_REPCAT.DROP_SITE_PRIORITY
(gname IN VARCHAR2 := '',
name IN VARCHAR2,
sname IN VARCHAR2 := '');
Here is the Oracle8 specification:
PROCEDURE DBMS_REPCAT.DROP_SITE_PRIORITY
(gname IN VARCHAR2 := '',
[Appendix A] What's on the Companion Disk?
Trang 5name IN VARCHAR2)
Parameters are summarized in the following table
gname Name of the replication group containing the site priority group
name Name of the site priority group
sname (Oracle7 only) Not used
WARNING: As with the DROP_PRIORITY_GROUP procedure, do not attempt to drop a
site priority group that is acting as an UPDATE conflict resolution handler for a column
group First, use DROP_UPDATE_RESOLUTION to drop the conflict handler for the
column group
16.4.2.2.1 Exceptions
The DROP_SITE_PRIORITY procedure may raise the following exceptions:
missingrepgroup −23373 Replication group gname does not exist
nonmasterdef −23312 Calling site is not the master definition site
referenced −23332 Site priority group is used by existing conflict resolution method
16.4.2.2.2 Restrictions
You must call DBMS_REPCAT.DROP_SITE_PRIORITY from the master definition site
16.4.2.2.3 Example
The following example shows how to drop a site priority group that is no longer in use:
BEGIN
DBMS_REPCAT.DROP_SITE_PRIORITY(
gname => 'SPROCKET',
name => 'SP_NORTH_AMERICA');
END;
16.4.2.3 The DBMS_REPCAT.COMMENT_ON_SITE_PRIORITY procedure
The COMMENT_ON_SITE_PRIORITY procedure creates or replaces the comment field in the
DBA_REPPRIORITY_GROUP data dictionary view for the specified site priority group Specifications differ for Oracle7 and Oracle8 as follows
Here is the Oracle7 specification:
PROCEDURE DBMS_REPCAT.COMMENT_ON_SITE_PRIORITY
(gname IN VARCHAR2 := '',
name IN VARCHAR2,
comment IN VARCHAR2,
sname IN VARCHAR2 := '');
Here is the Oracle8 specification:
PROCEDURE DBMS_REPCAT.COMMENT_ON_SITE_PRIORITY
(gname IN VARCHAR2 := '',
name IN VARCHAR2,
16.4.2 Creating, Maintaining, and Dropping Site Priorities 740