ch17 01


[Chapter 17] Deferred Transactions and Remote Procedure CallsChapter 17 17. Deferred Transactions and Remote Procedure CallsContents:About Deferred Transactions and RPCs DBMS_DEFER_SYS: Managing Deferred TransactionsDBMS_DEFER: Building Deferred CallsDBMS_DEFER_QUERY: Performing Diagnostics and MaintenanceOracle's advanced replication option relies primarily on deferred transactions and remote procedure calls (RPCs). When you commit a transaction against a replicated table, for example, the replication support triggers queue a deferred transaction to do your bidding in one or more remote databases. In addition to providing many of the underpinnings for the advanced replication option, the packages used to create and manipulate deferred calls are available for direct use in your applications. You will use the packages described in this chapter for deferred transactions and RPCs.DBMS_DEFER_SYSPerforms administrative tasks such as scheduling, executing, and deleting queued transactions.DBMS_DEFERBuilds deferred calls.DBMS_DEFER_QUERYProvides access to parameters passed to deferred calls, primarily for diagnostic purposes.NOTE: Users must have explicit EXECUTE privileges on DBMS_DEFER in order to create deferred calls.17.1 About Deferred Transactions and RPCs This section provides some basic information you'll find useful in using the packages described in this chapter.17.1.1 About Remote DestinationsEvery remote procedure call has to be executed somewhere, and Oracle offers several methods of specifying where.If you are using the advanced replication option, you have implicitly named the destinations for deferred RPCs and transactions by creating master sites. Whenever a user performs DML on a table, the transaction is applied locally and is queued for delivery to all other sites where the table is replicated; these sites are listed in the DBA_REPSITES data dictionary view. Similarly, replicated procedure calls are also queued for all master sites in the replicated environment. Refer to Chapter 15, Advanced Replication, for details on using DBMS_REPCAT, which performs most replicated environment administration operations.If you are not using the advanced replication option, then the destination site(s) are determined by one of the following means, listed in order of precedence:The sites specified in the nodes parameter in the call to DBMS_DEFER.CALL, described later in this chapter.The sites specified in the nodes parameter to DBMS_DEFER.TRANSACTION, described later in this chapter.The sites specified in the DEFDEFAULTDEST data dictionary view, described later in this chapter (Table 17.4).If Oracle cannot determine a call's destination by any of these methods, or if you specify differing destinations in the DBMS_DEFER.TRANSACTION and DBMS_DEFER.CALL procedures, the deferred call will raise an exception.17.1.2 Data Dictionary ViewsThere are eight data dictionary views (see Table 17.1) that contain data about deferred transactions and RPCs. You can query these views to determine information such as the destination of RPC calls, error messages, and scheduled execution times. Most of the packages associated with deferred calls reference and/or modify the data in these views. Tables 17-2 through 17-9 provide details about the contents of these views. Table 17.1: Data Dictionary Views Associated with Deferred Calls View NameDescriptionDEFCALLContains information about all deferred RPCs. Queries SYSTEM.DEF$_CALL table.DEFCALLDESTContains the destination database(s) for each deferred RPC in DEFCALL. Queries SYSTEM.DEF$_CALL, SYSTEM.DEF$_DESTINATION, SYSTEM.DEF$_CALLDEST, SYSTEM.DEF$_ERROR, and SYSTEM.REPCAT$_REPPROP.DEFDEFAULTDESTContains the default destinations for deferred RPCs. Queries SYSTEM.DEF$_DEFAULTDEST.DEFERRORContains error information for deferred calls that could not be applied at their destination. Queries SYSTEM.DEF$_ERROR.DEFERRORCOUNTContains the count of errors for each destination. Queries SYSTEM.DEF$_ERROR.DEFSCHEDULEContains information about the scheduling of deferred jobs. Queries SYSTEM.DEF$_DESTINATION and SYS.JOB$.DEFTRANContains information about all deferred calls. Queries SYSTEM.DEF$_CALL and SYS.USER$.DEFTRANDESTContains the destination database(s) for each deferred transaction. Queries SYSTEM.DEF$_CALL, SYSTEM.DEF$_DESTINATION, SYSTEM.DEF$_ERROR, SYSTEM.DEF$_CALLDEST, and SYSTEM.REPCAT$_REPPROP.Table 17.2: Columns in DEFCALL Data Dictionary View Column NameDescriptionCALLNOUnique ID of call at deferred_tran_dbDEFERRED_TRAN_DBGlobal name of database that originated the callDEFERRED_TRAN_IDUnique ID of the transactionSCHEMANAMESchema that owns the packagePACKAGENAMEName of the packagePROCNAMEName of the procedure within the packageARGCOUNTNumber of arguments passed to the procedureTable 17.3: Columns in DEFCALLDEST Data Dictionary View Column NameDescriptionCALLNOUnique ID of call at deferred_tran_db.DEFERRED_TRAN_IDUnique ID of the transaction. Note that each deferred_tran_id has one or more calls.DEFERRED_TRAN_DBGlobal name of database that originated the call.DBLINKGlobal name of the destination database.Table 17.4: Columns in DEFDEFAULTDEST Data Dictionary ViewColumn NameDescriptionDBLINKGlobal name of the destination databaseTable 17.5: Columns in DEFERROR Data Dictionary ViewColumn NameDescriptionDEFERRED_TRAN_DBGlobal name of the database that originated the RPCDEFERRED_TRAN_IDID of the transaction originating or copying the deferred RPCCALLNOUnique ID of call at deferred_tran_dbDESTINATIONDatabase link used to specify the destination databaseERROR_TIMETime the error occurredERROR_NUMBEROracle error numberERROR_MSGError message textTable 17.6: Columns in DEFERRCOUNT Data Dictionary ViewColumn NameDescriptionERRCOUNTNumber of errors in deferred RPC calls to destinationDESTINATIONGlobal name of destination databaseTable 17.7: Columns in DEFSCHEDULE Data Dictionary View Column NameDescriptionDBLINKGlobal name of the database for which pushes of deferred RPC calls is scheduledJOBNumber of the job (job column in DBA_JOBS)INTERVALDate expression that determines how often the job runsNEXT_DATENext time the job is scheduled to runLAST_DATELast time the job ranDISABLEDY if propagation to destination is disabled, otherwise NLAST_TXN_COUNTNumber of transactions pushed last time job ranLAST_ERROROracle error number from the most recent pushLAST_MSGError message text from the most recent pushTable 17.8: Columns in DEFTRAN Data Dictionary View Column NameDescriptionDEFERRED_TRAN_IDID of the transaction that originated or copied the deferred RPCs.DEFERRED_TRAN_DBGlobal name of the database that originated or copied the deferred RPCs.ORIGIN_TRAN_IDID of the transaction that originated the deferred RPCs.ORIGIN_TRAN_DBGlobal name of the database that originated the deferred RPCs.ORIGIN_USERUSERID of user originating deferred RPC calls.DELIVERY_ORDERSCN of the deferred transaction in the queue.DESTINATION_LISTR if destinations are determined by the DBA_REPSCHEMA data dictionary view. D if destinations were specified in DEFDEFAULTDEST or the NODE_LIST parameter to the DBMS_DEFER.TRANSACTION, DBMS_DEFER.CALL, or DBMS_DEFER.COPY procedures.START_TIMEStart time of the origination transaction.COMMIT_COMMENTUser-supplied comments. Table 17.9: Columns in DEFTRANDEST Data Dictionary ViewColumn NameDescriptionDEFERRED_TRAN_IDID of the transaction to propagate to database specified by dblinkDEFERRED_TRAN_DBGlobal name of the database that originated the deferred transactionDBLINKGlobal name of the destination database16.6 Monitoring Conflict Resolution with DBMS_REPCAT17.2 DBMS_DEFER_SYS: Managing Deferred Transactions Copyright (c) 2000 O'Reilly & Associates. All rights reserved.

Wyszukiwarka

Podobne podstrony:
ch17 (2)
ch17 (24)
ch17#
ch17&
ch17
CH17 (15)
ch17
ch17
ch17 (9)
ch17
ch17 (6)
ch17
ch17
CH17
ch17
ch17(

więcej podobnych podstron