|Oracle9i Advanced Replication
Release 2 (9.2)
Part Number A96567-01
This appendix contains troubleshooting guidelines for managing a replication environment. This appendix contains the following topics:
If you think a database link is not functioning properly, then you can drop and re-create it using Oracle Enterprise Manager, SQL*Plus, or another tool.
If you used a connection qualifier in a database link to a given site, then the other sites that link to that site must have the same connection qualifier. For example, suppose you create a database link as follows:
CREATE DATABASE LINK dbs1.world@myethernet CONNECT TO repadmin IDENTIFIED BY secret USING 'connect_string_myethernet'
All the sites, whether masters or materialized views, associated with
dbs1.world@myethernet must include
myethernet as the connection qualifier.
Oracle9i Database Administrator's Guide for more information database links and connection qualifiers
Problems can arise in a multimaster replication system. The following sections discuss some problems and ways to solve them:
If you add a new master site to a master group, and the appropriate objects are not created at the new site, then try the following:
If you create a new master group object or alter the definition of a master group object at the master definition site and the modification is not propagated to a master site, then first ensure that the administrative requests at all sites have completed successfully. If requests are pending execution, then you can manually execute them to complete the operation immediately.
When you execute DDL statements through the replication API, Oracle executes the statements on behalf of the user who submits the DDL. When a DDL statement applies to an object in a schema other than the submitter's schema, the submitter needs appropriate privileges to execute the statement. In addition, the statement must explicitly name the schema. For example, assume that you supply the following as the
ddl_text parameter to the
DBMS_REPCAT.CREATE_MASTER_ REPOBJECT procedure:
Because each table name contains a schema name, this statement works whether the replication administrator is
hr, or another user, as long as the administrator has the required privileges.
If you make an update to your data at a master site, and that change is not asynchronously propagated to the other sites in your replication environment, then try the following:
DEFERRORdata dictionary view at the destination site for errors.
Oracle9i Replication Management API Reference for information about modifying tables without replicating the modifications, which may be necessary when you need to manually synchronize the data in replicated tables
If you receive the
deferred_rpc_quiesce exception when you attempt to modify a replicated table, then the master group to which your replicated object belongs is quiescing or quiesced. To proceed, your replication administrator must resume replication activity for the master group.
A single update statement applied to a replicated table can update zero or more rows. The update statement causes zero or more update requests to be queued for deferred execution, one for each row updated. This distinction is important when constraints are involved, because Oracle effectively performs constraint checking at the end of each statement. While a bulk update may not violate a uniqueness constraint, for example, some equivalent sequence of individual updates may violate uniqueness.
If the ordering of updates is important, then update one row at a time in an appropriate order. This lets you define the order of update requests in the deferred transactions queue.
If you add an object such as a package, procedure, or view to a master group, then the status of the object must be valid. If the status of an object is invalid, then recompile the object or drop and re-create the object before adding it to a master group. Check the
DBA_REPOBJECT data dictionary view for the status of replication objects.
When you generate replication support for a table, Oracle activates an internal trigger at the local site.
EXECUTE privileges for most of the packages involved with replication, such as
DBMS_DEFER, need to be granted to replication administrators and users that own replicated objects. The Replication Management tool's Setup Wizard and the
DBMS_REPCAT_ADMIN package both perform the grants needed by the replication administrators for many typical replication scenarios. When the owner of a replicated object is not a replication administrator, however, you must explicitly grant
EXECUTE privilege on
DBMS_DEFER to the object owner.
If you discover an unexpected unresolved conflict, and you were mixing procedural and row-level replication on a table, then carefully review the procedure to ensure that the replicated procedure did not cause the conflict. Complete the following checks:
EXCLUSIVEmode before performing updates or uses some other mechanism of avoiding conflicts with row-level updates.
You should perform similar checks on any replicated triggers that you have defined on replicated tables.
CASCADE is not supported for replicated tables with a configuration similar to the following example. This example assumes there are three tables named A, B, and C.
If you use
CASCADE in such a configuration, then the deletes may not be propagated in the correct order when you delete a record. In these cases, the following error is returned:
If you encounter this error, then create triggers that are aware of replication to perform this functionality instead of using
If deferred transactions at a site are not being pushed to their destinations, then the following sections explain some possible causes for the problem:
When you create a scheduled link, Oracle adds a corresponding job to the site's job queue. If you have scheduled a link to push deferred transactions at a periodic interval, and you encounter a problem, then you should first be certain that you are not experiencing a problem with the job queue.
When you use synchronous replication, Oracle uses a distributed transaction to ensure that the transaction has been properly committed at the remote site. Distributed transactions use two-phase commit. Asynchronous replication does not use two-phase commit.
Oracle9i Database Administrator's Guide for information on diagnosing problems with distributed transactions
If you notice that transactions are not being pushed to a given remote site, then you may have a problem with how you have specified the destination for the transaction. When you create a scheduled link, you must provide the full database link name.
Having the wrong view definitions can lead to erroneous deferred transaction behavior. The
DEFTRANDEST views are defined differently in
catrepc.sql. The definitions in
catrepc.sql should be used whenever replication is used. If
catdefer.sql is ever (re)loaded, then ensure that the view definitions in
catrepc.sql are subsequently loaded.
There are a number of problems that might happen with materialized view sites in a replication system. The following sections discuss some problems and ways to troubleshoot them:
If you unsuccessfully attempt to create a new object at a materialized view site, then try the following:
SELECTprivilege on the master table or master materialized view and its materialized view log. See "Assign Privileges" for more information.
If you receive and error stating that Oracle is unable to initialize the extent in the temporary tablespace when you try to instantiate a deployment template offline, then you may need to adjust the datafile for the temporary database so that it auto extends.
For example, issue the following statement to adjust the datafile:
After you have made this adjustment, instantiate the deployment template offline at the materialized view site.
The following sections explain several common materialized view refresh problems.
Several common factors can prevent the automatic refresh of a group of materialized views:
When a materialized view refresh group is experiencing problems, ensure that none of the preceding situations is preventing Oracle from completing group refreshes.
When Oracle fails to refresh a group automatically, the group remains due for its refresh to complete. Oracle will retry an automatic refresh of a group with the following behavior:
If after 16 attempts to refresh a refresh group Oracle continues to encounter errors, then Oracle considers the group broken. The General page of the Refresh Group property sheet in Schema Manager indicates when a refresh group is broken. You can also query the
BROKEN column of the
USER_REFRESH_CHILDREN data dictionary views to see the current status of a refresh group.
The errors causing Oracle to consider a materialized view refresh group broken are recorded in a trace file. After you correct the problems preventing a refresh group from refreshing successfully, you must refresh the group manually. Oracle then resets the broken flag so that automatic refreshes can happen again.
The name of the materialized view trace file is of the form jn, where n is operating system specific. See the Oracle documentation for your operating system for the name on your system.
In some cases, a materialized view log for a master table or master materialized view might be purged during the creation of a materialized view at a new materialized view site. When this happens, you may encounter the following errors:
ORA-12004 REFRESH FAST cannot be used for materialized view materialized_view_ name ORA-12034 materialized view log on materialized_view_name younger than last refresh
"Avoiding Problems When Adding a New Materialized View Site" for a complete description of how to avoid this problem.
If you encounter a situation where Oracle continually refreshes a group of materialized views, then check the group's refresh interval. Oracle evaluates a group's automatic refresh interval before starting the refresh. If a group's refresh interval is less than the amount of time it takes to refresh all materialized views in the group, then Oracle continually starts a group refresh each time the job queue process checks the queue of outstanding jobs.
If a materialized view log at a master site or master materialized view site is growing too large, then check to see whether a network or site failure has prevented the master site or master materialized view site from becoming aware that a materialized view has been dropped. You may need to purge part of the materialized view log or unregister the unused materialized view site.
Oracle9i Replication Management API Reference for more information about managing materialized view logs
If you have a problem refreshing a materialized view, then try the following:
NEXT_DATEvalue in the
DBA_REFRESH_CHILDRENview to determine if the refresh has been scheduled.
DBA_REFRESHview for the associated job number for the materialized view refresh and then diagnose the problem with job queues.
JOB_QUEUE_PROCESSESinitialization parameter, query the
DBA_JOBS_RUNNINGview, and use your operating system to check if the job queue processes are still running.
true. This parameter can be set when you create or alter a materialized view refresh group. There is a corresponding parameter for the Replication Management tool's property sheets.
ORA-12004occurs, then the master site or master materialized view site may have run out of rollback segments when trying to maintain the materialized view log, or the materialized view log may be out of date. For example, the materialized view log may have been purged or re-created.
TRUNCATEfeature to increase speed and reduce rollback segment requirements. However, until the materialized view refresh is complete, users may temporarily see no data in the materialized view. Refreshes of multiple materialized views (for example, refresh groups) do not use the
TRUNCATEthe master table to force rowid materialized views to do complete refreshes. Otherwise, the materialized views have incorrect references to master table rowids. You use the
END_TABLE_REORGANIZATIONprocedures in the
DBMS_MVIEWpackage to reorganize a master table. See the Oracle9i Replication Management API Reference for more information.
ORA-942(table or view does not exist), then check your database links and make sure you still have the required privileges on the master table or master materialized view and the materialized view log.
DEFERRED, and its first fast refresh fails, then make sure a previous complete refresh was done successfully before checking for other problems.
Oracle9i Replication Management API Reference for information about managing materialized view logs