Oracle® Database Workspace Manager Developer's Guide 11g Release 2 (11.2) Part Number E11826-04 |
|
|
PDF · Mobi · ePub |
Workspace Manager supports replication of all workspace-related entities (such as workspaces and savepoints), operations (such as CreateWorkspace and MergeWorkspace), and DML and DDL operations on version-enabled tables. To use replication in a Workspace Manager environment, you must understand the major replication concepts and techniques, as documented in Oracle Database Advanced Replication and Oracle Database Advanced Replication Management API Reference. However, some special guidelines and procedures apply to replication with Workspace Manager, as described in this appendix.
Workspace Manager supports multimaster replication in an asynchronous mode with certain restrictions. The main restriction imposed on the replication sites is that only the master definition site in the multimaster setup can perform workspace operations and DML and DDL operations on version-enabled tables. All other sites are disallowed from performing any write operations. All read operations, such as GotoWorkspace or SELECT queries on version-enabled tables, are allowed on all sites in the replication environment.
In a Workspace Manager replication environment, the master definition site is referred to as the writer site, and all other master sites in the multimaster group are referred to as nonwriter sites.
To call any of the Workspace Manager replication support subprograms, you must be the replication administrator at all the master sites. You must also be registered as the receiver for all groups at the local master definition site. If the master definition site is changed using the RelocateWriterSite procedure, you must be registered as the receiver for all groups at the new writer site.
This section describes the typical steps for setting up a replication environment for a database with workspaces and version-enabled tables.
Set up users and database links for replication, according to the guidelines and procedures in Oracle Database Advanced Replication.
Generate replication support for the Workspace Manager environment by executing the GenerateReplicationSupport procedure at the site chosen to be the writer site. The following example creates a replication group named OWM-GROUP
and designates BACKUP-SITE1.EXAMPLE.COM
and BACKUP-SITE2.EXAMPLE.COM
as nonwriter sites.
DBMS_WM.GenerateReplicationSupport( mastersites => 'BACKUP-SITE1.EXAMPLE.COM, BACKUP-SITE2.EXAMPLE.COM'), groupname => 'OWM-GROUP', groupdescription => 'OWM Replication group for Example Corp.');
If you need to drop replication support for the Workspace Manager environment, execute the DropReplicationSupport procedure.
For reference and usage information about these procedures, see the sections on the GenerateReplicationSupport and DropReplicationSupport procedures in Chapter 4.
After replication is set up, the specified group appears as a regular group in the Replication catalog. In addition, for each version-enabled table at the local master definition site, Workspace Manager creates a group with a name in the form WM$<object-id>, where <object-id> is the object ID of the table <table-name>_LT at the local site. The groups that you specify and the groups created by Workspace Manager can be managed using standard the replication API or Oracle Enterprise Manager.
After Workspace Manager replication support has been set up (as described in Section C.1), you can version-enable a table to be replicated by executing the EnableVersioning procedure on the writer site, as long as the table is defined in exactly the same way on all the nonwriter sites. For example, to enable versioning on the SCOTT.EMP
table on all master sites, execute the following as the replication administrator on the writer site:
SQL> EXECUTE DBMS_WM.EnableVersioning('SCOTT.EMP');
This example performs the following operations:
Version-enables SCOTT.EMP
at the local (writer) site and at all remote (nonwriter) sites.
Creates a new master group for this table. The group name is in the format WM$<obj#>, where <obj#> is the Oracle object ID for the table SCOTT.EMP_LT
. This is a regular replication group that can be managed through the Oracle Enterprise Manager Replication tool.
Starts the master activity for the newly created master group.
To disable versioning on a table in a Workspace Manager replication environment, execute the DisableVersioning procedure on the writer site. For example, to disable versioning on the SCOTT.EMP
table on all master sites, execute the following as the replication administrator on the writer site:
SQL> EXECUTE DBMS_WM.DisableVersioning('SCOTT.EMP');
This example performs the following operations:
Version-disables SCOTT.EMP
at the local (writer) site and at all remote (nonwriter) sites.
Drops the master group that was created for this table.
To perform DDL operations on any version-enabled table, you must follow the guidelines in Section 1.8. If the version-enabled table is replicated, the following additional guidelines apply:
If a version-enabled table is replicated, BeginDDL, CommitDDL, and RollbackDDL operations on the table can be done only by the replication administrator and only at the writer site.
The replication group associated with a version-enabled table must be quiesced before a CommitDDL operation on the table, and unquiesced after a CommitDDL operation on the table.
The writer site in a Workspace Manager replication environment can be changed after the environment is set up without quiescing the master groups. Relocating the writer site is especially useful when the writer site becomes unavailable and a new writer site needs to be specified.
To relocate the writer site, execute the RelocateWriterSite procedure. For guidelines and an example, see the reference information about the RelocateWriterSite procedure in Chapter 4.
If the old writer site is not available when you relocate the writer site, you must execute the SynchronizeSite procedure after the old writer site becomes available. For guidelines and an example, see the reference information about the SynchronizeSite procedure in Chapter 4.