15. Advanced Replication
Contents:
If you are using the advanced replication option, you will use Oracle built-in packages to create and maintain a replicated environment. This chapter describes packages and the roles they play in the configuration and upkeep of a multi-master environment.
In this chapter, the presentation is more or less chronological -- the packages and their programs are presented in roughly the order in which you would run them in a real advanced replication situation. 15.1 DBMS_REPCAT_AUTH: Setting Up Administrative AccountsThe first step in creating an advanced replication environment is to create administrative and end user accounts. The DBMS_REPCAT_AUTH and DBMS_REPCAT_ADMIN packages contain programs that grant and revoke the privileges required in such an environment. This section describes the DBMS_REPCAT_AUTH operations; the next section describes DBMS_REPCAT_ADMIN. 15.1.1 Getting Started with DBMS_REPCAT_AUTHThe DBMS_REPCAT_AUTH 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, Introduction ) 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 prvtrepc.sql creates the public synonym DBMS_REPCAT_AUTH. No EXECUTE privileges are granted on DBMS_REPCAT_AUTH; only the owner (SYS) and those with the EXECUTE ANY PROCEDURE system privilege may execute the package. 15.1.1.1 DBMS_REPCAT_AUTH programsThe DBMS_REPCAT_AUTH programs are listed in Table 15.1 .
15.1.1.2 DBMS_REPCAT_AUTH exceptionsThe DBMS_REPCAT_AUTH package may raise exception ORA-01917 if the specified user does not exist. 15.1.2 Granting and Revoking Surrogate SYS AccountsThe DBMS_REPCAT_AUTH package contains programs that let you grant and revoke "surrogate SYS" privileges to a user. Private database links owned by SYS connect to the surrogate SYS account at remote sites, thereby avoiding the need for any database links that connect to SYS. 15.1.2.1 The DBMS_REPCAT_AUTH.GRANT_SURROGATE_REPCAT procedureThe GRANT_SURROGATE_REPCAT procedure grants surrogate SYS privileges to a particular user. The specification is, PROCEDURE DBMS_REPCAT_AUTH.GRANT_SURROGATE_REPCAT (userid IN VARCHAR2); where userid is the Oracle userid for whom you are granting privileges. 15.1.2.1.1 ExceptionsThe GRANT_SURROGATE_REPCAT procedure may raise the exception ORA-1917 if the specified user does not exist. 15.1.2.1.2 ExampleThe following example illustrates how you might use GRANT_SURROGATE_REPCAT: BEGIN DBMS_REPCAT_AUTH.GRANT_SURROGATE_REPCAT('REPSYS'); END; This call configures the REPSYS account to perform tasks required to replicate remote DML and DDL at this site. The SYS account from remote sites should have private database links connecting to this account. The privileges granted include EXECUTE privileges on replication packages. DML privileges are data dictionary tables associated with replication. 15.1.2.2 The DBMS_REPCAT_AUTH.REVOKE_SURROGATE_REPCAT procedureThe REVOKE_SURROGATE_REPCAT procedure revokes the surrogate SYS privileges that have previously been granted to an end user. The specification is, PROCEDURE DBMS_REPCAT_AUTH.REVOKE_SURROGATE_REPCAT (userid IN VARCHAR2); where userid is the Oracle userid for whom you are revoking privileges. 15.1.2.2.1 ExceptionsThe REVOKE_SURROGATE_REPCAT procedure may raise the exception ORA-1917 if the specified user does not exist. 15.1.2.2.2 ExampleThe following example shows how to use REVOKE_SURROGATE_REPCAT: BEGIN DBMS_REPCAT_AUTH.REVOKE_SURROGATE_REPCAT('REPSYS'); END; You must have only one surrogate SYS account at each site in a multimaster environment, and it is most convenient if the userid is the same at every site. Generally, the only usage of the surrogate SYS account is via a database link. 15.1.3 Granting and Revoking Propagator Accounts (Oracle8)Oracle8 and Oracle7 use different mechanisms to propagate changes between sites. Oracle8 does not require a surrogate SYS account, as Oracle7 does. Instead, with Oracle8 you designate a propagator account that delivers queued transactions to remote databases and applies transactions locally on behalf of remote sites. The programs to create and to drop propagator accounts, REGISTER_PROPAGATOR and UNREGISTER_PROPAGATOR, are contained in the DBMS_DEFER_SYS (described in Chapter 17, Deferred Transactions and Remote Procedure Calls ).
Copyright (c) 2000 O'Reilly & Associates. All rights reserved. |
|