Oracle DBMS_DEFER_SYS
Version 11.2.0.3
 
General Information
Note: This package is the system administrator interface to a replicated transactional deferred remote procedure call facility. Administrators and replication daemons can execute transactions queued for remote nodes using this facility and administrators can control the nodes to which remote calls are destined.
Source {ORACLE_HOME}/rdbms/admin/dbmsdefr.sql
First Available 7.3.4
Constants
Push/Purge Constants Description Value
result_ok okay, terminated after delay_seconds expired 0
result_startup_seconds terminated by lock timeout while starting 1
result_execution_seconds terminated by exceeding execution_seconds 2
result_transaction_count terminated by exceeding transaction_count 3
result_delivery_order_limit terminated at delivery_order_limit 4
result_errors terminated after errors 5
result_push_disabled terminated after detecting that propagation is disabled 6
result_purge_disabled terminated after detecting that purge is disabled 6
result_cant_get_sr_enq terminated after failing to acquire SR enqueue 7
Dependencies
DBA_USERS DBMS_REPCAT_CACHE DEF$_AQERROR
DBMS_ASSERT DBMS_REPCAT_DECL DEF$_CALLDEST
DBMS_ASYNCRPC_PUSH DBMS_REPCAT_MIG_INTERNAL DEF$_DEFAULTDEST
DBMS_DEFER DBMS_REPCAT_SNA_UTL DEF$_DESTINATION
DBMS_DEFER_IMPORT_INTERNAL DBMS_REPUTIL DEF$_ERROR
DBMS_DEFER_INTERNAL_SYS DBMS_SNAPSHOT DEF$_LOB
DBMS_DEFER_QUERY DBMS_SNAP_INTERNAL DEF$_PROPAGATOR
DBMS_DEFER_QUERY_UTL DBMS_SQL DEFPROPAGATOR
DBMS_DEFER_REPCAT DBMS_SYSTEM DEFTRANDEST
DBMS_DEFER_SYS_PART1 DBMS_SYS_ERROR JOB$
DBMS_IJOB DBMS_SYS_SQL REPCAT$_REPPROP
DBMS_LOCK DBMS_TRANSACTION USER$
DBMS_LOGREP_UTIL DEF$_AQCALL  
Exceptions
Exception Name Error Code Reason
crt_err_err 23324 Parameter type doesn't match actual type
norepoption 02094 Replication is not linked as an option
missinguser 23362 Invalid user
alreadypropagator 23393 Already the propagator
duplicatepropagator 23394 Duplicate propagator
missingpropagator 23357 Missing propagator
propagator_inuse 23418 Propagator in use
incompleteparallelpush 23388 Incomplete parallel propagation/push
argoutofrange 23427 Purge queue argument is out of range
notemptyqueue 23426 Deferred RPC for some destination
serialpropnotallowed 23495 Serial propagation can not be used
cantsetdisabled 23496 Can't set disabled
Security Model By default, this package is owned by user SYS and execution should be granted only to administrators and daemons that perform replication administration and execute deferred transactions. See the security considerations for the dbms_defer package for related considerations.
Subprograms
 
ADD_DEFAULT_DEST
Adds a destination database to the DEFDEFAULTDEST view dbms_defer_sys.add_default_dest(dblink IN VARCHAR2);
exec dbms_defer_sys.add_default_dest('REMOTEDB');
 
CLEAR_PROP_STATISTICS
Clear the propagation statistics in the DEFSCHEDULE view dbms_defer_sys.clear_prop_statistics(dblink IN VARCHAR2);
exec dbms_defer_sys.clear_prop_statistics('REMOTEDB');
 
DELETE_DEFAULT_DEST
Removes a destination database from the DEFDEFAULTDEST view dbms_defer_sys.delete_default_dest(dblink IN VARCHAR2);
exec dbms_defer_sys.delete_default_dest('REMOTEDB');
 
DELETE_DEF_DESTINATION
Removes a destination database from the DEFSCHEDULE view dbms_defer_sys.delete_def_destination(
destination IN VARCHAR2,
force       IN BOOLEAN := FALSE);

TRUE: ignore safety checks
exec dbms_defer_sys.delete_def_destination('REMOTEDB', FALSE);
 
DELETE_ERROR
Deletes a transaction from the DEFERROR view dbms_defer_sys.delete_error(
deferred_tran_id IN VARCHAR2,
destination      IN VARCHAR2);
TBD
 
DELETE_TRAN
Deletes a transaction from the DEFTRANDEST view dbms_defer_sys.delete_tran(
deferred_tran_id IN VARCHAR2, 
destination      IN VARCHAR2);
TBD
 
DISABLED
Determines whether propagation of the deferred transaction queue from the current site to a specified site is enabled dbms_defer_sys.disabled(destination IN VARCHAR2) RETURN BOOLEAN;
set serveroutput on

BEGIN
  IF dbms_defer_sys.delete_def_destination('REMOTEDB') THEN
    dbms_output.put_line('TRUE');
  ELSE
    dbms_output.put_line('FALSE');
  ENDIF;
END;
/
 
EXCLUDE_PUSH
Acquires an exclusive lock that prevents deferred transaction PUSH (either serial or parallel) dbms_defer_sys.exclude_push(timeout IN INTEGER) RETURN INTEGER;

Description Return Value
Success (Y) 0
Timeout (N) 1
Deadlock (N) 2
Already own the lock (Y) 4
set serveroutput on

DECLARE
 i INTEGER;
BEGIN
  i := dbms.defer_sys.exclude_push(10);
  dbms_output.put_line(i);
END;
/
 
EXECUTE
Execute transactions queued for destination_node using the security context of the propagator. stop_on_error determines whether processing of subsequent transaction continues after an error is detected.

The execute_as_user parameter is obsolete and ignored.

Overload 1
dbms_defer_sys.execute(
destination       IN VARCHAR2,
stop_on_error     IN BOOLEAN := FALSE,
transaction_count IN BINARY_INTEGER := 0,
execution_seconds IN BINARY_INTEGER := 0,
execute_as_user   IN BOOLEAN,
delay_seconds     IN NATURAL := 0,
batch_size        IN NATURAL := 0);
TBD
Overload 2 dbms_defer_sys.execute(destination IN VARCHAR2,
stop_on_error     IN BOOLEAN := FALSE,
transaction_count IN BINARY_INTEGER := 0,
execution_seconds IN BINARY_INTEGER := 0,
delay_seconds     IN NATURAL := 0,
batch_size        IN NATURAL := 0);
TBD
 
EXECUTE_ERROR
(Re)Execute transactions that previously encountered conflicts. Each transaction is executed in the security context of the original receiver of the transaction. dbms_defer_sys.execute_error(
deferred_tran_id IN VARCHAR2,
destination      IN VARCHAR2);
TBD
 
EXECUTE_ERROR_AS_USER
(Re)Execute transactions that previously encountered conflicts. Each transaction is executed in the security context of the connected user. dbms_defer_sys.execute_error_as_user(
deferred_tran_id IN VARCHAR2,
destination      IN VARCHAR2);
TBD
 
EXECUTE_ERROR_CALL
For internal use only dbms_defer_sys.execute_error_call_as_user(
deferred_tran_id IN VARCHAR2,
callno           IN NUMBER);
TBD
 
EXECUTE_ERROR_CALL_AS_USER
For internal use only dbms_defer_sys.execute_error_call_as_user(
deferred_tran_id IN VARCHAR2,
callno           IN NUMBER);
TBD
 
NULLIFY_ALL_TRANS
For internal use only dbms_defer_sys.nullify_all_trans;
exec dbms_defer_sys.nullify_all_trans;
 
NULLIFY_TRANS_TO_DESTINATION
For internal use only dbms_defer_sys.nullify_trans_to_destination(dblink IN VARCHAR2, catchup IN RAW := NULL);
TBD
 
PURGE
Purge pushed transactions from the queue 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 := FALSE)
RETURN BINARY_INTEGER;
TBD
 
PUSH
Push transactions queued for destination node, choosing 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;
TBD
 
PUSH_WITH_CATCHUP
For internal use only dbms_defer_sys.push_with_catchup(
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,
catchup              IN RAW := NULL)
RETURN BINARY_INTEGER;
TBD
 
REGISTER_PROPAGATOR
Register the given user as the propagator for the local database dbms_defer_sys.register_propagator(username IN VARCHAR2);
exec dbms_defer_sys.register_propagator('UWCLASS);
 
SCHEDULE_EXECUTION
Insert or update a defschedule entry and signal the background process dbms_defer_sys.schedule_execution(
dblink            IN VARCHAR2,
interval          IN VARCHAR2,
next_date         IN DATE,
reset             IN BOOLEAN default FALSE,
stop_on_error     IN BOOLEAN := NULL,
transaction_count IN BINARY_INTEGER := NULL,
execution_seconds IN BINARY_INTEGER := NULL,
delay_seconds     IN NATURAL := NULL,
batch_size        IN NATURAL := NULL);
TBD
 
SCHEDULE_PURGE
Schedule a job to invoke purge dbms_defer_sys.schedule_purge(
interval          IN VARCHAR2,
next_date         IN DATE,
reset             IN BOOLEAN := FALSE,
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);
TBD
 
SCHEDULE_PUSH
Schedule a job to invoke push 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);
TBD
 
SET_DISABLE
Turn on/off the disabled state for a destination set_disabled(destination IN VARCHAR2,
disabled IN BOOLEAN := TRUE,
catchup  IN RAW := '00',
override IN BOOLEAN := FALSE);
exec dbms_defer_sys.set_disable;
 
UNREGISTER_PROPAGATOR
Unregisters the given user as the given propagator for the local database dbms_defer_sys.unregister_propagator(
username IN VARCHAR2,
timeout  IN INTEGER DEFAULT dbms_lock.maxwait);
exec dbms_defer_sys.unregister_propagator('UWCLASS');
 
UNSCHEDULE_EXECUTION
Deprecated: Use UNSCHEDULE_PUSH below dbms_defer_sys.unschedule_execution(dblink IN VARCHAR2);
TBD
 
UNSCHEDULE_PURGE
Delete defschedule entry for purge. Signal to background process to stop servicing purge dbms_defer_sys.unschedule_purge;
exec dbms_defer_sys.unschedule_purge;
 
UNSCHEDULE_PUSH
Stops automatic pushes of the deferred transaction queue from a master site or materialized view site to a remote site dbms_defer_sys.unschedule_push(dblink IN VARCHAR2);
exec dbms_defer_sys.unschedule_push('FIXED_USER');
 
Related Topics
Advanced Replication
 
Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2013 Daniel A. Morgan All Rights Reserved