Oracle7 Server Distributed Systems Volume II: Replicated Data
Importing and Exporting Replicated Data
The following sections describe how to use the Import, Export, and SQL*Loader utilities with replicated data.
Loading and Import of Replicated Data
When importing or loading data into replicated tables you need to consider whether you want the data to be replicated to other sites by symmetric replication. You might not wish to use symmetric replication to replicate the data if you are loading or importing a large amount of data and are therefore performing the load or import at each site.
If you wish to replicate loaded or imported data using symmetric replication you must ensure that the replication triggers fire as data is loaded or imported. The direct path of SQL*Loader cannot be used. You must be certain that the replication triggers are created and enabled before importing and loading data.
If you do not wish to replicate loaded or imported data using symmetric replication you can use the direct path of SQL*Loader, or you can explicitly disable replication while loading or importing data. To disable the replication of the data, use either of the following methods:
- Call DBMS_REPUTIL.REPLICATION_OFF to disable replication for your session.
If you use this method, be sure to set DBMS_REPUTIL.REPLICATION_ON before performing other database operations.
- Use the DISABLE clause of the ALTER TRIGGER command to disable the replication triggers.
If you disable the replication triggers, be sure that other updates to the replicated tables do not occur while data is being loaded or imported because those updates will not be replicated while the triggers are disabled.
If you use this method, be sure to use the ENABLE clause of the ALTER TRIGGER command to re-enable the triggers before performing other database operations.
Using Export/Import to Reorganize Deferred RPC Queues and Replication Catalogs
You may occasionally need to reorganize deferred remote procedure call queues to reclaim fragmented space (you are less likely to need to reorganize replication catalogs, but you can use similar procedures).
Warning: Do not (accidentally) copy the contents of the deferred remote procedure call queues or the replication catalogs between databases. This includes using Export/Import to transfer data, or copying files to create a new database. The only exception is when you replace one database with another database that has the same global name. Error message 23327 is issued during import if you attempt to import the data from a deferred remote procedure call queue into a database with a different global name.
To reorganize deferred remote procedure call queues or replication catalogs using Export/Import, complete the following steps:
1. Place the database in RESTRICTED SESSION mode using the SQL command ALTER SYSTEM with the ENABLE RESTRICTED SESSION option. After placing an instance in restricted mode, you might also want to kill all current user sessions. This prevents concurrent activities from adding rows to the deferred remote procedure call queues.
2. Export the deferred remote procedure call queue tables with indexes and constraints:
3. Drop the deferred remote procedure call queue tables.
4. Import the deferred remote procedure call queue tables that you exported in step 2.
5. Lift the instance from restricted mode by using the SQL command ALTER SYSTEM with the DISABLE RESTRICTED SESSION option.
Performing Checks on Imported Data
After performing an export/import of a replicated object or an object used by the symmetric replication facility (for example, the RepSchema view), you should run the REPCAT_IMPORT_CHECK procedure in the DBMS_REPCAT package.
In the following example, the procedure checks the objects in the ACCT replicated object group at a snapshot site to ensure that they have the appropriate object identifiers and status values:
DBMS_REPCAT.REPCAT_IMPORT_CHECK( gname => 'acct',
master => FALSE);
Additional Information: The parameters for the REPCAT_IMPORT_CHECK procedure are described in Table 12 - 163, and the exceptions are listed in Table 12 - 164.