Oracle8i Replication API Reference Release 8.1.5 A67793-01 |
|
This chapter describes data dictionary views that can be useful to users of the advanced replication facility. The views are alphabetized within the following categories:
Whenever you install advanced replication capabilities at a site, Oracle installs the replication catalog, which consists of tables and views, at that site. As shown in Table 9-1, the views are used by master and snapshot sites to determine such information as what objects are being replicated, where they are being replicated, and if any errors have occurred during replication. You should not modify the replication catalog tables directly; use the procedures provided in the DBMS_REPCAT package.
Each view has three versions, which have different prefixes: USER_*, ALL_*, and SYS.DBA_* unless otherwise stated. This section ignores any differences among these views.
This section contains information about the following views:
The REPGROUP view lists all of the object groups that are being replicated. The members of each object group are listed in a different view, REPOBJECT.
The REPCATLOG at each master site contains the interim status of any asynchronous administrative requests and any error messages generated. All messages encountered while executing a request are eventually transferred to the REPCATLOG at the master that originated the request. If an administrative request completes without error, ultimately all traces of this request are removed from the REPCATLOG view.
This view contains global information about the template, such as the template name, template owner, what refresh group the template objects will belong to, and the type of template (private vs. public).
When the DBA adds snapshot definitions to the template container, the DBA will reference the appropriate refresh_template_name. Any snapshots added to a specific template will be added to the refresh group specified in the REFRESH_GROUP_NAME parameter.
Furthermore, deployment templates created with the public parameter will be available to all users who can connect to the master site. Deployment templates created as private will be limited to those users listed in the DBA_REPCAT_USER_AUTHORIZATIONS table.
The DBA_REPCAT_TEMPLATE_OBJECTS view contains the individual object definitions that are contained in a deployment template. Individual objects are added to a template by specifying the target template in the REFRESH_TEMPLATE_NAME parameter.
DDL_TEXT can contain variables to create parameterized templates. Variables are created by placing an ampersand (&) at the beginning of the variable name (i.e. ®ion). Parameterized templates allow for greater flexibility during the template instantiation process (i.e. in defining data sets specific for a snapshot site).
When the object is added to the template, the specified DDL is examined and if any parameters have been defined, Oracle will automatically add the parameter to the DBA_REPCAT_TEMPLATE_PARMS table.
SELECT refresh_template_name, object_name, object_type, master_rollback_seg, flavor_id FROM dba_repcat_template_objects;
The following script uses cursors and the DBMS_LOB package to view the entire contents of the DBA_REPCAT_TEMPLATE_OBJECTS view. For more information on using cursors see Oracle8i Application Developer's Guide - Fundamentals. For more information on using the DBMS_LOB package and LOBs in general, also see Oracle8i Application Developer's Guide - Fundamentals.
Use the following script to view the entire contents of DBA_REPCAT_TEMPLATE_OBJECTS view, including the ddl_text
column:
SET SERVEROUTPUT ON DECLARE CURSOR mycursor IS SELECT refresh_template_name, object_name, object_type, ddl_text, master_rollback_seg, flavor_id FROM dba_repcat_template_objects; tempstring VARCHAR2(1000); len NUMBER; BEGIN FOR myrec IN mycursor LOOP len := DBMS_LOB.GETLENGTH(myrec.ddl_text); DBMS_LOB.READ(myrec.ddl_text, len, 1, tempstring); DBMS_OUTPUT.PUT_LINE(myrec.refresh_template_name||' '|| myrec.object_name||' '||myrec.object_type||' '||tempstring||' '|| myrec.master_rollback_seg||' '||myrec.flavor_id); END LOOP; END; /
Parameters defined in the object DDL (see above) for a specific template are stored in the DBA_REPCAT_TEMPLATE_PARMS table. As previously stated, when an object is added to a template, the DDL is examined for variables; any found parameters are automatically added to this view.
You can also define default parameter values and a prompt string in this view (these make the templates more user friendly during the instantiation process).
SELECT refresh_template_name, owner, refresh_group_name, template_comment, public_template, parameter_name, prompt_string, user_override FROM dba_repcat_ template_parms;
The following script uses cursors and the DBMS_LOB package to view the entire contents of the DBA_REPCAT_TEMPLATE_PARMS view. For more information on using cursors see Oracle8i Application Developer's Guide - Fundamentals. For more information on using the DBMS_LOB package and LOBs in general, also see Oracle8i Application Developer's Guide - Fundamentals.
Use the following script to view the entire contents of DBA_REPCAT_TEMPLATE_PARMS view, including the default_parm_value
column:
SET SERVEROUTPUT ON DECLARE CURSOR mycursor IS SELECT refresh_template_name, owner, refresh_group_name, template_comment, public_template, parameter_name, default_parm_value, prompt_string, user_override FROM dba_repcat_template_parms; tempstring VARCHAR2(1000); len NUMBER; BEGIN FOR myrec IN mycursor LOOP len := DBMS_LOB.GETLENGTH(myrec.default_parm_value); DBMS_LOB.READ(myrec.default_parm_value, len, 1, tempstring); DBMS_OUTPUT.PUT_LINE(myrec.refresh_template_name||' '|| myrec.owner||' '||myrec.refresh_group_name||' '|| myrec.template_comment||' '||myrec.public_template||' '|| myrec.parameter_name||' '||tempstring||' '||myrec.prompt_string||' '|| myrec.user_override); END LOOP; END; /
The DBA_REPCAT_TEMPLATE_SITES view provides the DBA with information about the current status of template instantiation amongst the sites of a enterprise network. Specifically, the DBA will be able to monitor the installation and deletion of templates at specific sites.
If a template has been specified for private use, the authorized user list is displayed in the DBA_REPCAT_USER_AUTHORIZATIONS view. Users contained in this view will have the ability to instantiate the specified table, while users not on the list will not be able to instantiate the template.
The DBA has the option of building a table of user parameters prior to distributing the template for instantiation. When a template is instantiated by a specified user, the values stored in the DBA_REPCAT_USER_PARM_VALUES table for the specified user will automatically be used.
SELECT refresh_template_name, owner, refresh_group_name, template_comment, public_template, parameter_name, prompt_string, user_name FROM dba_repcat_user_ parm_values;
The following script uses cursors and the DBMS_LOB package to view the entire contents of the DBA_REPCAT_USER_PARM_VALUES view. For more information on using cursors see Oracle8i Application Developer's Guide - Fundamentals. For more information on using the DBMS_LOB package and LOBs in general, also see Oracle8i Application Developer's Guide - Fundamentals.
Use the following script to view the entire contents of DBA_REPCAT_TEMPLATE_PARMS view, including the default_parm_value
column:
SET SERVEROUTPUT ON DECLARE CURSOR mycursor IS SELECT refresh_template_name, owner, refresh_group_name, template_comment, public_template, parameter_name, default_parm_value, prompt_string, parm_value, user_name FROM dba_repcat_user_parm_values; tempstring VARCHAR2(1000); tempstring2 varchar2(1000); len NUMBER; BEGIN FOR myrec IN mycursor LOOP len := DBMS_LOB.GETLENGTH(myrec.default_parm_value); DBMS_LOB.READ(myrec.default_parm_value, len, 1, tempstring); DBMS_OUTPUT.PUT_LINE(myrec.refresh_template_name||' '|| myrec.owner||' '||myrec.refresh_group_name||' '|| myrec.template_comment||' '||myrec.public_template||' '|| myrec.parameter_name||' '||tempstring||' '||myrec.prompt_string||' '|| tempstring2||' '||myrec.user_name); END LOOP; END; /
The REPCOLUMN view lists the replicated columns for a table.
The REPCOLUMN_GROUP view lists all of the column groups that you have defined for each replicated table.
Column | Description |
---|---|
sname |
The name of the schema containing the replicated table. |
oname |
The name of the replicated table. |
group_name |
The column group name. |
group_Comment |
Any user-supplied Comments. |
The REPCONFLICT view displays the name of the table for which you have defined a conflict resolution method and the type of conflict that the method is used to resolve.
The REPDDL holds DDL for replication objects.
The REPGROUP_PRIVILEGES view lists information about users who are registered for object group privileges.
The REPGROUPED_COLUMN view lists all of the columns that make up the column groups for each table.
The REPKEY_COLUMNS view lists information relating to the primary key column.
Column | Description |
---|---|
sname |
Owner of the replicated table. |
oname |
Name of the replicated table. |
col |
"Primary Key" column name in the table. |
The REPOBJECT view provides information about the objects in each replicated object group. An object can belong to only one object group. A replicated object group can span multiple schemas.
In addition to the information contained in the REPRESOLUTION view, the REPPARAMETER_COLUMN view also contains information about the columns that you indicated should be used to resolve the conflict. These are the column values that are passed as the LIST_OF_COLUMN_NAMES argument to the ADD_*_RESOLUTION procedures in the DBMS_REPCAT package.
The REPPRIORITY view displays the value and priority level of each priority group member. Priority group names must be unique within a replicated object group. Priority levels and values must each be unique within a given priority group.
The REPPRIORITY_GROUP view lists the priority and site priority groups that you have defined for a replicated object group.
The REPPROP view indicates the technique used to propagate operations on an object to the same object at another master site. These operations may have resulted from a call to a stored procedure or procedure wrapper, or may have been issued against a table directly.
The REPRESOLUTION view indicates the routines used to resolve update, unique or delete conflicts for each table replicated using row-level replication for a given schema.
The REPRESOL_STATS_CONTROL view lists information about statistics collection for conflict resolutions for all replicated tables in the database.
The REPRESOLUTION_METHOD view lists all of the conflict resolution routines available in your current database. Initially, this view lists the standard routines provided with the advanced replication facility. As you create new user functions and add them as conflict resolution methods for an object in the database, these functions are added to this view.
The REPRESOLUTION_STATISTICS view lists information about successfully resolved update, uniqueness, and delete conflicts for all replicated tables. These statistics are only gathered for a table if you have called DBMS_REPCAT.REGISTER_STATISTICS.
The REPSITES view lists the members of each replicated object group.
The DBA_REPSITES view has the following additional columns:
prop_updates |
Encoding of propagating technique for master. |
my_dblink |
Used to detect problem after import. If Y, the dblink is the global name. |
The REPGENOBJECTS view describes objects generated to support replication.
Oracle provides several views for you to use in administering deferred transactions. These views provide information about each deferred transaction, such as the transaction destinations, the deferred calls that make up the transactions, and any errors encountered during attempted execution of the transaction. You should not modify the tables directly; use the procedures provided in the DBMS_DEFER and DBMS_DEFER_SYS packages.
The DEFCALL view records all deferred remote procedure calls.
The DEFCALLDEST view lists the destinations for each deferred remote procedure call.
If you are not using Oracle's replication facility and do not supply a destination for a deferred transaction or the calls within that transaction, Oracle uses the DEFDEFAULTDEST view to determine the destination databases to which you want to defer a remote procedure call.
Column | Description |
---|---|
dblink |
The fully qualified database name to which to replicate a transaction. |
The DEFERRCOUNT view provides information about the error transactions for a given destination.
Column | Description |
---|---|
errcount |
Number of existing transactions that caused an error for the destination. |
destination |
Database link used to address destination. |
The DEFERROR view provides the ID of each transaction that could not be applied. You can use this ID to locate the queued calls associated with this transaction. These calls are stored in the DEFCALL view. You can use the procedures in the DBMS_DEFER_QUERY package to determine the arguments to the procedures listed in the DEFCALL view.
The DEFLOB view stores the LOB parameters to deferred RPCs.
The DEFPROPAGATOR view displays information about the local propagator.
Column | Description |
---|---|
username |
Username of the propagator. |
userid |
User ID of the propagator. |
status |
Status of the propagator. |
created |
Time when the propagator was registered. |
The DEFSCHEDULE view displays information about when a job is next scheduled to be executed.
The DEFTRAN view records all deferred transactions.
The DEFTRANDEST view lists the destinations for a deferred transaction.
The following views provide information about snapshots and snapshot refresh groups.
The SNAPSHOTS catalog view lists information about all of the snapshots in a database.
Note: UPDATE_TRIG: NULL in Oracle8 or greater because of internalized triggers; MASTER_VIEW: NULL in Oracle8 or greater, now obsolete. |
This view describes local or remote snapshots of local tables.
The SNAPSHOT_LOGS view describes all the snapshot logs in the database.
The REFRESH_TIMES view lists the date and time of the last refresh.
The REFRESH view lists each refresh group in the database, and describes refresh intervals for each group.
The REFRESH_CHILDREN view lists the members of each refresh group owned by the user, and includes information about the refresh interval for each member.