Oracle8i Replication API Reference Release 8.1.5 A67793-01 |
|
All installations of Oracle advanced replication include the replication management application programming interface (API). A server's replication management API is a set of PL/SQL packages that encapsulates procedures and functions that administrators can use to configure Oracle's advanced replication features. Oracle Replication Manager also uses the procedures and functions of each site's replication management API to perform work. This chapter describes that packages that constitute Oracle replication API, including:
Oracle's replication management API includes the following packages:
To use Oracle's replication management API, you issue procedure or function calls using an ad-hoc query tool such as an Enterprise Manager SQL Worksheet, Server Manager's command prompt, or SQL*Plus. For example, the following call to the DBMS_REPCAT
.CREATE_MASTER_REPOBJECT
procedure creates a new replicated table SALES
.EMP
in the ACCT
replication group.
DBMS_REPCAT.CREATE_MASTER_REPOBJECT( sname => 'sales', oname => 'emp', type => 'table', use_existing_object => TRUE, ddl_text => 'CREATE TABLE acct_rec.emp AS . . .', comment => 'created by . . .', retry => FALSE, copy_rows => TRUE, gname => 'acct');
To call a replication management API function, you must provide an environment to receive the return value of the function. For example, the following anonymous PL/SQL block calls the DBMS_DEFER_SYS
.DISABLED
function in an IF
statement.
BEGIN IF DBMS_DEFER_SYS.DISABLED('inst2') THEN DBMS_OUTPUT.PUT_LINE('Propagation to INST2 is disabled.'); ELSE DBMS_OUTPUT.PUT_LINE('Propagation to INST2 is enabled.'); END IF; END;
For many procedures and functions in the replication management API, there are important prerequisites to consider. For example:
Oracle's Replication Manager uses the replication management API to perform most of its functions. Using Replication Manager is much more convenient than issuing replication management API calls individually because the utility:
An easy way to learn how to use Oracle's replication management API is to use Replication Manager scripting feature. When you start an administrative session with Replication Manager, turn scripting on. When you are finished, turn scripting off and then review the script file. The script file contains all replication management API calls that were made during the session. See the Replication Manager help documentation for more information about its scripting feature.
Subprogram | Description |
---|---|
CALL procedure |
Builds a deferred call to a remote procedure |
COMMIT_WORK procedure |
Performs a transaction commit after checking for well-formed deferred remote procedure calls |
datatype_ARG procedure |
Provides the data that is to be passed to a deferred remote procedure call |
TRANSACTION procedure |
Indicates the start of a new deferred transaction |
This procedure builds a deferred call to a remote procedure.
DBMS_DEFER.CALL ( schema_name IN VARCHAR2, package_name IN VARCHAR2, proc_name IN VARCHAR2, arg_count IN NATURAL, { nodes IN node_list_t | group_name IN VARCHAR2 :=''});
This procedure performs a transaction commit after checking for well-formed deferred remote procedure calls.
DBMS_DEFER.COMMIT_WORK ( commit_work_comment IN VARCHAR2);
Parameter | Description |
---|---|
commit_work_ comment |
Equivalent to SQL "COMMIT COMMENT" statement. |
Exception | Description |
---|---|
ORA-23304 (malformedcall) |
Transaction was not correctly formed or terminated. |
This procedure provides the data that is to be passed to a deferred remote procedure call. Depending upon the type of the data that you need to pass to a procedure, you must call one of the following procedures for each argument to the procedure.
DBMS_DEFER.NUMBER_ARG (arg IN NUMBER); DBMS_DEFER.DATE_ARG (arg IN DATE); DBMS_DEFER.VARCHAR2_ARG (arg IN VARCHAR2); DBMS_DEFER.CHAR_ARG (arg IN CHAR); DBMS_DEFER.ROWID_ARG (arg IN ROWID); DBMS_DEFER.RAW_ARG (arg IN RAW); DBMS_DEFER.BLOB_ARG (arg IN BLOB); DBMS_DEFER.CLOB_ARG (arg IN CLOB); DBMS_DEFER.NCLOB_ARG (arg IN NCLOB); DBMS_DEFER.NCHAR_ARG (arg IN NCHAR); DBMS_DEFER.NVARCHAR2_ARG (arg IN NVARCHAR2); DBMS_DEFER.ANY_CLOB_ARG (arg IN CLOB); DBMS_DEFER.ANY_VARCHAR2_ARG (arg IN VARCHAR2); DBMS_DEFER.ANY_CHAR_ARG (arg IN CHAR);
Parameter | Description |
---|---|
arg |
Value of the parameter that you want to pass to the remote procedure to which you previously deferred a call. |
Exception | Description |
---|---|
ORA-23323 |
Argument value is too long. |
This procedure indicates the start of a new deferred transaction. If you omit this call, then Oracle considers your first call to DBMS_DEFER
.CALL
to be the start of a new transaction.
DBMS_DEFER.TRANSACTION ( nodes IN node_list_t);
The TRANSACTION
procedure is overloaded. The behavior of the version without an input parameter is similar to that of the version with an input parameter, except that the former uses the nodes
in the DEFDEFAULTDEST
view instead of using the nodes in the nodes parameter.
Subprogram | Description |
---|---|
GET_ARG_FORM function |
Determines the form of an argument in a deferred call. |
GET_ARG_TYPE function |
Determines the type of an argument in a deferred call. |
GET_CALL_ARGS procedure |
Returns the text version of the various arguments for the given call. |
GET_datatype_ARG function |
Determines the value of an argument in a deferred call. |
This function determines the form of an argument in a deferred call. This function will return the character set ID of a deferred call parameter.
For more about displaying deferred transactions, see "Displaying Deferred Transactions" in the Oracle8i Replication manual. For more information about displaying error transactions, see "Displaying Error Transactions" in the Oracle8i Replication manual.
DBMS_DEFER_QUERY.GET_ARG_FORM ( callno IN NUMBER, arg_no IN NUMBER, deferred_tran_id IN VARCHAR2) RETURN NUMBER;
Exception | Description |
---|---|
NO_DATA_FOUND |
Input parameters do not correspond to a parameter of a deferred call. |
Return Value | Corresponding Datatype |
---|---|
1 |
CHAR, VARCHAR2, CLOB |
2 |
NCHAR, NVARCHAR2, NCLOB |
This function determines the type of an argument in a deferred call. The type of the deferred RPC parameter will be returned.
For more about displaying deferred transactions, see "Displaying Deferred Transactions" in the Oracle8i Replication manual. For more information about displaying error transactions, see "Displaying Error Transactions" in the Oracle8i Replication manual.
DBMS_DEFER_QUERY.GET_ARG_TYPE ( callno IN NUMBER, arg_no IN NUMBER, deferred_tran_id IN VARCHAR2) RETURN NUMBER;
Exception | Description |
---|---|
NO_DATA_FOUND |
Input parameters do not correspond to a parameter of a deferred call. |
Return Value | Corresponding Datatype |
---|---|
1 |
VARCHAR2 |
2 |
NUMBER |
11 |
ROWID |
12 |
DATE |
23 |
RAW |
96 |
CHAR |
112 |
CLOB |
113 |
BLOB |
This procedure returns the text version of the various arguments for the given call. The text version is limited to the first 2000 bytes.
DBMS_DEFER_QUERY.GET_CALL_ARGS ( callno IN NUMBER, startarg IN NUMBER := 1, argcnt IN NUMBER, argsize IN NUMBER, tran_id IN VARCHAR2, date_fmt IN VARCHAR2, types OUT TYPE_ARY, forms OUT TYPE_ARY, vals OUT VAL_ARY);
Exception | Description |
---|---|
NO_DATA_FOUND |
Input parameters do not correspond to a parameter of a deferred call. |
This function determines the value of an argument in a deferred call.
For more about displaying deferred transactions, see "Displaying Deferred Transactions" in the Oracle8i Replication manual. For more information about displaying error transactions, see "Displaying Error Transactions" in the Oracle8i Replication manual.
Depending upon the type of the argument value that you want to retrieve, the syntax for the appropriate function is as follows. Each of these functions returns the value of the specified argument.
DBMS_DEFER_QUERY.GET_datatype_ARG ( callno IN NUMBER, arg_no IN NUMBER, deferred_tran_id IN VARCHAR2 DEFAULT NULL) RETURN datatype;
where datatype:
{ NUMBER | VARCHAR2 | CHAR | DATE | RAW | ROWID | BLOB | CLOB | NCLOB | NCHAR | NVARCHAR2 }
Exception | Description |
---|---|
NO_DATA_FOUND |
Input parameters do not correspond to a parameter of a deferred call. |
ORA-26564 |
Argument in this position is not of the specified type. |
Subprogram | Description |
---|---|
ADD_DEFAULT_DEST procedure |
Adds a destination database to the |
DELETE_DEFAULT_DEST procedure |
Removes a destination database from the |
DELETE_DEF_DESTINATION procedure |
Removes a destination database from the |
DELETE_ERROR |
Deletes a transaction from the |
DELETE_TRAN |
Deletes a transaction from the |
DISABLED |
Determines whether propagation of the deferred transaction queue from the current site to a given site is enabled. |
EXCLUDE_PUSH |
Acquires an exclusive lock that prevents deferred transaction |
EXECUTE_ERROR |
Re-executes a deferred transaction that did not initially complete successfully. |
EXECUTE_ERROR_AS_USER |
Re-executes a deferred transaction that did not initially complete successfully. |
PURGE |
Purges pushed transactions from the deferred transaction queue at your current master or snapshot site. |
PUSH function |
Forces a deferred remote procedure call queue at your current master or snapshot site to be pushed to another master site. |
REGISTER_PROPAGATOR procedure |
Registers the given user as the propagator for the local database. |
SCHEDULE_PURGE procedure |
Schedules a job to purge pushed transactions from the deferred transaction queue at your current master or snapshot site. |
SCHEDULE_PUSH procedure |
Schedules a job to push the deferred transaction queue to a remote master destination. |
SET_DISABLED procedure |
Disables or enables propagation of the deferred transaction queue from the current site to a given destination site. |
UNREGISTER_PROPAGATOR procedure |
Unregister a user as the propagator from the local database. |
UNSCHEDULE_PURGE procedure |
Stops automatic purges of pushed transactions from the deferred transaction queue at a snapshot or master site. |
UNSCHEDULE_PUSH procedure |
Stops automatic pushes of the deferred transaction queue from a snapshot or master site to another master site. |
This procedure adds a destination database to the DEFDEFAULTDEST
view.
DBMS_DEFER_SYS.ADD_DEFAULT_DEST ( dblink IN VARCHAR2);
Parameter | Description |
---|---|
dblink |
The fully qualified database name of the node that you want to add to the |
Exception | Description |
---|---|
ORA-23352 |
The |
This procedure removes a destination database from the DEFDEFAULTDEST
view.
DBMS_DEFER_SYS.DELETE_DEFAULT_DEST ( dblink IN VARCHAR2);
This procedure removes a destination database from the DEFSCHEDULE
view.
DBMS_DEFER_SYS.DELETE_DEF_DESTINATION ( destination IN VARCHAR2, force IN BOOLEAN := FALSE);
To delete a transaction from the DEFERROR
view.
DBMS_DEFER_SYS.DELETE_ERROR( deferred_tran_id IN VARCHAR2, destination IN VARCHAR2);
To delete a transaction from the DEFTRANDEST
view. If there are no other DEFTRANDEST
or DEFERROR
entries for the transaction, then the transaction is deleted from the DEFTRAN
and DEFCALL
views as well.
DBMS_DEFER_SYS.DELETE_TRAN ( deferred_tran_id IN VARCHAR2, destination IN VARCHAR2);
To determine whether propagation of the deferred transaction queue from the current site to a given site is enabled. The DISABLED
function returns TRUE
if the deferred remote procedure call (RPC) queue is disabled for the given destination.
DBMS_DEFER_SYS.DISABLED ( destination IN VARCHAR2) RETURN BOOLEAN;
Parameter | Description |
---|---|
destination |
The fully qualified database name of the node whose propagation status you want to check. |
Value | Description |
---|---|
TRUE |
Propagation to this site from the current site is disabled. |
FALSE |
Propagation to this site from the current site is enabled. |
Exception | Description |
---|---|
NO_DATA_FOUND |
|
To acquire an exclusive lock that prevents deferred transaction PUSH
(either serial or parallel). This function does a commit when acquiring the lock. The lock is acquired with RELEASE_ON_COMMIT
=>
TRUE
, so that pushing of the deferred transaction queue can resume after the next commit.
DBMS_DEFER_SYS.EXCLUDE_PUSH ( timeout IN INTEGER) RETURN INTEGER;
Value | Description |
---|---|
0 |
Success, lock acquired. |
1 |
Timeout, no lock acquired. |
2 |
Deadlock, no lock acquired. |
4 |
Already own lock. |
To reexecute a deferred transaction that did not initially complete successfully. This procedure raises an ORA-24275
error when illegal combinations of NULL
and non-NULL
parameters are used.
DBMS_DEFER_SYS.EXECUTE_ERROR ( deferred_tran_id IN VARCHAR2, destination IN VARCHAR2);
Exception | Description |
---|---|
badparam |
Parameter value missing or invalid (for example, if |
missinguser |
Invalid user. |
To reexecute a deferred transaction that did not initially complete successfully. Each transaction is executed in the security context of the connected user. This procedure raises an ORA-24275
error when illegal combinations of NULL
and non-NULL
parameters are used.
DBMS_DEFER_SYS.EXECUTE_ERROR_AS_USER ( deferred_tran_id IN VARCHAR2, destination IN VARCHAR2);
Exception | Description |
---|---|
badparam |
Parameter value missing or invalid (for example, if destination is |
missinguser |
Invalid user. |
To purge pushed transactions from the deferred transaction queue at your current master or snapshot site.
DBMS_DEFER_SYS.PURGE ( purge_method IN BINARY_INTEGER := purge_method_quick, rollback_segment IN VARCHAR2 := NULL, startup_seconds IN BINARY_INTEGER := 0, execution_seconds IN BINARY_INTEGER := seconds_infinity, delay_seconds IN BINARY_INTEGER := 0, transaction_count IN BINARY_INTEGER := transactions_infinity, write_trace IN BOOLEAN := NULL); RETURN BINARY_INTEGER;
Exception | Description |
---|---|
argoutofrange |
Parameter value is out of a valid range. |
executiondisabled |
Execution of purging is disabled. |
defererror |
Internal error. |
This function forces a deferred remote procedure call queue at your current master or snapshot site to be pushed (executed, propagated) to another master site using either serial or parallel propagation.
DBMS_DEFER_SYS.PUSH ( destination IN VARCHAR2, parallelism IN BINARY_INTEGER := 0, heap_size IN BINARY_INTEGER := 0) stop_on_error IN BOOLEAN := FALSE, write_trace IN BOOLEAN := FALSE, startup_seconds IN BINARY_INTEGER := 0, execution_seconds IN BINARY_INTEGER := seconds_infinity, delay_seconds IN BINARY_INTEGER := 0, transaction_count IN BINARY_INTEGER := transactions_infinity, delivery_order_limit IN NUMBER := delivery_order_infinity) RETURN BINARY_INTEGER;
This procedure registers the given user as the propagator for the local database. It also grants to the given user CREATE
SESSION
, CREATE
PROCEDURE
, CREATE
DATABASE
LINK
, and EXECUTE
ANY
PROCEDURE
privileges (so that the user can create wrappers).
DBMS_DEFER_SYS.REGISTER_PROPAGATOR ( username IN VARCHAR2);
Parameter | Description |
---|---|
username |
Name of the user. |
Exception | Description |
---|---|
missinguser |
Given user does not exist. |
alreadypropagator |
Given user is already the propagator. |
duplicatepropagator |
There is already a different propagator. |
This procedure schedules a job to purge pushed transactions from the deferred transaction queue at your current master or snapshot site. You should schedule one purge job.
DBMS_DEFER_SYS.SCHEDULE_PURGE ( interval IN VARCHAR2, next_date IN DATE, reset IN BOOLEAN := NULL, purge_method IN BINARY_INTEGER := NULL, rollback_segment IN VARCHAR2 := NULL, startup_seconds IN BINARY_INTEGER := NULL, execution_seconds IN BINARY_INTEGER := NULL, delay_seconds IN BINARY_INTEGER := NULL, transaction_count IN BINARY_INTEGER := NULL, write_trace IN BOOLEAN := NULL);
This procedure schedules a job to push the deferred transaction queue to a remote master destination. This procedure does a COMMIT
.
DBMS_DEFER_SYS.SCHEDULE_PUSH ( destination IN VARCHAR2, interval IN VARCHAR2, next_date IN DATE, reset IN BOOLEAN := FALSE, parallelism IN BINARY_INTEGER := NULL, heap_size IN BINARY_INTEGER := NULL, stop_on_error IN BOOLEAN := NULL, write_trace IN BOOLEAN := NULL, startup_seconds IN BINARY_INTEGER := NULL, execution_seconds IN BINARY_INTEGER := NULL, delay_seconds IN BINARY_INTEGER := NULL, transaction_count IN BINARY_INTEGER := NULL);
To disable or enable propagation of the deferred transaction queue from the current site to a given destination site. If the disabled parameter is TRUE
, then the procedure disables propagation to the given destination and future invocations of PUSH
do not push the deferred remote procedure call (RPC) queue. SET_DISABLED
eventually affects a session already pushing the queue to the given destination, but does not affect sessions appending to the queue with DBMS_DEFER
.
If the disabled parameter is FALSE
, then the procedure enables propagation to the given destination and, although this does not push the queue, it permits future invocations to PUSH
to push the queue to the given destination. Whether the disabled parameter is TRUE
or FALSE
, a COMMIT
is required for the setting to take effect in other sessions.
DBMS_DEFER_SYS.SET_DISABLED ( destination IN VARCHAR2, disabled IN BOOLEAN := TRUE);
Exception | Description |
---|---|
NO_DATA_FOUND |
No entry was found in the |
To unregister a user as the propagator from the local database. This procedure
DEFPROPAGATOR
.
REGISTER_PROPAGATOR
from the given user (including identical privileges granted independently).
DBMS_DEFER_SYS.UNREGISTER_PROPAGATOR ( username IN VARCHAR2 timeout IN INTEGER DEFAULT DBMS_LOCK.MAXWAIT);
Parameter | Description |
---|---|
username |
Name of the propagator user. |
timeout |
Timeout in seconds. If the propagator is in use, then the procedure waits until timeout. The default is |
Parameter | Description |
---|---|
missingpropagator |
Given user is not a propagator. |
propagator_inuse |
Propagator is in use, and thus cannot be unregistered. Try later. |
This procedure stops automatic purges of pushed transactions from the deferred transaction queue at a snapshot or master site.
DBMS_DEFER_SYS.UNSCHEDULE_PURGE;
None
This procedure stops automatic pushes of the deferred transaction queue from a snapshot or master site to another master site.
DBMS_DEFER_SYS.UNSCHEDULE_PUSH ( dblink IN VARCHAR2);
Parameter | Description |
---|---|
dblink |
Fully qualified pathname to master database site at which you want to unschedule periodic execution of deferred remote procedure calls. |
Exception | Description |
---|---|
NO_DATA_FOUND |
No entry was found in the |
Subprogram | Description |
---|---|
BEGIN_INSTANTIATION procedure |
Starts offline instantiation of a replicated master group. |
BEGIN_LOAD procedure |
Disables triggers while data is imported to new master site as part of offline instantiation. |
END_INSTANTIATION procedure |
Completes offline instantiation of a replicated master group. |
END_LOAD procedure |
Re-enables triggers after importing data to new master site as part of offline instantiation. |
RESUME_SUBSET_OF_ MASTERS procedure |
Resumes replication activity at all existing sites except the new site during offline instantiation of a replicated master group. |
This procedure starts offline instantiation of a replicated master group. You must call this procedure from the master definition site.
DBMS_OFFLINE_OG.BEGIN_INSTANTIATION ( gname IN VARCHAR2, new_site IN VARCHAR2 fname IN VARCHAR2);
This procedure disables triggers while data is imported to new master site as part of offline instantiation. You must call this procedure from the new master site.
DBMS_OFFLINE_OG.BEGIN_LOAD ( gname IN VARCHAR2, new_site IN VARCHAR2);
This procedure completes offline instantiation of a replicated master group. You must call this procedure from the master definition site.
DBMS_OFFLINE_OG.END_INSTANTIATION ( gname IN VARCHAR2, new_site IN VARCHAR2);
This procedure re-enables triggers after importing data to new master site as part of offline instantiation. You must call this procedure from the new master site.
DBMS_OFFLINE_OG.END_LOAD ( gname IN VARCHAR2, new_site IN VARCHAR2 fname IN VARCHAR2);
This procedure resumes replication activity at all existing sites except the new site during offline instantiation of a replicated master group. You must call this procedure from the master definition site.
DBMS_OFFLINE_OG.RESUME_SUBSET_OF_MASTERS ( gname IN VARCHAR2, new_site IN VARCHAR2 override IN BOOLEAN := FALSE);
Subprogram | Description |
---|---|
BEGIN_LOAD procedure |
Prepares a snapshot site for import of a new snapshot as part of offline instantiation. |
END_LOAD procedure |
Completes offline instantiation of a snapshot. |
This procedure prepares a snapshot site for import of a new snapshot as part of offline instantiation. You must call this procedure from the snapshot site for the new snapshot.
DBMS_OFFLINE_SNAPSHOT.BEGIN_LOAD ( gname IN VARCHAR2, sname IN VARCHAR2, master_site IN VARCHAR2, snapshot_oname IN VARCHAR2, storage_c IN VARCHAR2 := '', comment IN VARCHAR2 := '', min_communication IN BOOLEAN := TRUE);
This procedure completes offline instantiation of a snapshot. You must call this procedure from the snapshot site for the new snapshot.
DBMS_OFFLINE_SNAPSHOT.END_LOAD ( gname IN VARCHAR2, sname IN VARCHAR2, snapshot_oname IN VARCHAR2);
Subprogram | Description |
---|---|
DIFFERENCES procedure |
Determines the differences between two tables. |
RECTIFY procedure |
Resolves the differences between two tables. |
This procedure determines the differences between two tables.
DBMS_RECTIFIER_DIFF.DIFFERENCES ( sname1 IN VARCHAR2, oname1 IN VARCHAR2, reference_site IN VARCHAR2 := '', sname2 IN VARCHAR2, oname2 IN VARCHAR2, comparison_site IN VARCHAR2 := '', where_clause IN VARCHAR2 := '', { column_list IN VARCHAR2 := '', | array_columns IN dbms_utility.name_array, } missing_rows_sname IN VARCHAR2, missing_rows_oname1 IN VARCHAR2, missing_rows_oname2 IN VARCHAR2, missing_rows_site IN VARCHAR2 := '', max_missing IN INTEGER, commit_rows IN INTEGER := 500);
The error ORA-00001
(Unique constraint violated) is issued when there are any unique or primary key constraints on the MISSING_ROWS_DATA
table.
This procedure resolves the differences between two tables.
DBMS_RECTIFIER_DIFF.RECTIFY ( sname1 IN VARCHAR2, oname1 IN VARCHAR2, reference_site IN VARCHAR2 := '', sname2 IN VARCHAR2, oname2 IN VARCHAR2, comparison_site IN VARCHAR2 := '', { column_list IN VARCHAR2 := '', | array_columns IN dbms_utility.name_array, } missing_rows_sname IN VARCHAR2, missing_rows_oname1 IN VARCHAR2, missing_rows_oname2 IN VARCHAR2, missing_rows_site IN VARCHAR2 := '', commit_rows IN INTEGER := 500);
Subprogram | Description |
---|---|
ADD procedure |
Adds snapshots to a refresh group. |
CHANGE procedure |
Changes the refresh interval for a snapshot group. |
DESTROY procedure |
Removes all of the snapshots from a refresh group and deletes the refresh group. |
MAKE procedure |
Specifies the members of a refresh group and the time interval used to determine when the members of this group should be refreshed. |
REFRESH procedure |
Manually refreshes a refresh group. |
SUBTRACT procedure |
Removes snapshots from a refresh group. |
This procedure adds snapshots to a refresh group.
For additional information, see "ADD OBJECTS TO REFRESH GROUP". Also see "Snapshot Concepts & Architecture" in the Oracle8i Replication manual.
DBMS_REFRESH.ADD ( name IN VARCHAR2, { list IN VARCHAR2, | tab IN DBMS_UTILITY.UNCL_ARRAY, } lax IN BOOLEAN := FALSE);
This procedure changes the refresh interval for a snapshot group.
For additional information, see "Snapshot Concepts & Architecture" in the Oracle8i Replication manual.
DBMS_REFRESH.CHANGE ( name IN VARCHAR2, next_date IN DATE := NULL, interval IN VARCHAR2 := NULL, implicit_destroy IN BOOLEAN := NULL, rollback_seg IN VARCHAR2 := NULL, push_deferred_rpc IN BOOLEAN := NULL, refresh_after_errors IN BOOLEAN := NULL, purge_option IN BINARY_INTEGER := NULL, parallelism IN BINARY_INTEGER := NULL, heap_size IN BINARY_INTEGER := NULL);
This procedure removes all of the snapshots from a refresh group and delete the refresh group.
For additional information, see "Snapshot Concepts & Architecture" in the Oracle8i Replication manual.
DBMS_REFRESH.DESTROY ( name IN VARCHAR2);
Parameter | Description |
---|---|
name |
Name of the refresh group that you want to destroy. |
This procedure specifies the members of a refresh group and the time interval used to determine when the members of this group should be refreshed.
For additional information, see "CREATE REFRESH GROUP". Also see "Snapshot Concepts & Architecture" in the Oracle8i Replication manual.
DBMS_REFRESH.MAKE ( name IN VARCHAR2 { list IN VARCHAR2, | tab IN DBMS_UTILITY.UNCL_ARRAY,} next_date IN DATE, interval IN VARCHAR2, implicit_destroy IN BOOLEAN := FALSE, lax IN BOOLEAN := FALSE, job IN BINARY INTEGER := 0, rollback_seg IN VARCHAR2 := NULL, push_deferred_rpc IN BOOLEAN := TRUE, refresh_after_errors IN BOOLEAN := FALSE) purge_option IN BINARY_INTEGER := NULL, parallelism IN BINARY_INTEGER := NULL, heap_size IN BINARY_INTEGER := NULL);
This procedure manually refreshes a refresh group.
For additional information, see "Snapshot Concepts & Architecture" in the Oracle8i Replication manual.
DBMS_REFRESH.REFRESH ( name IN VARCHAR2);
Parameter | Description |
---|---|
name |
Name of the refresh group that you want to refresh manually. |
This procedure removes snapshots from a refresh group.
For additional information, see "Snapshot Concepts & Architecture" in the Oracle8i Replication manual.
DBMS_REFRESH.SUBTRACT ( name IN VARCHAR2, { list IN VARCHAR2, | tab IN DBMS_UTILITY.UNCL_ARRAY, } lax IN BOOLEAN := FALSE);
Subprogram | Description |
---|---|
ADD_GROUPED_COLUMN procedure |
Adds members to an existing column group. |
ADD_MASTER_DATABASE procedure |
Adds another master site to your replicated environment. |
ADD_PRIORITY_datatype procedure |
Adds a member to a priority group. |
ADD_SITE_PRIORITY_SITE procedure |
Adds a new site to a site priority group. |
ADD_conflicttype_RESOLUTION procedure |
Designates a method for resolving an update, delete, or uniqueness conflict. |
ALTER_MASTER_PROPAGATION procedure |
Alters the propagation method for a given object group at a given master site. |
ALTER_MASTER_REPOBJECT procedure |
Alters an object in your replicated environment. |
ALTER_PRIORITY procedure |
Alters the priority level associated with a given priority group member. |
ALTER_PRIORITY_datatype procedure |
Alters the value of a member in a priority group. |
ALTER_SITE_PRIORITY procedure |
Alters the priority level associated with a given site. |
ALTER_SITE_PRIORITY_SITE procedure |
Alters the site associated with a given priority level. |
ALTER_SNAPSHOT_PROPAGATION procedure |
Alters the propagation method for a given object group at the current snapshot site. |
CANCEL_STATISTICS procedure |
Stops collecting statistics about the successful resolution of update, uniqueness, and delete conflicts for a table. |
COMMENT_ON_COLUMN_GROUP procedure |
Updates the comment field in the |
COMMENT_ON_PRIORITY_ GROUP/COMMENT_ON_SITE_ PRIORITY procedure |
Updates the comment field in the |
COMMENT_ON_REPGROUP procedure |
Updates the comment field in the |
COMMENT_ON_REPSITES procedure |
Updates the comment field in the |
COMMENT_ON_REPOBJECT procedure |
Updates the comment field in the |
COMMENT_ON_conflicttype_ RESOLUTION procedure |
Updates the comment field in the |
CREATE_MASTER_REPGROUP procedure |
Creates a new, empty, quiesced master replication object group. |
CREATE_MASTER_REPOBJECT procedure |
Indicates that an object is a replicated object. |
CREATE_SNAPSHOT_REPGROUP procedure |
Creates a new, empty snapshot replication object group in your local database. |
CREATE_SNAPSHOT_REPOBJECT procedure |
Adds a replicated object to your snapshot site. |
DEFINE_COLUMN_GROUP procedure |
Creates an empty column group |
DEFINE_PRIORITY_GROUP procedure |
Creates a new priority group for a replicated master group. |
DEFINE_SITE_PRIORITY procedure |
Creates a new site priority group for a replicated master group. |
DO_DEFERRED_REPCAT_ADMIN procedure |
Executes the local outstanding deferred administrative procedures for the given replicated master group at the current master site, or for all master sites. |
DROP_COLUMN_GROUP procedure |
Drops a column group. |
DROP_GROUPED_COLUMN procedure |
Removes members from a column group. |
DROP_MASTER_REPGROUP procedure |
Drops a replicated master group from your current site. |
DROP_MASTER_REPOBJECT procedure |
Drops a replicated object from a replicated master group. |
DROP_PRIORITY procedure |
Drops a member of a priority group by priority level. |
DROP_PRIORITY_GROUP procedure |
Drops a priority group for a given replicated master group. |
DROP_PRIORITY_datatype procedure |
Drops a member of a priority group by value. |
DROP_SITE_PRIORITY procedure |
Drops a site priority group for a given replicated master group. |
DROP_SITE_PRIORITY_SITE procedure |
Drops a given site, by name, from a site priority group. |
DROP_SNAPSHOT_REPGROUP procedure |
Drops a snapshot site from your replicated environment. |
DROP_SNAPSHOT_REPOBJECT procedure |
Drops a replicated object from a snapshot site. |
DROP_conflicttype_ RESOLUTION procedure |
Drops an update, delete, or uniqueness conflict resolution routine. |
EXECUTE_DDL procedure |
Supplies DDL that you want to have executed at each master site. |
GENERATE_REPLICATION_ SUPPORT procedure |
Generates the triggers, packages, and procedures needed to support replication. |
GENERATE_SNAPSHOT_SUPPORT procedure |
Activates triggers and generate packages needed to support the replication of updatable snapshots or procedural replication. |
MAKE_COLUMN_GROUP procedure |
Creates a new column group with one or more members. |
PURGE_MASTER_LOG procedure |
Removes local messages in the |
PURGE_STATISTICS procedure |
Removes information from the |
REFRESH_SNAPSHOT_REPGROUP procedure |
Refreshes a snapshot site object group with the most recent data from its associated master site. |
REGISTER_SNAPSHOT_REPGROUP procedure |
Facilitates the administration of snapshots at their respective master sites by inserting/modifying/deleting from |
REGISTER_STATISTICS procedure |
Collects information about the successful resolution of update, delete and uniqueness conflicts for a table. |
RELOCATE_MASTERDEF procedure |
Changes your master definition site to another master site in your replicated environment. |
REMOVE_MASTER_DATABASES procedure |
Removes one or more master databases from a replicated environment. |
REPCAT_IMPORT_CHECK procedure |
Ensures that the objects in the replicated master group have the appropriate object identifiers and status values after you perform an export/import of a replicated object or an object used by the advanced replication facility. |
RESUME_MASTER_ACTIVITY procedure |
Resumes normal replication activity after quiescing a replicated environment. |
SUSPEND_MASTER_ACTIVITY procedure |
Suspends replication activity for an object group |
SWITCH_SNAPSHOT_MASTER procedure |
Changes the master database of a snapshot replicated master group to another master site. |
UNREGISTER_SNAPSHOT_ REPGROUP procedure |
Facilitates the administration of snapshots at their respective master sites by inserting/modifying/deleting from |
VALIDATE function |
Validates the correctness of key conditions of a multiple master replication environment. |
WAIT_MASTER_LOG procedure |
Determines whether changes that were asynchronously propagated to a master site have been applied. |
This procedure adds members to an existing column group. You must call this procedure from the master definition site.
DBMS_REPCAT.ADD_GROUPED_COLUMN ( sname IN VARCHAR2, oname IN VARCHAR2, column_group IN VARCHAR2, list_of_column_names IN VARCHAR2 | DBMS_REPCAT.VARCHAR2S);
This procedure adds another master site to your replicated environment. This procedure regenerates all the triggers and their associated packages at existing master sites. You must call this procedure from the master definition site.
DBMS_REPCAT.ADD_MASTER_DATABASE ( gname IN VARCHAR2, master IN VARCHAR2, use_existing_objects IN BOOLEAN := TRUE, copy_rows IN BOOLEAN := TRUE, comment IN VARCHAR2 := '', propagation_mode IN VARCHAR2 := 'ASYNCHRONOUS', fname IN VARCHAR2 := NULL);
Parameter | Description |
---|---|
gname |
Name of the object group being replicated. This object group must already exist at the master definition site. |
master |
Fully qualified database name of the new master database. |
use_existing_objects |
Indicate |
copy_rows |
Indicate |
comment |
This is added to the |
propagation_mode |
Method of forwarding changes to and receiving changes from new master database. Accepted values are |
fname |
This system parameter is for internal use only. Do not set the parameter unless so directed by Oracle Worldwide Support. |
This procedure adds a member to a priority group. You must call this procedure from the master definition site. The procedure that you must call is determined by the datatype of your priority
column. You must call this procedure once for each of the possible values of the priority
column.
For additional information, see "Conflict Resolution" in the Oracle8i Replication manual.
DBMS_REPCAT.ADD_PRIORITY_datatype ( gname IN VARCHAR2, pgroup IN VARCHAR2, value IN datatype, priority IN NUMBER);
where datatype:
{ NUMBER | VARCHAR2 | CHAR | DATE | RAW | NCHAR | NVARCHAR2 }
This procedure adds a new site to a site priority group. You must call this procedure from the master definition site.
For additional information, see "Conflict Resolution" in the Oracle8i Replication manual.
DBMS_REPCAT.ADD_SITE_PRIORITY_SITE ( gname IN VARCHAR2, name IN VARCHAR2 site IN VARCHAR2, priority IN NUMBER);
This procedure designates a method for resolving an update, delete, or uniqueness conflict. You must call these procedures from the master definition site. The procedure that you need to call is determined by the type of conflict that the routine resolves.
Conflict Type | Procedure Name |
---|---|
update |
ADD_UPDATE_RESOLUTION |
uniqueness |
ADD_UNIQUE_RESOLUTION |
delete |
ADD_DELETE_RESOLUTION |
For more information about designating methods to resolve update conflicts, selecting uniqueness conflict resolution methods, and, assigning delete conflict resolution methods see "Conflict Resolution" in the Oracle8i Replication manual.
DBMS_REPCAT.ADD_UPDATE_RESOLUTION ( sname IN VARCHAR2, oname IN VARCHAR2, column_group IN VARCHAR2, sequence_no IN NUMBER, method IN VARCHAR2, parameter_column_name IN VARCHAR2 | DBMS_REPCAT.VARCHAR2S, priority_group IN VARCHAR2 := NULL, function_name IN VARCHAR2 := NULL, comment IN VARCHAR2 := NULL); DBMS_REPCAT.ADD_DELETE_RESOLUTION ( sname IN VARCHAR2, oname IN VARCHAR2, sequence_no IN NUMBER, parameter_column_name IN VARCHAR2 | DBMS_REPCAT.VARCHAR2S, function_name IN VARCHAR2, comment IN VARCHAR2 := NULL method IN VARCHAR2 := 'USER FUNCTION'); DBMS_REPCAT.ADD_UNIQUE_RESOLUTION( sname IN VARCHAR2, oname IN VARCHAR2, constraint_name IN VARCHAR2, sequence_no IN NUMBER, method IN VARCHAR2, parameter_column_name IN VARCHAR2 | DBMS_REPCAT.VARCHAR2S, function_name IN VARCHAR2 := NULL, comment IN VARCHAR2 := NULL);
Parameter | Description |
---|---|
sname |
Name of the schema containing the table to be replicated. |
oname |
Name of the table for which you are adding a conflict resolution routine. |
column_group |
Name of the column group for which you are adding a conflict resolution routine. Column groups are required for update conflict resolution routines only. |
constraint_name |
Name of the unique constraint or unique index for which you are adding a conflict resolution routine. Use the name of the unique index if it differs from the name of the associated unique constraint. Constraint names are required for uniqueness conflict resolution routines only. |
sequence_no |
Order in which the designated conflict resolution methods should be applied. |
method |
Type of conflict resolution routine that you want to create. This can be the name of one of the standard routines provided with advanced replication, or, if you have written your own routine, you should choose |
parameter_column_ name |
Name of the columns used to resolve the conflict. The standard methods operate on a single column. For example, if you are using the This argument accepts either a comma separated list of column names, or a PL/SQL table of type dbms_repcat.varchar2s. The single value '*' indicates that you want to use all of the columns in the table (or column group, for update conflicts) to resolve the conflict. If you specify '*', then the columns are passed to your function in alphabetical order. |
priority_group |
If you are using the
See "Conflict Resolution" in the Oracle8i Replication manual. If you are using a different method, you can use the default value for this argument, |
function_name |
If you selected the |
comment |
This user comment is added to the |
This procedure alters the propagation method for a given object group at a given master site. This object group must be quiesced. You must call this procedure from the master definition site. If the master appears in the dblink_list
or dblink_table
, then ALTER_MASTER_PROPAGATION
ignores that database link. You cannot change the propagation mode from a master to itself.
DBMS_REPCAT.ALTER_MASTER_PROPAGATION ( gname IN VARCHAR2, master IN VARCHAR2, { dblink_list IN VARCHAR2, | dblink_table IN dbms_utility.dblink_array,} propagation_mode IN VARCHAR2 : ='asynchronous', comment IN VARCHAR2 := '');
This procedure alters an object in your replicated environment. You must call this procedure from the master definition site.
DBMS_REPCAT.ALTER_MASTER_REPOBJECT ( sname IN VARCHAR2, oname IN VARCHAR2, type IN VARCHAR2, ddl_text IN VARCHAR2, comment IN VARCHAR2 := '', retry IN BOOLEAN := FALSE);
If the DDL is supplied without specifying a schema, then the default schema is the replication administrator's schema. Be sure to specify the schema if it is other than the replication administrator's schema.
This procedure alters the priority level associated with a given priority group member. You must call this procedure from the master definition site.
See "Conflict Resolution" in the Oracle8i Replication manual.
DBMS_REPCAT.ALTER_PRIORITY ( gname IN VARCHAR2, pgroup IN VARCHAR2, old_priority IN NUMBER, new_priority IN NUMBER);
This procedure alters the value of a member in a priority group. You must call this procedure from the master definition site. The procedure that you must call is determined by the datatype of your priority
column.
For additional information, see "Conflict Resolution" in the Oracle8i Replication manual.
DBMS_REPCAT.ALTER_PRIORITY_datatype ( gname IN VARCHAR2, pgroup IN VARCHAR2, old_value IN datatype, new_value IN datatype);
where datatype:
{ NUMBER | VARCHAR2 | CHAR | DATE | RAW | NCHAR | NVARCHAR2 }
This procedure alters the priority level associated with a given site. You must call this procedure from the master definition site.
See "Conflict Resolution" in the Oracle8i Replication manual.
DBMS_REPCAT.ALTER_SITE_PRIORITY ( gname IN VARCHAR2, name IN VARCHAR2, old_priority IN NUMBER, new_priority IN NUMBER);
This procedure alters the site associated with a given priority level. You must call this procedure from the master definition site.
See "Conflict Resolution" in the Oracle8i Replication manual.
DBMS_REPCAT.ALTER_SITE_PRIORITY_SITE ( gname IN VARCHAR2, name IN VARCHAR2, old_site IN VARCHAR2, new_site IN VARCHAR2);
This procedure alters the propagation method for a given object group at the current snapshot site. This procedure pushes the deferred transaction queue at the snapshot site, locks the snapshot base tables, and regenerates any triggers and their associated packages. You must call this procedure from the snapshot site.
DBMS_REPCAT.ALTER_SNAPSHOT_PROPAGATION ( gname IN VARCHAR2, propagation_mode IN VARCHAR2, comment IN VARCHAR2 := '');
This procedure stops collecting statistics about the successful resolution of update, uniqueness, and delete conflicts for a table.
DBMS_REPCAT.CANCEL_STATISTICS ( sname IN VARCHAR2, oname IN VARCHAR2);
Parameter | Description |
---|---|
sname |
Name of the schema in which the table is located. |
oname |
Name of the table for which you do not want to gather conflict resolution statistics. |
Exception | Description |
---|---|
missingschema |
Given schema does not exist. |
missingobject |
Given table does not exist. |
statnotreg |
Given table is not currently registered to collect statistics. |
This procedure updates the comment field in the RepColumn_Group
view for a column group. This comment is not added at all master sites until the next call to DBMS_REPCAT
.GENERATE_REPLICATION_SUPPORT
.
DBMS_REPCAT.COMMENT_ON_COLUMN_GROUP ( sname IN VARCHAR2, oname IN VARCHAR2, column_group IN VARCHAR2, comment IN VARCHAR2);
Exception | Description |
---|---|
nonmasterdef |
Invocation site is not the master definition site. |
missinggroup |
Given column group does not exist. |
missingobj |
Object is missing. |
COMMENT_ON_PRIORITY_GROUP
updates the comment field in the REPPRIORITY_GROUP
view for a priority group. This comment is not added at all master sites until the next call to GENERATE_REPLICATION_SUPPORT
.
COMMENT_ON_SITE_PRIORITY
updates the comment field in the REPPRIORITY_GROUP
view for a site priority group. This procedure is a wrapper for the COMMENT_ON_COLUMN_GROUP
procedure and is provided as a convenience only. This procedure must be issued at the master definition site.
DBMS_REPCAT.COMMENT_ON_PRIORITY_GROUP ( gname IN VARCHAR2, pgroup IN VARCHAR2, comment IN VARCHAR2); DBMS_REPCAT.COMMENT_ON_SITE_PRIORITY ( gname IN VARCHAR2, name IN VARCHAR2, comment IN VARCHAR2);
This procedure updates the comment field in the REPGROUP
view for a replicated master group. This procedure must be issued at the master definition site.
DBMS_REPCAT.COMMENT_ON_REPGROUP ( gname IN VARCHAR2, comment IN VARCHAR2);
Parameter | Description |
---|---|
gname |
Name of the object group that you want to comment on. |
comment |
Updated comment to include in the |
Exception | Description |
---|---|
nonmasterdef |
Invocation site is not the master definition site. |
commfailure |
At least one master site is not accessible. |
This procedure updates the comment field in the RepSite
view for a replicated site. This procedure must be issued at the master definition site.
DBMS_REPCAT.COMMENT_ON_REPSITES ( gname IN VARCHAR2, [ master IN VARCHAR,] comment IN VARCHAR2);
Exception | Description |
---|---|
nonmasterdef |
Invocation site is not the master definition site. |
nonmaster |
Invocation site is not a master site. |
commfailure |
At least one master site is not accessible. |
This procedure updates the comment field in the RepObject
view for a replicated object. This procedure must be issued at the master definition site.
DBMS_REPCAT.COMMENT_ON_REPOBJECT ( sname IN VARCHAR2, oname IN VARCHAR2, type IN VARCHAR2, comment IN VARCHAR2);
This procedure updates the comment field in the RepResolution
view for a conflict resolution routine. The procedure that you need to call is determined by the type of conflict that the routine resolves. These procedures must be issued at the master definition site.
Conflict Type | Procedure Name |
---|---|
update |
COMMENT_ON_UPDATE_RESOLUTION |
uniqueness |
COMMENT_ON_UNIQUE_RESOLUTION |
delete |
COMMENT_ON_DELETE_RESOLUTION |
The comment is not added at all master sites until the next call to GENERATE_REPLICATION_SUPPORT
.
DBMS_REPCAT.COMMENT_ON_UPDATE_RESOLUTION ( sname IN VARCHAR2, oname IN VARCHAR2, column_group IN VARCHAR2, sequence_no IN NUMBER, comment IN VARCHAR2); DBMS_REPCAT.COMMENT_ON_UNIQUE_RESOLUTION ( sname IN VARCHAR2, oname IN VARCHAR2, constraint_name IN VARCHAR2, sequence_no IN NUMBER, comment IN VARCHAR2); DBMS_REPCAT.COMMENT_ON_DELETE_RESOLUTION ( sname IN VARCHAR2, oname IN VARCHAR2, sequence_no IN NUMBER, comment IN VARCHAR2);
You have the option of comparing old column values for each non-key column of a replicated table for updates and deletes. The default is to compare old values for all columns. You can change this behavior at all master and snapshot sites by invoking DBMS_REPCAT
.COMPARE_OLD_VALUES
at the master definition site.
DBMS_REPCAT.COMPARE_OLD_VALUES( sname IN VARCHAR2, oname IN VARCHAR2, { column_list IN VARCHAR2, | column_table IN DBMS_REPCAT.VARCHAR2s,} operation IN VARCHAR2 := `UPDATE', compare IN BOOLEAN := TRUE );
Note:
The Read "Minimizing Data Propagation for Update Conflict Resolution" in the Oracle8i Replication manual before changing the default behavior of Oracle. |
This procedure creates a new, empty, quiesced master replication object group.
DBMS_REPCAT.CREATE_MASTER_REPGROUP ( gname IN VARCHAR2, group_comment IN VARCHAR2 := '', master_comment IN VARCHAR2 := ''), qualifier IN VARCHAR2 := '');
Parameter | Description |
---|---|
gname |
Name of the object group that you want to create. |
group_comment |
This comment is added to the |
master_comment |
This comment is added to the |
qualifier |
Connection qualifier for object group. Be sure to use the @ sign, as shown in the example: See "Managing Master Groups" in the Oracle8i Replication manual. |
This procedure indicates that an object is a replicated object.
DBMS_REPCAT.CREATE_MASTER_REPOBJECT ( sname IN VARCHAR2, oname IN VARCHAR2, type IN VARCHAR2, use_existing_object IN BOOLEAN := TRUE, ddl_text IN VARCHAR2 := NULL, comment IN VARCHAR2 := '', retry IN BOOLEAN := FALSE copy_rows IN BOOLEAN := TRUE, gname IN VARCHAR2 := '');
Parameters | Description |
---|---|
sname |
Name of the schema in which the object that you want to replicate is located. |
oname |
Name of the object you are replicating. If |
type |
Type of the object that you are replicating. The types supported are: |
use_existing_object |
Indicate |
ddl_text |
If the object does not already exist at the master definition site, then you must supply the DDL text necessary to create this object. PL/SQL packages, package bodies, procedures, and functions must have a trailing semicolon. SQL statements do not end with trailing semicolon. Oracle does not parse this DDL before applying it; therefore, you must ensure that your DDL text provides the appropriate schema and object name for the object being created. |
comment |
This comment is added to the |
retry |
Indicate |
copy_rows |
Indicate |
gname |
Name of the object group in which you want to create the replicated object. The schema name is used as the default object group name if none is specified. |
If the DDL is supplied without specifying a schema, then the default schema is the replication administrator's schema. Be sure to specify the schema if it is other than the replication administrator's schema.
This procedure creates a new, empty snapshot group in your local database.
DBMS_REPCAT.CREATE_SNAPSHOT_REPGROUP ( gname IN VARCHAR2, master IN VARCHAR2, comment IN VARCHAR2 := '', propagation_mode IN VARCHAR2 := 'ASYNCHRONOUS', fname IN VARCHAR2 := NULL);
CREATE_SNAPSHOT_REPGROUP
automatically calls REGISTER_SNAPSHOT_REPGROUP
, but ignores any errors that may have happened during registration.
This procedure adds a replicated object to your snapshot site.
DBMS_REPCAT.CREATE_SNAPSHOT_REPOBJECT ( sname IN VARCHAR2, oname IN VARCHAR2, type IN VARCHAR2, ddl_text IN VARCHAR2 := '', comment IN VARCHAR2 := '', gname IN VARCHAR2 := '', gen_objs_owner IN VARCHAR2 := '', min_communication IN BOOLEAN := TRUE , generate_80_compatible IN BOOLEAN := TRUE);
Parameter | Description |
---|---|
sname |
Name of the schema in which the object is located. |
oname |
Name of the object that you want to add to the replicated snapshot object group. |
type |
Type of the object that you are replicating. The types supported for snapshot sites are: |
ddl_text |
For objects of type |
comment |
This comment is added to the |
gname |
Name of the replicated master group to which you are adding an object. The schema name is used as the default group name if none is specified. |
gen_objs_owner |
Name of the user you want to assign as owner of the transaction. |
min_communication |
Set to |
generate_80_ compatible |
Set to |
If the DDL is supplied without specifying a schema, then the default schema is the replication administrator's schema. Be sure to specify the schema if it is other than the replication administrator's schema.
This procedure creates an empty column group. You must call this procedure from the master definition site.
For more information, see "Conflict Resolution" in the Oracle8i Replication manual.
DBMS_REPCAT.DEFINE_COLUMN_GROUP ( sname IN VARCHAR2, oname IN VARCHAR2, column_group IN VARCHAR2, comment IN VARCHAR2 := NULL);
This procedure creates a new priority group for a replicated master group. You must call this procedure from the master definition site.
See "Conflict Resolution" in the Oracle8i Replication manual.
DBMS_REPCAT.DEFINE_PRIORITY_GROUP ( gname IN VARCHAR2, pgroup IN VARCHAR2, datatype IN VARCHAR2, fixed_length IN INTEGER := NULL, comment IN VARCHAR2 := NULL);
This procedure creates a new site priority group for a replicated master group. You must call this procedure from the master definition site.
See "Conflict Resolution" in the Oracle8i Replication manual.
DBMS_REPCAT.DEFINE_SITE_PRIORITY ( gname IN VARCHAR2, name IN VARCHAR2, comment IN VARCHAR2 := NULL);
This procedure executes the local outstanding deferred administrative procedures for the given replicated master group at the current master site, or (with assistance from job queues) for all master sites.
DBMS_REPCAT.DO_DEFERRED_REPCAT_ADMIN ( gname IN VARCHAR2, all_sites IN BOOLEAN := FALSE);
Parameter | Description |
---|---|
gname |
Name of the replicated master group. |
all_sites |
If this is |
Exception | Description |
---|---|
nonmaster |
Invocation site is not a master site. |
commfailure |
At least one master site is not accessible and |
DO_DEFERRED_REPCAT_ADMIN
executes only those administrative requests submitted by the connected user that called DO_DEFERRED_REPCAT_ADMIN
. Requests submitted by other users are ignored.
This procedure drops a column group. You must call this procedure from the master definition site.
See "Conflict Resolution" in the Oracle8i Replication manual.
DBMS_REPCAT.DROP_COLUMN_GROUP ( sname IN VARCHAR2, oname IN VARCHAR2, column_group IN VARCHAR2);
This procedure removes members from a column group. You must call this procedure from the master definition site.
For more information, see "Conflict Resolution" in the Oracle8i Replication manual.
DBMS_REPCAT.DROP_GROUPED_COLUMN ( sname IN VARCHAR2, oname IN VARCHAR2, column_group IN VARCHAR2, list_of_column_names IN VARCHAR2 | DBMS_REPCAT.VARCHAR2S);
Exception | Description |
---|---|
nonmasterdef |
Invocation site is not the masterdef site. |
missingobject |
Given table does not exist. |
notquiesced |
replicated master group that the table belongs to is not quiesced. |
This procedure drops a replicated master group from your current site. To drop the replicated master group from all master sites, including the master definition site, you can call this procedure at the master definition site, and set the final argument to TRUE
.
DBMS_REPCAT.DROP_MASTER_REPGROUP ( gname IN VARCHAR2, drop_contents IN BOOLEAN := FALSE, all_sites IN BOOLEAN := FALSE);
This procedure drops a replicated object from a replicated master group. You must call this procedure from the master definition site.
DBMS_REPCAT.DROP_MASTER_REPOBJECT ( sname IN VARCHAR2, oname IN VARCHAR2, type IN VARCHAR2, drop_objects IN BOOLEAN := FALSE);
This procedure drops a member of a priority group by priority level. You must call this procedure from the master definition site.
See "Conflict Resolution" in the Oracle8i Replication manual.
DBMS_REPCAT.DROP_PRIORITY( gname IN VARCHAR2, pgroup IN VARCHAR2, priority_num IN NUMBER);
This procedure drops a priority group for a given replicated master group. You must call this procedure from the master definition site.
See "Conflict Resolution" in the Oracle8i Replication manual.
DBMS_REPCAT.DROP_PRIORITY_GROUP ( gname IN VARCHAR2, pgroup IN VARCHAR2);
Parameter | Description |
---|---|
gname |
replicated master group with which the priority group is associated. |
pgroup |
Name of the priority group that you want to drop. |
This procedure drops a member of a priority group by value. You must call this procedure from the master definition site. The procedure that you must call is determined by the datatype of your priority
column.
See "Conflict Resolution" in the Oracle8i Replication manual.
DBMS_REPCAT.DROP_PRIORITY_datatype ( gname IN VARCHAR2, pgroup IN VARCHAR2, value IN datatype);
where datatype:
{ NUMBER | VARCHAR2 | CHAR | DATE | RAW | NCHAR | NVARCHAR2 }
This procedure drops a site priority group for a given replicated master group. You must call this procedure from the master definition site.
See "Conflict Resolution" in the Oracle8i Replication manual.
DBMS_REPCAT.DROP_SITE_PRIORITY ( gname IN VARCHAR2, name IN VARCHAR2);
Parameter | Description |
---|---|
gname |
replicated master group with which the site priority group is associated. |
name |
Name of the site priority group that you want to drop. |
This procedure drops a given site, by name, from a site priority group. You must call this procedure from the master definition site.
See "Conflict Resolution" in the Oracle8i Replication manual.
DBMS_REPCAT.DROP_SITE_PRIORITY_SITE ( gname IN VARCHAR2, name IN VARCHAR2, site IN VARCHAR2);
This procedure drops a snapshot site from your replicated environment.
DBMS_REPCAT.DROP_SNAPSHOT_REPGROUP ( gname IN VARCHAR2, drop_contents IN BOOLEAN := FALSE);
Exception | Description |
---|---|
nonsnapshot |
Invocation site is not a snapshot site. |
missingrepgroup |
Specified object group does not exist. |
DROP_SNAPSHOT_REPGROUP
automatically calls UNREGISTER_SNAPSHOT_REPGROUP
to unregister the snapshot, but ignores any errors that may have occurred during unregistration.
This procedure drops a replicated object from a snapshot site.
DBMS_REPCAT.DROP_SNAPSHOT_REPOBJECT ( sname IN VARCHAR2, oname IN VARCHAR2, type IN VARCHAR2, drop_objects IN BOOLEAN := FALSE);
Exception | Description |
---|---|
nonsnapshot |
Invocation site is not a snapshot site. |
missingobject |
Given object does not exist. |
typefailure |
Given type parameter is not supported. |
This procedure drops an update, delete, or uniqueness conflict resolution routine. You must call these procedures from the master definition site. The procedure that you must call is determined by the type of conflict that the routine resolves.
Conflict Type | Procedure Name |
---|---|
update |
DROP_UPDATE_RESOLUTION |
uniqueness |
DROP_UNIQUE_RESOLUTION |
delete |
DROP_DELETE_RESOLUTION |
DBMS_REPCAT.DROP_UPDATE_RESOLUTION ( sname IN VARCHAR2, oname IN VARCHAR2, column_group IN VARCHAR2, sequence_no IN NUMBER); DBMS_REPCAT.DROP_DELETE_RESOLUTION ( sname IN VARCHAR2, oname IN VARCHAR2, sequence_no IN NUMBER); DBMS_REPCAT.DROP_UNIQUE_RESOLUTION ( sname IN VARCHAR2, oname IN VARCHAR2, constraint_name IN VARCHAR2, sequence_no IN NUMBER);
This procedure supplies DDL that you want to have executed at some or all master sites. You can call this procedure only from the master definition site.
DBMS_REPCAT.EXECUTE_DDL ( gname IN VARCHAR2, { master_list IN VARCHAR2 := NULL, | master_table IN DBMS_UTILITY.DBLINK_ARRAY,} DDL_TEXT IN VARCHAR2);
If the DDL is supplied without specifying a schema, then the default schema is the replication administrator's schema. Be sure to specify the schema if it is other than the replication administrator's schema. This procedure is overloaded. The MASTER_LIST
and MASTER_TABLE
parameters are mutually exclusive.
This procedure generates the triggers and packages needed to support replication. You must call this procedure from the master definition site.
DBMS_REPCAT.GENERATE_REPLICATION_SUPPORT ( sname IN VARCHAR2, oname IN VARCHAR2, type IN VARCHAR2, package_prefix IN VARCHAR2 := NULL, procedure_prefix IN VARCHAR2 := NULL, distributed IN BOOLEAN := TRUE, gen_objs_owner IN VARCHAR2 := NULL, min_communication IN BOOLEAN := TRUE, generate_80_compatible IN BOOLEAN := TRUE);
Parameter | Description |
---|---|
sname |
Schema in which the object is located. |
oname |
Name of the object for which you are generating replication support. |
type |
Type of the object. The types supported are: |
package_prefix |
For objects of type |
procedure_prefix |
For objects of type |
distributed |
This must be set to |
gen_objs_owner |
For objects of type |
min_communication |
Set to |
generate_80_ compatible |
Set to |
This procedure activates triggers and generate packages needed to support the replication of updatable snapshots or procedural replication.You must call this procedure from the snapshot site.
DBMS_REPCAT.GENERATE_SNAPSHOT_SUPPORT ( sname IN VARCHAR2, oname IN VARCHAR2, type IN VARCHAR2, gen_objs_owner IN VARCHAR2 := '', min_communication IN BOOLEAN := TRUE, generate_80_compatible IN BOOLEAN := TRUE);
CREATE_SNAPSHOT_REPOBJECT
automatically generates snapshot support for updatable snapshots.
This procedure creates a new column group with one or more members. You must call this procedure from the master definition site.
For more information, see "Conflict Resolution" in the Oracle8i Replication manual.
DBMS_REPCAT.MAKE_COLUMN_GROUP ( sname IN VARCHAR2, oname IN VARCHAR2, column_group IN VARCHAR2, list_of_column_names IN VARCHAR2 | DBMS_REPCAT.VARCHAR2S);
This procedure removes local messages in the RepCatLog
associated with a given identification number, source, or replicated master group.
DBMS_REPCAT.PURGE_MASTER_LOG ( id IN NATURAL, source IN VARCHAR2, gname IN VARCHAR2);
Exception | Description |
---|---|
nonmaster |
|
This procedure removes information from the RepResolution_Statistics
view.
DBMS_REPCAT.PURGE_STATISTICS ( sname IN VARCHAR2, oname IN VARCHAR2, start_date IN DATE, end_date IN DATE);
Exception | Description |
---|---|
missingschema |
Given schema does not exist. |
missingobject |
Given table does not exist. |
statnotreg |
Table not registered to collect statistics. |
This procedure refreshes a snapshot site object group with the most recent data from its associated master site.
DBMS_REPCAT.REFRESH_SNAPSHOT_REPGROUP ( gname IN VARCHAR2, drop_missing_contents IN BOOLEAN := FALSE, refresh_snapshots IN BOOLEAN := FALSE, refresh_other_objects IN BOOLEAN := FALSE);
This procedure facilitates the administration of snapshots at their respective master sites by inserting/modifying/deleting from registered_snapshot_groups
.
DBMS_REPCAT.REGISTER_SNAPSHOT_REPGROUP ( gname IN VARCHAR2, snapsite IN VARCHAR2, comment IN VARCHAR2 := NULL, rep_type IN NUMBER := reg_unknown, fname IN VARCHAR2 := NULL);
This procedure collects information about the successful resolution of update, delete, and uniqueness conflicts for a table.
DBMS_REPCAT.REGISTER_STATISTICS ( sname IN VARCHAR2, oname IN VARCHAR2);
Parameter | Description |
---|---|
sname |
Name of the schema in which the table is located. |
oname |
Name of the table for which you want to gather conflict resolution statistics. |
Exception | Description |
---|---|
missingschema |
Given schema does not exist. |
missingobject |
Given table does not exist. |
This procedure changes your master definition site to another master site in your replicated environment.
DBMS_REPCAT.RELOCATE_MASTERDEF ( gname IN VARCHAR2, old_masterdef IN VARCHAR2, new_masterdef IN VARCHAR2, notify_masters IN BOOLEAN := TRUE, include_old_masterdef IN BOOLEAN := TRUE, require_flavor_change IN BOOLEAN := FALSE);
It is not necessary for either the old or new master definition site to be available when you call RELOCATE_MASTERDEF
. In a planned reconfiguration, you should invoke RELOCATE_MASTERDEF
with NOTIFY_MASTERS
TRUE
and INCLUDE_OLD_MASTERDEF
TRUE
.
If just the master definition site fails, then you should invoke RELOCATE_MASTERDEF
with NOTIFY_MASTERS
TRUE
and INCLUDE_OLD_MASTERDEF
FALSE
. If several master sites and the master definition site fail, then the administrator should invoke RELOCATE_MASTERDEF
at each operational master with NOTIFY_MASTERS
FALSE
.
This procedure removes one or more master databases from a replicated environment. This procedure regenerates the triggers and their associated packages at the remaining master sites. You must call this procedure from the master definition site.
DBMS_REPCAT.REMOVE_MASTER_DATABASES ( gname IN VARCHAR2, master_list IN VARCHAR2 | master_table IN DBMS_UTILITY.DBLINK_ARRAY);
This procedure ensures that the objects in the replicated master group have the appropriate object identifiers and status values after you perform an export/import of a replicated object or an object used by the advanced replication facility.
DBMS_REPCAT.REPCAT_IMPORT_CHECK ( gname IN VARCHAR2, master IN BOOLEAN);
This procedure resumes normal replication activity after quiescing a replicated environment.
DBMS_REPCAT.RESUME_MASTER_ACTIVITY ( gname IN VARCHAR2, override IN BOOLEAN := FALSE);
You have the option of sending old column values for each non-key column of a replicated table for updates and deletes. The default is to send old values for all columns. You can change this behavior at all master and snapshot sites by invoking DBMS_REPCAT
.SEND_OLD_VALUES
at the master definition site.
DBMS_REPCAT.SEND_OLD_VALUES( sname IN VARCHAR2, oname IN VARCHAR2, { column_list IN VARCHAR2, | column_table IN DBMS_REPCAT.VARCHAR2s,} operation IN VARCHAR2 := `UPDATE', send IN BOOLEAN := TRUE );
Note:
The Read "Minimizing Data Propagation for Update Conflict Resolution" in the Oracle8i Replication manual before changing the default behavior of Oracle. |
To use an alternate column or group of columns, instead of the primary key, to determine which columns of a table to compare when using row-level replication. You must call this procedure from the master definition site.
See "Using Multimaster Replication" in the Oracle8i Replication manual
DBMS_REPCAT.SET_COLUMNS ( sname IN VARCHAR2, oname IN VARCHAR2, { column_list IN VARCHAR2 | column_table IN DBMS_UTILITY.NAME_ARRAY } );
This procedure suspends replication activity for an object group. You must call this procedure from the master definition site.
DBMS_REPCAT.SUSPEND_MASTER_ACTIVITY ( gname IN VARCHAR2);
Parameter | Description |
---|---|
gname |
Name of the object group for which you want to suspend activity. |
The current implementation of SUSPEND_MASTER_ACTIVITY
quiesces all replicated master groups at each master site.
This procedure changes the master database of a snapshot replicated master group to another master site. This procedure does a full refresh of the affected snapshots and regenerates the triggers and their associated packages as needed. This procedure does not push the queue to the old master site before changing masters.
DBMS_REPCAT.SWITCH_SNAPSHOT_MASTER ( gname IN VARCHAR2, master IN VARCHAR2);
Parameter | Description |
---|---|
gname |
Name of the snapshot object group for which you want to change master sites. |
master |
Fully qualified database name of the new master database to use for the snapshot site. |
Exception | Description |
---|---|
nonsnapshot |
Invocation site is not a snapshot site. |
nonmaster |
Given database is not a master site. |
commfailure |
Given database is not accessible. |
This procedure facilitates the administration of snapshots at their respective master sites by inserting/modifying/deleting from registered_snapshot_groups
.
DBMS_REPCAT.UNREGISTER_SNAPSHOT_REPGROUP ( gname IN VARCHAR2, snapsite IN VARCHAR2);
Parameter | Description |
---|---|
gname |
Name of the snapshot object group to be unregistered. |
snapsite |
Global name of the snapshot site. |
This function validates the correctness of key conditions of a multiple master replication environment. This is overloaded.
DBMS_REPCAT.VALIDATE ( gname IN VARCHAR2, check_genflags IN BOOLEAN := FALSE, check_valid_objs IN BOOLEAN := FALSE, check_links_sched IN BOOLEAN := FALSE, check_links IN BOOLEAN := FALSE, error_table OUT dbms_repcat.validate_err_table ) RETURN BINARY_INTEGER; DBMS_REPCAT.VALIDATE ( gname IN VARCHAR2, check_genflags IN BOOLEAN := FALSE, check_valid_objs IN BOOLEAN := FALSE, check_links_sched IN BOOLEAN := FALSE, check_links IN BOOLEAN := FALSE, error_msg_table OUT DBMS_UTILITY.UNCL_ARRAY, error_num_table OUT DBMS_UTILITY.NUMBER_ARRAY ) RETURN BINARY_INTEGER;
The return value of VALIDATE
is the number of errors found. The function's OUT
parameter(s) returns any errors that are found. In the first interface function, the ERROR_TABLE
consists of an array of records. Each record has a VARCHAR2
and a NUMBER
in it. The string field contains the error message and the number field contains the Oracle error number.
The second interface is similar except that there are two OUT
arrays. A VARCHAR2
array with the error messages and a NUMBER
array with the error numbers.
This procedure determines whether changes that were asynchronously propagated to a master site have been applied.
DBMS_REPCAT.WAIT_MASTER_LOG ( gname IN VARCHAR2, record_count IN NATURAL, timeout IN NATURAL, true_count OUT NATURAL);
Exception | Description |
---|---|
nonmaster |
Invocation site is not a master site. |
Subprogram | Description |
---|---|
GRANT_ADMIN_ANY_ SCHEMA procedure |
Grants the necessary privileges to the replication administrator to administer any replicated master group at the current site. |
GRANT_ADMIN_SCHEMA procedure |
Grants the necessary privileges to the replication administrator to administer a schema at the current site. |
REGISTER_USER_ REPGROUP procedure |
Assigns proxy snapshot administrator or receiver privileges at the master site for use with remote sites. |
REVOKE_ADMIN_ANY_ SCHEMA procedure |
Revokes the privileges and roles from the replication administrator that would be granted by |
REVOKE_ADMIN_SCHEMA procedure |
Revokes the privileges and roles from the replication administrator that would be granted by |
UNREGISTER_USER_ REPGROUP procedure |
Revokes the privileges and roles from the proxy snapshot administrator or receiver that would be granted by the |
This procedure grants the necessary privileges to the replication administrator to administer any replicated master group at the current site.
DBMS_REPCAT_ADMIN.GRANT_ADMIN_ANY_SCHEMA ( username IN VARCHAR2);
Parameter | Description |
---|---|
username |
Name of the replication administrator to whom you want to grant the necessary privileges and roles to administer any replicated master groups at the current site. |
Exception | Description |
---|---|
ORA-01917 |
User does not exist. |
This procedure grants the necessary privileges to the replication administrator to administer a schema at the current site. This procedure is most useful if your object group does not span schemas.
DBMS_REPCAT_ADMIN.GRANT_ADMIN_SCHEMA ( username IN VARCHAR2);
Exception | Description |
---|---|
ORA-01917 |
User does not exist. |
This procedure assigns proxy snapshot administrator or receiver privileges at the master site for use with remote sites. This procedure grants only the necessary privileges to the proxy snapshot administrator or receiver, avoiding having to grant the powerful privileges granted by the GRANT_ADMIN_SCHEMA
or GRANT_ADMIN_ANY_SCHEMA
procedures.
See "Advanced Techniques" in the Oracle8i Replication manual for more information on trusted versus untrusted security models.
DBMS_REPCAT_ADMIN.REGISTER_USER_REPGROUP ( username IN VARCHAR2, privilege_type IN VARCHAR2, list_of_gnames IN VARCHAR2 | table_of_gnames IN dbms_utility.name_array);
Exception | Description |
---|---|
nonmaster |
Specified object group does not exist or the invocation database is not a master. |
ORA-01917 |
User does not exist. |
typefailure |
Incorrect privilege type was specified. |
This procedure revokes the privileges and roles from the replication administrator that would be granted by GRANT_ADMIN_ANY_SCHEMA
.
DBMS_REPCAT_ADMIN.REVOKE_ADMIN_ANY_SCHEMA ( username IN VARCHAR2);
Parameter | Description |
---|---|
username |
Name of the replication administrator whose privileges you want to revoke. |
Exception | Description |
---|---|
ORA-01917 |
User does not exist. |
This procedure revokes the privileges and roles from the replication administrator that would be granted by GRANT_ADMIN_SCHEMA
.
DBMS_REPCAT_ADMIN.REVOKE_ADMIN_SCHEMA ( username IN VARCHAR2);
Parameter | Description |
---|---|
username |
Name of the replication administrator whose privileges you want to revoke. |
Exception | Description |
---|---|
ORA-01917 |
User does not exist. |
This procedure revokes the privileges and roles from the proxy snapshot administrator or receiver that would be granted by the REGISTER_USER_REPGROUP
procedure.
DBMS_REPCAT_ADMIN.UNREGISTER_USER_REPGROUP ( username IN VARCHAR2, privilege_type IN VARCHAR2, list_of_gnames IN VARCHAR2 | table_of_gnames IN dbms_utility.name_array);
Exception | Description |
---|---|
nonmaster |
Specified object group does not exist or the invocation database is not a master. |
ORA-01917 |
User does not exist. |
typefailure |
Incorrect privilege type was specified. |
Subprogram | Description |
---|---|
DROP_SITE_INSTANTIATION procedure |
Public procedure that removes the target site from the |
INSTANTIATE_OFFLINE procedure |
Public procedure that generates a script at the master site that is used to create the snapshot environment at the remote snapshot site while offline. |
INSTANTIATE_ONLINE procedure |
Public procedure that generates a script at the master site that is used to create the snapshot environment at the remote snapshot site while online. |
This procedure drops a template instantiation at a target site. This procedure removes all related meta data at the master site and disables the specified site from refreshing their snapshots. You need to execute this procedure as the user that originally instantiated the template (to see who instantiated the template, query the REPCAT_TEMPLATE_SITES View, which is described.
The parameter for the DROP_SITE_INSTANTIATION procedure is described in Table 8-216:
DBMS_REPCAT_INSTANTIATE.DROP_SITE_INSTANTIATION( refresh_template_name IN VARCHAR2, site_name IN VARCHAR2, repapi_site_id IN NUMBER := -1e-130)
This function generates a script at the master site that is used to create the snapshot environment at the remote snapshot site while offline. This generated script should be used at remote snapshot sites that are NOT able to remain connected to the master site for an extended amount of time. This is an ideal solution where the remote snapshot site is a laptop. Use the packaging tool in Replication Manager to package the generated script and data into a single file, that can be posted on an FTP site or loaded to a CD-ROM, floppy disk, etc. See "Deploying Template" in the Oracle8i Replication manual for more information.
The script generated by this function is stored in the USER_REPCAT_TEMP_OUTPUT temporary view and is used by several Oracle tools, including Replication Manager, during the distribution of deployment templates. The number returned by this function is used to retrieve the appropriate information from the USER_REPCAT_TEMP_OUTPUT view.
The user that executes this public procedure will become the "registered" user of the instantiated template at the specified site.
The parameter for the INSTANTIATE_OFFLINE function is described in Table 8-217, and the exception is described in Table 8-218. The syntax for this function is shown below:
DBMS_REPCAT_INSTANTIATE.INSTANTIATE_OFFLINE( refresh_template_name IN VARCHAR2, site_name IN VARCHAR2, runtime_parm_id IN NUMBER := -1e-130, next_date IN DATE := SYSDATE, interval IN VARCHAR2 :'SYSDATe + 1') return NUMBER
This function generates a script at the master site that is used to create the snapshot environment at the remote snapshot site while online. This generated script should be used at remote snapshot sites that are able to remain connected to the master site for an extended amount of time, as the instantiation process at the remote snapshot site may be lengthy (depending on the amount of data that is populated to the new snapshots).
The script generated by this function is stored in the USER_REPCAT_TEMP_OUTPUT temporary view and is used by several Oracle tools, Replication Manager, during the distribution of deployment templates. The number returned by this function is used to retrieve the appropriate information from the USER_REPCAT_TEMP_OUTPUT view.
The user that executes this public procedure will become the "registered" user of the instantiated template at the specified site.
The parameter for the INSTANTIATE_ONLINE function is described in Table 8-220, and the exception is described in Table 8-221. The syntax for this function is shown below:
DBMS_REPCAT_INSTANTIATE.INSTANTIATE_ONLINE( refresh_template_name IN VARCHAR2, site_name IN VARCHAR2, runtime_parm_id IN NUMBER := -1e-130, next_date IN DATE := SYSDATE, interval IN VARCHAR2 :'SYSDATe + 1') return NUMBER
Subprogram | Description |
---|---|
ALTER_REFRESH_TEMPLATE procedure |
Allows the DBA to alter existing deployment templates. |
ALTER_TEMPLATE_OBJECT procedure |
Alters objects that have been added to a specified deployment template. |
ALTER_TEMPLATE_PARM procedure |
Allows the DBA to alter the parameters for a specific deployment template. |
ALTER_USER_AUTHORIZATION procedure |
Alters the contents of the |
ALTER_USER_PARM_VALUE procedure |
Changes existing parameter values that have been defined for a specific user. |
COMPARE_TEMPLATES function |
Allows a DBA to compare the contents of two deployment templates. |
COPY_TEMPLATE function |
Allows the DBA to copy a deployment template. |
CREATE_OBJECT_FROM_ EXISTING function |
Creates a template object definition from existing database objects and adds it to a target deployment template. |
CREATE_REFRESH_TEMPLATE function |
Creates the deployment template, which allows you to define the template name, private/public status, and target refresh group. |
CREATE_TEMPLATE_OBJECT function |
Adds object definitions to a target deployment template container. |
CREATE_TEMPLATE_PARM function |
Creates parameters for a specific deployment template to allow custom data sets to be created at the remote snapshot site. |
CREATE_USER_AUTHORIZATION function |
Authorizes specific users to instantiate private deployment templates. |
CREATE_USER_PARM_VALUE function |
Pre-defines deployment template parameter values for specific users. |
DELETE_RUNTIME_PARMS procedure |
Deletes a runtime parameter value that you defined using the |
DROP_ALL_OBJECTS procedure |
Allows the DBA to drop all objects or specific object types from a deployment template. |
DROP_ALL_TEMPLATE_PARMS procedure |
Allows the DBA to drop template parameters for a specified deployment template. |
DROP_ALL_TEMPLATE_SITES procedure |
Removes all entries from the |
DROP_ALL_TEMPLATES procedure |
Removes all deployment templates at the site where the procedure is called. |
DROP_ALL_USER_ AUTHORIZATIONS procedure |
Allows the DBA to drop all user authorizations for a specified deployment template. |
DROP_ALL_USER_PARM_VALUES procedure |
Drops user parameter values for a specific deployment template. |
DROP_REFRESH_TEMPLATE procedure |
Drops a deployment template. |
DROP_SITE_INSTANTIATION procedure |
Removes the target site from the |
DROP_TEMPLATE_OBJECT procedure |
Removes a template object from a specific deployment template. |
DROP_TEMPLATE_PARM procedure |
Removes an existing template parameter from the |
DROP_USER_AUTHORIZATION procedure |
Removes a user authorization entry from the |
DROP_USER_PARM_VALUE procedure |
Removes a pre-defined user parameter value for a specific deployment template. |
GET_RUNTIME_PARM_ID function |
Retrieves an ID to be used when defining a runtime parameter value. |
INSERT_RUNTIME_PARMS procedure |
Defines runtime parameter values prior to instantiating a template. |
INSTANTIATE_OFFLINE function |
Generates a script at the master site that is used to create the snapshot environment at the remote snapshot site while offline. |
INSTANTIATE_ONLINE function |
Generates a script at the master site that is used to create the snapshot environment at the remote snapshot site while online. |
LOCK_TEMPLATE_EXCLUSIVE procedure |
Prevents users from reading or instantiating the template when a deployment template is being updated or modified. |
LOCK_TEMPLATE_SHARED procedure |
Makes a specified deployment template read-only. |
This procedure allows the DBA to alter existing deployment templates. Alterations may include defining a new deployment template name, a new refresh group, or a new owner and changing the public/private status.
DBMS_REPCAT_RGT.ALTER_REFRESH_TEMPLATE ( refresh_template_name IN VARCHAR2, new_owner IN VARCHAR2 := '-', new_refresh_group_name IN VARCHAR2 := '-', new_refresh_template_name IN VARCHAR2 := '-', new_template_comment IN VARCHAR2 := '-', new_public_template IN VARCHAR2 := '-', new_last_modified IN DATE := to_date('1', 'J'), new_modified_by IN NUMBER := -1e-130);
This procedure alters objects that have been added to a specified deployment template. The most common changes may include altering the object DDL and/or assigning the object to a different deployment template.
Changes made to the template is reflected only at new sites instantiating the deployment template. Remote sites that have already instantiated the template need to re-instantiate the deployment template to apply the changes.
DBMS_REPCAT_RGT.ALTER_TEMPLATE_OBJECT ( refresh_template_name IN VARCHAR2, object_name IN VARCHAR2, object_type IN VARCHAR2, new_refresh_template_name IN VARCHAR2 := '-', new_object_name IN VARCHAR2 := '-', new_object_type IN VARCHAR2 := '-', new_ddl_text IN CLOB := '-', new_master_rollback_seg IN VARCHAR2 := '-', new_flavor_id IN NUMBER := -1e-130);
Exception | Description |
---|---|
miss_refresh_ template |
Deployment template name specified is invalid or does not exist. |
miss_flavor_id |
Flavor ID specified is invalid or does not exist. |
bad_object_type |
Object type is specified incorrectly. See Table 8-226 for a list of valid object types. |
miss_template_object |
Template object name specified is invalid or does not exist. |
dupl_template_object |
New template name specified in the new_refresh_template_name parameter already exists. |
Because the ALTER_TEMPLATE_OBJECT
procedure utilizes a CLOB
, you need to utilize the DBMS_LOB
package when using the ALTER_TEMPLATE_OBJECT
procedure. The following example illustrates how to use the DBMS_LOB
package with the ALTER_TEMPLATE_OBJECT
procedure:
DECLARE tempstring VARCHAR2(100); templob CLOB; BEGIN DBMS_LOB.CREATETEMPORARY(templob, TRUE, DBMS_LOB.SESSION); tempstring := 'CREATE SNAPSHOT snap_sales AS SELECT * FROM sales WHERE salesperson = :salesid and region_id = :region'; DBMS_LOB.WRITE(templob, length(tempstring), 1, tempstring); DBMS_REPCAT_RGT.ALTER_TEMPLATE_OBJECT( refresh_template_name => 'rgt_personnel', object_name => 'SNAP_SALES', object_type => 'SNAPSHOT', new_ddl_text => templob); DBMS_LOB.FREETEMPORARY(templob); END; /
This procedure allows the DBA to alter the parameters for a specific deployment template. Alterations may include renaming the parameter or redefining the default value and prompt string.
DBMS_REPCAT_RGT.ALTER_TEMPLATE_PARM ( refresh_template_name IN VARCHAR2, parameter_name IN VARCHAR2, new_refresh_template_name IN VARCHAR2 := '-', new_parameter_name IN VARCHAR2 := '-', new_default_parm_value IN CLOB := NULL, new_prompt_string IN VARCHAR2 := '-', new_user_override IN VARCHAR2 := '-');
Because the ALTER_TEMPLATE_PARM
procedure utilizes a CLOB
, you need to utilize the DBMS_LOB
package when using the ALTER_TEMPLATE_PARM
procedure. The following example illustrates how to use the DBMS_LOB
package with the ALTER_TEMPLATE_PARM
procedure:
DECLARE tempstring VARCHAR2(100); templob CLOB; BEGIN DBMS_LOB.CREATETEMPORARY(templob, TRUE, DBMS_LOB.SESSION); tempstring := 'REGION 20'; DBMS_LOB.WRITE(templob, length(tempstring), 1, tempstring); DBMS_REPCAT_RGT.ALTER_TEMPLATE_PARM( refresh_template_name => 'rgt_personnel', parameter_name => 'region', new_default_parm_value => templob); DBMS_LOB.FREETEMPORARY(templob); END; /
This procedure alters the contents of the DBA_REPCAT_TEMPLATE_AUTH
view. Specifically, you can change user/deployment template authorization assignments. This procedure is helpful, for example, if an employee moves positions and requires the snapshot environment of another deployment template; the DBA simply assigns the employee the new deployment template and the user is authorized to instantiate the target template.
DBMS_REPCAT_RGT.ALTER_USER_AUTHORIZATION ( user_name IN VARCHAR2, refresh_template_name IN VARCHAR2, new_user_name IN VARCHAR2 := '-', new_refresh_template_name IN VARCHAR2 := '-');
This procedure changes existing parameter values that have been defined for a specific user. This procedure is especially helpful if your snapshot environment uses assignment tables; simply change a user parameter value to quickly and securely change the data set of a remote snapshot site.
See "Deployment Template Design" in the Oracle8i Replication manual for more information on using assignment tables.
DBMS_REPCAT_RGT.ALTER_USER_PARM_VALUE( refresh_template_name IN VARCHAR2, parameter_name IN VARCHAR2, user_name IN VARCHAR2, new_refresh_template_name IN VARCHAR2 := '-', new_parameter_name IN VARCHAR2 := '-', new_user_name IN VARCHAR2 := '-', new_parm_value IN CLOB := NULL);
Because the ALTER_USER_PARM_VALUE
procedure utilizes a CLOB
, you need to utilize the DBMS_LOB
package when using the ALTER_USER_PARM_VALUE
procedure. The following example illustrates how to use the DBMS_LOB
package with the ALTER_USER_PARM_VALUE
procedure:
DECLARE tempstring VARCHAR2(100); templob CLOB; BEGIN DBMS_LOB.CREATETEMPORARY(templob, TRUE, DBMS_LOB.SESSION); tempstring := 'REGION 20'; DBMS_LOB.WRITE(templob, length(tempstring), 1, tempstring); DBMS_REPCAT_RGT.ALTER_USER_PARM_VALUE( refresh_template_name => 'rgt_personnel', parameter_name => 'region', user_name => 'BOB', new_parm_value => templob); DBMS_LOB.FREETEMPORARY(templob); END; /
This function allows a DBA to compare the contents of two deployment templates. Any discrepancies between the two deployment templates is stored in the USER_REPCAT_TEMP_OUTPUT
table.
The COMPARE_TEMPLATES
function returns a number that you specify in the WHERE
clause when querying the USER_REPCAT_TEMP_OUTPUT
table. For example, if the COMPARE_TEMPLATES
procedure returns the number 10, you would execute the following SELECT
statement to view all discrepancies between two specified templates (your SELECT
statement returns no rows if the templates are identical):
SELECT text FROM USER_REPCAT_TEMP_OUTPUT
WHERE output_id = 10 ORDER BY LINE;
The contents of the USER_REPCAT_TEMP_OUTPUT
are lost after you disconnect or a ROLLBACK
has been performed.
DBMS_REPCAT_RGT.COMPARE_TEMPLATES ( source_template_name IN VARCHAR2, compare_template_name IN VARCHAR2) return NUMBER;
Parameter | Description |
---|---|
source_template_name |
Name of the first deployment template to be compared. |
compare_template_ name |
Name of the second deployment template to be compared. |
Exception | Description |
---|---|
miss_refresh_ template |
The deployment template name to be compared is invalid or does not exist. |
This function allows the DBA to copy a deployment template. COPY_TEMPLATE
is helpful when a new deployment template will use many of the object contained in an existing deployment template. This function copies the deployment template, template objects, template parameters, and user parameter values. The DBA can optionally have the function copy the user authorizations for this template. The number returned by this function is used internally by Oracle to manage deployment templates.
This function also allows the DBA to copy a deployment template to another master site, which is helpful for deployment template distribution and to split network loads between multiple sites.
DBMS_REPCAT_RGT.COPY_TEMPLATE ( old_refresh_template_name IN VARCHAR2, new_refresh_template_name IN VARCHAR2, copy_user_authorizations IN VARCHAR2, dblink IN VARCHAR2 := NULL) return NUMBER;
Return Value | Description |
---|---|
<system generated number> |
System generated number is used internally by Oracle. |
This function creates a template object definition from existing database objects and adds it to a target deployment template. The object DDL that created the original database object is executed when the target deployment template is instantiated at the remote snapshot site. This is ideal for adding existing triggers and procedures to your template. The number returned by this function is used internally by Oracle to manage deployment templates.
DBMS_REPCAT_RGT.CREATE_OBJECT_FROM_EXISTING( refresh_template_name IN VARCHAR2, object_name IN VARCHAR2, sname IN VARCHAR2, oname IN VARCHAR2, otype IN VARCHAR2) return NUMBER
Exception | Description |
---|---|
miss_refresh_ template |
The specified refresh template name is invalid or missing. Query the |
bad_object_type |
The object type is specified incorrectly (see Table 8-246 for more information). |
dupl_template_object |
An object of the same name and type has already been added to the specified deployment template. |
objectmissing |
Existing object specified does not exist. |
Return Value | Description |
---|---|
<system generated number> |
System generated number is used internally by Oracle. |
This function creates the deployment template, which allows you to define the template name, private/public status, and target refresh group. Each time that you create a template object, user authorization, or template parameter, you reference the deployment template created with this function. This function adds a row to the DBA_REPCAT_REFRESH_TEMPLATES
view. The number returned by this function is used internally by Oracle to manage deployment templates.
DBMS_REPCAT_RGT.CREATE_REFRESH_TEMPLATE ( owner IN VARCHAR2, refresh_group_name IN VARCHAR2, refresh_template_name IN VARCHAR2, template_comment IN VARCHAR2 := NULL, public_template IN VARCHAR2 := NULL, last_modified IN DATE := SYSDATE, modified_by IN VARCHAR2 := USER, creation_date IN DATE := SYSDATE, created_by IN VARCHAR2 := USER) return NUMBER;
Return Value | Description |
---|---|
<system generated number> |
System generated number is used internally by Oracle. |
This function adds object definitions to a target deployment template container. The specified object DDL is executed when the target deployment template is instantiated at the remote snapshot site. In addition to adding snapshots, this function can add tables, procedures, and other objects to your template. The number returned by this function is used internally by Oracle to manage deployment templates.
DBMS_REPCAT_RGT.CREATE_TEMPLATE_OBJECT ( refresh_template_name IN VARCHAR2, object_name IN VARCHAR2, object_type IN VARCHAR2, ddl_text IN CLOB, master_rollback_seg IN VARCHAR2 := NULL, flavor_id IN NUMBER := -1e-130) return NUMBER;
Parameter | Description |
---|---|
refresh_template_ name |
Name of the deployment template that you want to add this object to. |
object_name |
Name of the template object that you are creating. |
object_type |
The type of database object that you are adding to the template (i.e.,
|
ddl_text |
Contains the DDL that creates the object that you are adding to the template. Be sure to end your DDL with a semi-colon. (Remember, you can use a colon (:) to create a template parameter for your template object; see "Creating Snapshots with Deployment Templates" in the Oracle8i Replication book for more information. |
master_rollback_seg |
Specifies the name of the rollback segment to use when executing the defined object DDL at the remote snapshot site. |
flavor_id |
Defines the flavor ID for this template object. |
Exception | Description |
---|---|
miss_refresh_ template |
Specified refresh template name is invalid or missing. Query the |
bad_object_type |
Object type is specified incorrectly. See Table 8-246 for a list of valid object types. |
dupl_template_object |
An object of the same name and type has already been added to the specified deployment template. |
Return Value | Description |
---|---|
<system generated number> |
System generated number is used internally by Oracle. |
Because CREATE_TEMPLATE_OBJECT
utilizes a CLOB
, you need to utilize the DBMS_LOB
package when using the CREATE_TEMPLATE_OBJECT
function. The following example illustrates how to use the DBMS_LOB
package with the CREATE_TEMPLATE_OBJECT
function:
DECLARE tempstring VARCHAR2(100); templob CLOB; a NUMBER; BEGIN DBMS_LOB.CREATETEMPORARY(templob, TRUE, DBMS_LOB.SESSION); tempstring := 'CREATE SNAPSHOT snap_sales AS SELECT * FROM sales WHERE salesperson = :salesid'; DBMS_LOB.WRITE(templob, length(tempstring), 1, tempstring); a := DBMS_REPCAT_RGT.CREATE_TEMPLATE_OBJECT( refresh_template_name => 'rgt_personnel', object_name => 'snap_sales', object_type => 'SNAPSHOT', ddl_text => templob, master_rollback_seg => 'RBS'); DBMS_LOB.FREETEMPORARY(templob); END; /
This function creates parameters for a specific deployment template to allow custom data sets to be created at the remote snapshot site. This function is only required when the DBA wants to define a set of template variables before adding any template objects (when objects are added to the template using the CREATE_TEMPLATE_OBJECT
function, any variables in the object DDL are automatically added to the DBA_REPCAT_TEMPLATE_PARMS
view).
The DBA typically uses the ALTER_TEMPLATE_PARM
function to modify the default parameter values and/or prompt strings (see ALTER_TEMPLATE_PARM procedure on page for more information). The number returned by this function is used internally by Oracle to manage deployment templates.
DBMS_REPCAT_RGT.CREATE_TEMPLATE_PARM ( refresh_template_name IN VARCHAR2, parameter_name IN VARCHAR2, default_parm_value IN CLOB := NULL, prompt_string IN VARCHAR2 := NULL, user_override IN VARCHAR2 := NULL) return NUMBER;
Return Value | Description |
---|---|
<system generated number> |
System generated number is used internally by Oracle. |
Because the CREATE_TEMPLATE_PARM
function utilizes a CLOB
, you need to utilize the DBMS_LOB
package when using the CREATE_TEMPLATE_PARM
function. The following example illustrates how to use the DBMS_LOB
package with the CREATE_TEMPLATE_PARM
function:
DECLARE tempstring VARCHAR2(100); templob CLOB; a NUMBER; BEGIN DBMS_LOB.CREATETEMPORARY(templob, TRUE, DBMS_LOB.SESSION); tempstring := 'REGION 20'; DBMS_LOB.WRITE(templob, length(tempstring), 1, tempstring); a := DBMS_REPCAT_RGT.CREATE_TEMPLATE_PARM( refresh_template_name => 'rgt_personnel', parameter_name => 'region', default_parm_value => templob, prompt_string => 'Enter your region ID:', user_override => 'Y'); DBMS_LOB.FREETEMPORARY(templob); END; /
This function authorizes specific users to instantiate private deployment templates. Users not authorized for a private deployment template are not able to instantiate the private template. This function adds a row to the DBA_REPCAT_AUTH_TEMPLATES
view.
Before you authorize a user, verify that the user exists at the master site where the user will instantiate the deployment template. The number returned by this function is used internally by Oracle to manage deployment templates.
DBMS_REPCAT_RGT.CREATE_USER_AUTHORIZATION ( user_name IN VARCHAR2, refresh_template_name IN VARCHAR2) return NUMBER;
Return Value | Description |
---|---|
<system generated number> |
System generated number is used internally by Oracle. |
This function is used to pre-define deployment template parameter values for specific users. For example, if you want to pre-defined the region parameter as WEST
for user 33456, then you would use the this function.
Any values specified with this function take precedence over default values specified for the template parameter. The number returned by this function is used internally by Oracle to manage deployment templates.
DBMS_REPCAT_RGT.CREATE_USER_PARM_VALUE ( refresh_template_name IN VARCHAR2, parameter_name IN VARCHAR2, user_name IN VARCHAR2, parm_value IN CLOB := NULL) return NUMBER;
Return Value | Description |
---|---|
<system generated number> |
System generated number is used internally by Oracle. |
Because the CREATE_USER_PARM_VALUE
function utilizes a CLOB
, you need to utilize the DBMS_LOB
package when using the this function. The following example illustrates how to use the DBMS_LOB
package with the CREATE_USER_PARM_VALUE
function:
DECLARE tempstring VARCHAR2(100); templob CLOB; a NUMBER; BEGIN DBMS_LOB.CREATETEMPORARY(templob, TRUE, DBMS_LOB.SESSION); tempstring := 'REGION 20'; DBMS_LOB.WRITE(templob, length(tempstring), 1, tempstring); a := DBMS_REPCAT_RGT.CREATE_USER_PARM_VALUE( refresh_template_name => 'rgt_personnel', parameter_name => 'region', user_name => 'BOB', user_parm_value => templob); DBMS_LOB.FREETEMPORARY(templob); END; /
Use this procedure before instantiating a deployment template to delete a runtime parameter value that you defined using the INSERT_RUNTIME_PARMS
procedure.
DBMS_REPCAT_RGT.DELETE_RUNTIME_PARMS( runtime_parm_id IN NUMBER, parameter_name IN VARCHAR2);
Exception | Description |
---|---|
miss_template_parm |
The specified deployment template parameter name is invalid or missing. |
This procedure allows the DBA to drop all objects or specific object types from a deployment template.
DBMS_REPCAT_RGT.DROP_ALL_OBJECTS ( refresh_template_name IN VARCHAR2, object_type IN VARCHAR2 := NULL);
Exception | Description |
---|---|
miss_refresh_ template |
Specified deployment template name is invalid or does not exist. |
bad_object_type |
Object type is specified incorrectly. See Table 8-260 for a list of valid object types. |
This procedure allows the DBA to drop template parameters for a specified deployment template. The DBA can use this procedure to drop all parameters that are not referenced by a template objects or drop all objects that reference a parameter and the parameters themselves.
DBMS_REPCAT_RGT.DROP_ALL_TEMPLATE_PARMS ( refresh_template_name IN VARCHAR2, drop_objects IN VARCHAR2 := N);
Exception | Description |
---|---|
miss_refresh_ template |
Specified deployment template name is invalid or does not exist. |
This procedure removes all entries from the DBA_REPCAT_TEMPLATE_SITES
view, which keeps a record of sites that have instantiated a particular deployment template.
DBMS_REPCAT_RGT.DROP_ALL_TEMPLATE_SITES ( refresh_template_name IN VARCHAR2);
Parameter | Description |
---|---|
refresh_template_ name |
Name of the deployment template that contains the sites that you want to drop. |
Exception | Description |
---|---|
miss_refresh_ template |
Specified deployment template name is invalid or does not exist. |
This procedure removes all deployment templates at the site where the procedure is called.
DBMS_REPCAT_RGT.DROP_ALL_TEMPLATES;
None
This procedure allows the DBA to drop all user authorizations for a specified deployment template. Executing this procedure removes rows from the DBA_REPCAT_AUTH_TEMPLATES
view.
This procedure might be implemented after converting a private template to a public template and the user authorizations are no longer required.
DBMS_REPCAT_RGT.DROP_ALL_USER_AUTHORIZATIONS ( refresh_template_name IN VARCHAR2);
Parameter | Description |
---|---|
refresh_template_ name |
Name of the deployment template that contains the objects that you want to drop. |
Exception | Description |
---|---|
miss_refresh_ template |
Specified deployment template name is invalid or does not exist. |
This procedure drops user parameter values for a specific deployment template. This procedure is very flexible in allowing the DBA to define a set of user parameter values to be deleted. For example, defining the following parameters have the effect:
refresh_template_name
: drops all user parameters for the specified deployment template.
refresh_template_name
, user_name
: drops all of the specified user parameters for the specified deployment template.
refresh_template_name
, parameter_name
: drops all user parameter values for the specified deployment template parameter.
refresh_template_name
, parameter_name
, user_name
: drops the specified user's value for the specified deployment template parameter (equivalent to DROP_USER_PARM
).
DBMS_REPCAT_RGT.DROP_ALL_USER_PARMS ( refresh_template_name IN VARCHAR2, user_name IN VARCHAR2, parameter_name IN VARCHAR2);
This procedure drops a deployment template. Dropping a deployment template has a cascading effect, removing all related template parameters, user authorizations, template objects, and user parameters (this procedure does not drop template sites).
DBMS_REPCAT_RGT.DROP_REFRESH_TEMPLATE ( refresh_template_name IN VARCHAR2);
Parameter | Description |
---|---|
refresh_template_ name |
Name of the deployment template to be dropped. |
Exception | Description |
---|---|
miss_refresh_ template |
The deployment template name specified is invalid or does not exist. Query the |
This procedure drops a template instantiation at a target site. This procedure removes all related meta data at the master site and disables the specified site from refreshing their snapshots.
The parameter for the DROP_SITE_INSTANTIATION procedure is described in Table 8-270, and the exception is described in Table 8-271. The syntax for this procedure is shown below:
DBMS_REPCAT_RGT.DROP_SITE_INSTANTIATION ( refresh_template_name IN VARCHAR2, user_name IN VARCHAR2, site_name IN VARCHAR2, repapi_site_id IN NUMBER := -1e-130)
Parameter | Description |
---|---|
refresh_template_name |
The name of the deployment template to be dropped. |
user_name |
Enter the name of the user that originally instantiated the template at the remote snapshot site. Query the REPCAT_TEMPLATE_SITES view to see the users that instantiated templates (see the "REPCAT_TEMPLATE_SITES View" section for more information). |
site_name |
Identifies the Oracle server site where you want to drop the specified template instantiation (if you specify a SITE_NAME, do not specify a REPAPI_SITE_ID). |
repapi_site_id |
Identifies the REPAPI location where you want to drop the specified template instantiation (if you specify a REPAPI_SITE_ID, do not specify a SITE_NAME). |
This procedure removes a template object from a specific deployment template. For example, a DBA would use this procedure to remove an outdated snapshot from a deployment template. Changes made to the template are reflected at new sites instantiating the deployment template. Remote sites that have already instantiated the template need to re-instantiate the deployment template to apply the changes.
DBMS_REPCAT_RGT.DROP_TEMPLATE_OBJECT ( refresh_template_name IN VARCHAR2, object_name IN VARCHAR2, object_type IN VARCHAR2);
This procedure removes an existing template parameter from the DBA_REPCAT_TEMPLATE_PARMS
view. This procedure is helpful when you have dropped a template object and a particular parameter is no longer needed.
DBMS_REPCAT_RGT.DROP_TEMPLATE_PARM ( refresh_template_name IN VARCHAR2, parameter_name IN VARCHAR2);
Parameter | Description |
---|---|
refresh_template_ name |
The deployment template name that has the parameter that you want to drop |
parameter_name |
Name of the parameter that you want to drop. |
This procedure removes a user authorization entry from the DBA_REPCAT_TEMPLATE_AUTH
view. This procedure is used when removing a user's template authorization. If a user's authorization is removed, then the user is no longer able to instantiate the target deployment template.
See also DROP_ALL_USER_AUTHORIZATIONS procedure for additional information.
DBMS_REPCAT_RGT.DROP_USER_AUTHORIZATION ( refresh_template_name IN VARCHAR2, user_name IN VARCHAR2);
Parameter | Description |
---|---|
refresh_template_ name |
Name of the deployment template that the user's authorization is being removed from. |
user_name |
Name of the user whose authorization is being removed. |
This procedure removes a pre-defined user parameter value for a specific deployment template. This procedure is often executed after a user's template authorization has been removed.
DBMS_REPCAT_RGT.DROP_USER_PARM_VALUE ( refresh_template_name IN VARCHAR2, parameter_name IN VARCHAR2, user_name IN VARCHAR2);
This function retrieves an ID to be used when defining a runtime parameter value. All runtime parameter values are assigned to this ID and are also used during the instantiation process.
DBMS_REPCAT_RGT.GET_RUNTIME_PARM_ID RETURN NUMBER;
None
Return Value | Corresponding Datatype |
---|---|
<system generated number> |
Runtime parameter values are assigned to the system generated number and is also used during the instantiation process. |
This procedure defines runtime parameter values prior to instantiating a template. This procedure should be used to define parameter values when no user parameter values have been defined and you do not want to accept the default parameter values.
Before using the this procedure, be sure to execute the GET_RUNTIME_PARM_ID
function to retrieve a parameter ID to be used when inserting a runtime parameter. This ID is used for defining runtime parameter values and instantiating deployment template.
DBMS_REPCAT_RGT.INSERT_RUNTIME_PARMS ( runtime_parm_id IN NUMBER, parameter_name IN VARCHAR2, parameter_value IN CLOB);
Because the this procedure utilizes a CLOB
, you need to utilize the DBMS_LOB
package when using the INSERT_RUNTIME_PARMS
procedure. The following example illustrates how to use the DBMS_LOB
package with the INSERT_RUNTIME_PARMS
procedure:
DECLARE tempstring VARCHAR2(100); templob CLOB; BEGIN DBMS_LOB.CREATETEMPORARY(templob, TRUE, DBMS_LOB.SESSION); tempstring := 'REGION 20'; DBMS_LOB.WRITE(templob, length(tempstring), 1, tempstring); DBMS_REPCAT_RGT.INSERT_RUNTIME_PARMS( runtime_parm_id => 20, parameter_name => 'region', parameter_value => templob); DBMS_LOB.FREETEMPORARY(templob); END; /
This function generates a script at the master site that is used to create the snapshot environment at the remote snapshot site while offline. This generated script should be used at remote snapshot sites that are able to remain connected to the master site for an extended amount of time, as the instantiation process at the remote snapshot site may be lengthy (depending on the amount of data that is populated to the new snapshots). This procedure needs to be executed separately for each user instantiation.
The script generated by this function is stored in the USER_REPCAT_TEMP_OUTPUT temporary view and is used by several Oracle tools, including Replication Manager, during the distribution of deployment templates. The number returned by this function is used to retrieve the appropriate information from the USER_REPCAT_TEMP_OUTPUT view.
Note: This procedure is used in performing an offline instantiation of a deployment template. Additionally, this procedure is for replication administrators that are instantiating for another user. Users wanting to perform their own instantiation should use the public version of the "INSTANTIATE_OFFLINE procedure" function, described. This procedure should not be confused with the procedures in the DBMS_OFFLINE_OG package (used for performing an offline instantiation of a master table) or with the procedures in the DBMS_OFFLINE_SNAPSHOT package (used for performing an offline instantiation of a snapshot). See these respective packages for more information on their usage. |
DBMS_REPCAT_RGT.INSTANTIATE_OFFLINE( refresh_template_name IN VARCHAR2, site_name IN VARCHAR2, user_name IN VARCHAR2 := NULL, runtime_parm_id IN NUMBER := -1e-130, next_date IN DATE := SYSDATE, interval IN VARCHAR2 :'SYSDATE + 1') return NUMBER
This function generates a script at the master site that is used to create the snapshot environment at the remote snapshot site while online. This generated script should be used at remote snapshot sites that are able to remain connected to the master site for an extended amount of time, as the instantiation process at the remote snapshot site may be lengthy (depending on the amount of data that is populated to the new snapshots). This procedure needs to be executed separately for each user instantiation.
The script generated by this function is stored in the USER_REPCAT_TEMP_OUTPUT temporary view and is used by several Oracle tools, including Replication Manager, during the distribution of deployment templates. The number returned by this function is used to retrieve the appropriate information from the USER_REPCAT_TEMP_OUTPUT view.
Note: This procedure is for replication administrators that are instantiating for another user. Users wanting to perform their own instantiation should use the public version of the "INSTANTIATE_ONLINE procedure" function, described. |
DBMS_REPCAT_RGT.INSTANTIATE_ONLINE( refresh_template_name IN VARCHAR2, site_name IN VARCHAR2 := NULL, user_name IN VARCHAR2 := NULL, runtime_parm_id IN NUMBER := -1e-130, next_date IN DATE := SYSDATE, interval IN VARCHAR2 :'SYSDATe + 1') return NUMBER;
When a deployment template is being updated or modified, you should use the LOCK_TEMPLATE_EXCLUSIVE procedure to prevent users from reading or instantiating the template.
The lock will be released when a ROLLBACK or COMMIT is performed.
Note: This procedure should be executed before you make any modifications to your deployment template. |
The syntax for this procedure is shown below:
DBMS_REPCAT_RGT.LOCK_TEMPLATE_EXCLUSIVE()
The LOCK_TEMPLATE_SHARED procedure is used to make a specified deployment template "read-only." This procedure should be called before instantiating a template, as this will ensure that nobody can change the deployment template while it is being instantiated.
The lock will be released when a ROLLBACK or COMMIT is performed.
The syntax for this procedure is shown below:
DBMS_REPCAT_RGT.LOCK_TEMPLATE_SHARED()
Subprogram | Description |
---|---|
REPLICATION_OFF procedure |
modifies tables without replicating the modifications to any other sites in the replicated environment, or disables row-level replication when using procedural replication. |
REPLICATION_ON procedure |
Re-enables replication of changes after replication has been temporarily suspended. |
REPLICATION_IS_ON function |
Determines whether or not replication is running. |
FROM_REMOTE function |
Returns |
GLOBAL_NAME function |
Determines the global database name of the local database (the global name is the returned value). |
MAKE_INTERNAL_PKG procedure |
Synchronizes internal packages and tables in the replication catalog. This procedure is executed under the direction of Oracle Worldwide Support only. |
SYNC_UP_REP procedure |
Synchronizes internal triggers and tables/snapshots in the replication catalog. This procedure is executed under the direction of Oracle Worldwide Support only. |
This procedure modifies tables without replicating the modifications to any other sites in the replicated environment, or disables row-level replication when using procedural replication. In general, you should suspend replication activity for all master groups in your replicated environment before setting this flag.
DBMS_REPUTIL.REPLICATION_OFF;
None
This procedure re-enables replication of changes after replication has been temporarily suspended.
DBMS_REPUTIL.REPLICATION_ON;
None
This function determines whether or not replication is running. A returned value of TRUE
indicates that the generated replication triggers are enabled. FALSE
indicates that replication is disabled at the current site for the replicated master group.
The returning value of this function is set by calling the REPLICATION_ON
or REPLICATION_OFF
procedures in the DBMS_REPUTIL
package.
DBMS_REPUTIL.REPLICATION_IS_ON return BOOLEAN;
None
This function returns TRUE
at the beginning of procedures in the internal replication packages, and returns FALSE
at the end of these procedures. You may need to check this function if you have any triggers that could be fired as the result of an update by an internal package.
DBMS_REPUTIL.FROM_REMOTE return BOOLEAN;
None
This function determines the global database name of the local database (the global name is the returned value).
DBMS_REPUTIL.GLOBAL_NAME return VARCHAR2;
None
This procedure synchronizes the existence of an internal package with a table in the replication catalog. If the table has replication support, execute this procedure to create the internal package. If replication support does not exist, destroy any related internal package.
DBMS_REPUTIL.MAKE_INTERNAL_PKG ( canon_sname IN VARCHAR2 canon_oname IN VARCHAR2);
This procedure synchronizes the existence of an internal trigger with a table or snapshot in the replication catalog. If the table or snapshot has replication support, execute this procedure to create the internal replication trigger. If replication support does not exist, destroy any related internal trigger.
DBMS_REPUTIL.SYNC_UP_REP ( canon_sname IN VARCHAR2 canon_oname IN VARCHAR2);
Subprogram | Description |
---|---|
BEGIN_TABLE_REORGANIZATION procedure |
Performs a process to preserve snapshot data needed for refresh. |
END_TABLE_REORGANIZATION |
Ensures that the snapshot data for the master table is valid and that the master table is in the proper state. |
I_AM_A_REFRESH function |
Returns the value of the |
PURGE_DIRECT_LOAD_LOG procedure |
Purges rows from the direct loader log after they are no longer needed by any snapshots (used with data warehousing). |
PURGE_LOG procedure |
Purges rows from the snapshot log. |
PURGE_SNAPSHOT_FROM_LOG procedure |
Purges rows from the snapshot log. |
REFRESH procedure |
Consistently refreshes one or more snapshots that are not members of the same refresh group. |
REFRESH_ALL_MVIEWS procedure |
Refreshes all snapshots that have not been refreshed because the most recent bulk load to a dependent detail table. |
REFRESH_DEPENDENT procedure |
Refreshes all table-based snapshots that depend on a specified detail table or list of detail tables. |
REGISTER_SNAPSHOT procedure |
Enables the administration of individual snapshots. |
UNREGISTER_SNAPSHOT procedure |
Enables the administration of individual snapshots. Invoked at a master site to unregister a snapshot. |
This procedure performs a process to preserve snapshot data needed for refresh. It must be called before a master table is reorganized.
Additional Information: See "Administering a Replicated Environment" in the Oracle8i Replication manual.
DBMS_SNAPSHOT.BEGIN_TABLE_REORGANIZATION ( tabowner IN VARCHAR2 tabname IN VARCHAR2);
Parameter | Description |
---|---|
tabowner |
Owner of the table being reorganized. |
tabname |
Name of the table being reorganized. |
This procedure must be called after a master table is reorganized. It ensures that the snapshot data for the master table is valid and that the master table is in the proper state.
Additional Information: See "Administering a Replicated Environment" in the Oracle8i Replication manual.
DBMS_SNAPSHOT.END_TABLE_REORGANIZATION ( tabowner IN VARCHAR2 tabname IN VARCHAR2);
Parameter | Description |
---|---|
tabowner |
Owner of the table being reorganized. |
tabname |
Name of the table being reorganized. |
This function returns the value of the I_AM_REFRESH
package state.
DBMS_SNAPSHOT.I_AM_A_REFRESH RETURN BOOLEAN;
None
A return value of TRUE
indicates that all local replication triggers for snapshots are effectively disabled in this session because each replication trigger first checks this state. A return value of FALSE
indicates that these triggers are enabled.
This procedure remove entries from the direct loader log after they are no longer needed for any known snapshot (materialized view). This procedure will usually be used in environments using Oracle's Data Warehousing technology. For more information, see Oracle8i Tuning.
DBMS_SNAPSHOT.PURGE_DIRECT_LOAD_LOG ();
This procedure purges rows from the snapshot log.
DBMS_SNAPSHOT.PURGE_LOG ( master IN VARCHAR2, num IN BINARY_INTEGER := 1, flag IN VARCHAR2 := 'NOP');
This procedure is called on the master site to delete the rows in snapshot refresh related data dictionary tables maintained at the master site for the specified snapshot identified by its snapshot_id
or the combination of the snapowner
, snapname
, and the snapsite
. If the snapshot specified is the oldest snapshot to have refreshed from any of the master tables, then the snapshot log is also purged. This procedure does not unregister the snapshot.
In case there is an error while purging one of the snapshot logs, the successful purge operations of the previous snapshot logs are not rolled back. This is to minimize the size of the snapshot logs. In case of an error, this procedure can be invoked again until all the snapshot logs are purged.
DBMS_SNAPSHOT.PURGE_SNAPSHOT_FROM_LOG ( snapshot_id IN BINARY_INTEGER | snapowner IN VARCHAR2, snapname IN VARCHAR2, snapsite IN VARCHAR2);
This procedure refreshes a list of snapshots.
DBMS_SNAPSHOT.REFRESH ( { list IN VARCHAR2, | tab IN OUT DBMS_UTILITY.UNCL_ARRAY,} method IN VARCHAR2 := NULL, rollback_seg IN VARCHAR2 := NULL, push_deferred_rpc IN BOOLEAN := TRUE, refresh_after_errors IN BOOLEAN := FALSE, purge_option IN BINARY_INTEGER := 1, parallelism IN BINARY_INTEGER := 0, heap_size IN BINARY_INTEGER := 0 atomic_refresh IN BOOLEAN := TRUE);
This procedure refreshes all snapshots (materialized views) with the following properties:
This procedure is intended for use with data warehouses.
DBMS_SNAPSHOT.REFRESH_ALL_MVIEWS ( number_of_failures OUT BINARY_INTEGER, method IN VARCHAR2 := NULL, rollback_seg IN VARCHAR2 := NULL, refresh_after_errors IN BOOLEAN := FALSE, atomic_refresh IN BOOLEAN := TRUE);
This procedure refreshes all snapshots (materialized views) with the following properties:
This procedure is intended for use with data warehouses.
DBMS_SNAPSHOT.REFRESH_DEPENDENT ( number_of_failures OUT BINARY_INTEGER, { list IN VARCHAR2, | tab IN OUT DBMS_UTILITY.UNCL_ARRAY,} method IN VARCHAR2 := NULL, rollback_seg IN VARCHAR2 := NULL, refresh_after_errors IN BOOLEAN := FALSE, atomic_refresh IN BOOLEAN := TRUE);
This procedure enables the administration of individual snapshots.
DBMS_SNAPSHOT.REGISTER_SNAPSHOT ( snapowner IN VARCHAR2, snapname IN VARCHAR2, snapsite IN VARCHAR2, snapshot_id IN DATE | BINARY_INTEGER, flag IN BINARY_INTEGER, qry_txt IN VARCHAR2, rep_type IN BINARY_INTEGER := DBMS_SNAPSHOT.REG_UNKNOWN);
This procedure is executed at the master site, and can be done by a remote procedure call. If REGISTER_SNAPSHOT
is called multiple times with the same SNAPOWNER
, SNAPNAME
, and SNAPSITE
, then the most recent values for SNAPSHOT_ID
, FLAG
, and QUERY_TXT
are stored. If a query exceeds the maximum VARCHAR2
size, then QUERY_TXT
contains the first 32000 characters of the query and the remainder is truncated. When invoked manually, the values of SNAPSHOT_ID
and FLAG
have to be looked up in the snapshot views by the person who calls the procedure.
If you do not want the snapshot query registered at the master site, then call the SET_REGISTER_QUERY_TEXT
procedure with the option set to FALSE
. To see the most recent setting of the option, call the GET_REG_QUERY_TEXT_FLAG
function at the snapshot site before issuing the DDL.
This procedure enables the administration of individual snapshots. Invoked at a master site to unregister a snapshot.
DBMS_SNAPSHOT.UNREGISTER_SNAPSHOT ( snapowner IN VARCHAR2, snapname IN VARCHAR2, snapsite IN VARCHAR2);
Parameters | Description |
---|---|
snapowner |
Owner of the snapshot. |
snapname |
Name of the snapshot. |
snapsite |
Name of the snapshot site. |