The DBMS_SUPPORT Package (Doc ID 62294.1)
The DBMS_SUPPORT Package (Doc ID 62294.1)
The DBMS_SUPPORT Package
~~~~~~~~~~~~~~~~~~~~~~~~
This package is an add on to Oracle releases 7.2 onwards to provide a
simple interface to some undocumented features of Oracle. As this exposes
undocumented features within Oracle there is no guarantee that the results
will be exactly as described for all releases.
NOTE
This package should only be installed when requested by Oracle Support.
It is not documented in the server documentation.
As such the package functionality may change without notice.
It is to be used only as directed by Oracle Support and its use otherwise is not supported.
The main feature of this package is to allow user sessions to be traced
with more information than is usually available via SQL_TRACE.
The package is supplied in the files dbmssupp.sql and prvtsupp.plb.
The files are included in the distribution of the following releases (Solaris):
8.0.6, 8.1.7, 9.0.1, 9.2.0 and above
Versions of these files may be obtained from Oracle Support for use against
Oracle releases 7.2 onwards. The package CANNOT be used in Oracle 7.1 or earlier
Procedures and Functions in DBMS_SUPPORT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The functions / procedures in this package are:
MySid Function
Start_Trace Procedure
Stop_Trace Procedure
Start_Trace_In_Session Procedure
Stop_Trace_In_Session Procedure
Each of these are described below.
FUNCTION MySid
~~~~~~~~~~~~~~
Arguments: None
Returns: Current SID as a NUMBER.
This simply returns the SID of the current session.
The function has RNPS, WNPS and WNDS RESTRICT_REFERENCES clause and so
can be used in SELECT operations.
Eg: SELECT DBMS_SUPPORT.MYSID from DUAL;
PROCEDURE Start_Trace
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Arguments: waits IN BOOLEAN DEFAULT TRUE
binds IN BOOLEAN DEFAULT FALSE
This procedure starts tracing in the current session.
The trace output is written, like SQL_TRACE, to the user trace file.
The default is to trace everything SQL_TRACE would capture plus WAIT
information.
DBMS_SUPPORT.START_TRACE;
is the default and gives information on WAITS as well as SQL_TRACE
DBMS_SUPPORT.START_TRACE( waits=>false, binds=>false )
is equivalent to standard SQL_TRACE
DBMS_SUPPORT.START_TRACE( waits=>true, binds=>false )
is the same as the default and gives information on WAITS as
well as SQL_TRACE
DBMS_SUPPORT.START_TRACE( waits=>true, binds=>true )
in addition to the above gives information about bind values.
This is typically only of use for Oracle support.
DBMS_SUPPORT.START_TRACE( waits=>false, binds=>true )
Like SQL_TRACE with additional BIND information only. No WAITs are
traced.
Known issues:
- Under MTS , XA or Oracle8 session switching the trace output may be
spread over several different trace files and thus be of little use.
PROCEDURE Stop_Trace
~~~~~~~~~~~~~~~~~~~~
Arguments: None
This procedure stops trace in the current session.
Known issues:
- If SQL_TRACE was enabled separately this procedure will turn it off.
PROCEDURE Start_Trace_In_Session
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Arguments: sid IN NUMBER
serial IN NUMBER
waits IN BOOLEAN DEFAULT TRUE
binds IN BOOLEAN DEFAULT FALSE
This is like START_TRACE except that it allows tracing to be started in a
different session. For ease of use SERIAL may be set to NULL (or 0) to denote
the current session with the given SID.
DBMS_SUPPORT.START_TRACE_IN_SESSION( sid , null )
Will trace SQL_TRACE and WAITS in the session 'sid'.
Output is written to the target sessions trace file/s.
DBMS_SUPPORT.START_TRACE_IN_SESSION( sid , serial )
Will trace SQL_TRACE and WAITS in the session 'sid,serial#'.
You only need to specify a SERIAL if you need to be sure a
specific session is traced. If the session ends and the SID is
reused before the START_TRACE_IN_SESSION call is made including
the SERIAL will cause an error to be raised rather than the trace
being started against a different session to the one you intended
to trace.
DBMS_SUPPORT.START_TRACE_IN_SESSION( sid , 0, waits=>TRUE, binds=>TRUE )
Allows WAITS and BINDS to be traced in the target session.
Known issues:
- Under MTS , XA or Oracle8 session switching the trace output may be
spread over several different trace files and thus be of little use.
PROCEDURE Stop_Trace_In_Session
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Arguments: sid IN NUMBER
serial IN NUMBER
This is like STOP_TRACE except that it allows tracing to be stopped in a
different session. For ease of use the SERIAL may be specified as NULL
to denote the current session with the supplied SID.
DBMS_SUPPORT.STOP_TRACE_IN_SESSION( sid , null )
will stop tracing in session SID.
Known issues:
- If SQL_TRACE was enabled separately this procedure will turn it off.
Trace Output
~~~~~~~~~~~~
The trace output is similar to SQL_TRACE output but may include additional
WAIT or BIND lines depending on the tracing options chosen.
A brief description of the trace output can be found in Note:39817.1
References
~~~~~~~~~~
Summary description of the raw trace output Note:39817.1
Description of how to use this package Note.62160.1
The DBMS_SUPPORT Package
~~~~~~~~~~~~~~~~~~~~~~~~
This package is an add on to Oracle releases 7.2 onwards to provide a
simple interface to some undocumented features of Oracle. As this exposes
undocumented features within Oracle there is no guarantee that the results
will be exactly as described for all releases.
NOTE
This package should only be installed when requested by Oracle Support.
It is not documented in the server documentation.
As such the package functionality may change without notice.
It is to be used only as directed by Oracle Support and its use otherwise is not supported.
The main feature of this package is to allow user sessions to be traced
with more information than is usually available via SQL_TRACE.
The package is supplied in the files dbmssupp.sql and prvtsupp.plb.
The files are included in the distribution of the following releases (Solaris):
8.0.6, 8.1.7, 9.0.1, 9.2.0 and above
Versions of these files may be obtained from Oracle Support for use against
Oracle releases 7.2 onwards. The package CANNOT be used in Oracle 7.1 or earlier
Procedures and Functions in DBMS_SUPPORT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The functions / procedures in this package are:
MySid Function
Start_Trace Procedure
Stop_Trace Procedure
Start_Trace_In_Session Procedure
Stop_Trace_In_Session Procedure
Each of these are described below.
FUNCTION MySid
~~~~~~~~~~~~~~
Arguments: None
Returns: Current SID as a NUMBER.
This simply returns the SID of the current session.
The function has RNPS, WNPS and WNDS RESTRICT_REFERENCES clause and so
can be used in SELECT operations.
Eg: SELECT DBMS_SUPPORT.MYSID from DUAL;
PROCEDURE Start_Trace
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Arguments: waits IN BOOLEAN DEFAULT TRUE
binds IN BOOLEAN DEFAULT FALSE
This procedure starts tracing in the current session.
The trace output is written, like SQL_TRACE, to the user trace file.
The default is to trace everything SQL_TRACE would capture plus WAIT
information.
DBMS_SUPPORT.START_TRACE;
is the default and gives information on WAITS as well as SQL_TRACE
DBMS_SUPPORT.START_TRACE( waits=>false, binds=>false )
is equivalent to standard SQL_TRACE
DBMS_SUPPORT.START_TRACE( waits=>true, binds=>false )
is the same as the default and gives information on WAITS as
well as SQL_TRACE
DBMS_SUPPORT.START_TRACE( waits=>true, binds=>true )
in addition to the above gives information about bind values.
This is typically only of use for Oracle support.
DBMS_SUPPORT.START_TRACE( waits=>false, binds=>true )
Like SQL_TRACE with additional BIND information only. No WAITs are
traced.
Known issues:
- Under MTS , XA or Oracle8 session switching the trace output may be
spread over several different trace files and thus be of little use.
PROCEDURE Stop_Trace
~~~~~~~~~~~~~~~~~~~~
Arguments: None
This procedure stops trace in the current session.
Known issues:
- If SQL_TRACE was enabled separately this procedure will turn it off.
PROCEDURE Start_Trace_In_Session
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Arguments: sid IN NUMBER
serial IN NUMBER
waits IN BOOLEAN DEFAULT TRUE
binds IN BOOLEAN DEFAULT FALSE
This is like START_TRACE except that it allows tracing to be started in a
different session. For ease of use SERIAL may be set to NULL (or 0) to denote
the current session with the given SID.
DBMS_SUPPORT.START_TRACE_IN_SESSION( sid , null )
Will trace SQL_TRACE and WAITS in the session 'sid'.
Output is written to the target sessions trace file/s.
DBMS_SUPPORT.START_TRACE_IN_SESSION( sid , serial )
Will trace SQL_TRACE and WAITS in the session 'sid,serial#'.
You only need to specify a SERIAL if you need to be sure a
specific session is traced. If the session ends and the SID is
reused before the START_TRACE_IN_SESSION call is made including
the SERIAL will cause an error to be raised rather than the trace
being started against a different session to the one you intended
to trace.
DBMS_SUPPORT.START_TRACE_IN_SESSION( sid , 0, waits=>TRUE, binds=>TRUE )
Allows WAITS and BINDS to be traced in the target session.
Known issues:
- Under MTS , XA or Oracle8 session switching the trace output may be
spread over several different trace files and thus be of little use.
PROCEDURE Stop_Trace_In_Session
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Arguments: sid IN NUMBER
serial IN NUMBER
This is like STOP_TRACE except that it allows tracing to be stopped in a
different session. For ease of use the SERIAL may be specified as NULL
to denote the current session with the supplied SID.
DBMS_SUPPORT.STOP_TRACE_IN_SESSION( sid , null )
will stop tracing in session SID.
Known issues:
- If SQL_TRACE was enabled separately this procedure will turn it off.
Trace Output
~~~~~~~~~~~~
The trace output is similar to SQL_TRACE output but may include additional
WAIT or BIND lines depending on the tracing options chosen.
A brief description of the trace output can be found in Note:39817.1
References
~~~~~~~~~~
Summary description of the raw trace output Note:39817.1
Description of how to use this package Note.62160.1
References
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17252115/viewspace-1134365/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Master Note For PL/SQL UTL_FILE Package (Doc ID 1155024.1)ASTSQLPackage
- ORA-04063: package body SYS.DBMS_REGISTRY_SYS has errors (Doc ID 2165402.1)PackageError
- 利用dbms_support包查詢當前會話的session_id會話Session
- 修改vip (Doc ID 276434.1)
- Android APIs (Package Index)AndroidAPIPackageIndex
- deploy package outside of jbossPackageIDE
- HANGFG User Guide (Doc ID 362094.1)GUIIDE
- How to Prepare Storage for ASM (Doc ID 452924.1)ASM
- Android開發簡單教程.docAndroid
- SQLT Diagnostic Tool (Doc ID 215187.1)SQL
- Oracle Text Health Check (Doc ID 823649.1)Oracle
- DBMS_REPAIR example (Doc ID 68013.1)AI
- Overview of Parameter Reference Notes (Doc ID 68462.1)View
- Linux OS Service 'ntpd' (Doc ID 551704.1)Linux
- Oracle 最新PSU (Doc ID 2118136.2)Oracle
- Backup and Recovery Scenarios (Doc ID 94114.1)iOS
- * Master Note: Database Performance Overview (Doc ID 402983.1)ASTDatabaseORMView
- HP-UX: Asynchronous i/o (Doc ID 139272.1)UX
- Troubleshooting Database Hang Issues (Doc ID 1378583.1)Database
- No Response from the Server, Does it Hang or Spin? (Doc ID 68738.1)Server
- Common Diagnostic Scripts for AUM problems (Doc ID 746173.1)
- How to Duplicate a Database in NOARCHIVELOG mode (Doc ID 275480.1)DatabaseHive
- Remote Diagnostic Agent (RDA) - RAC Cluster Guide (Doc ID 359395.1)REMGUIIDE
- Troubleshoot Grid Infrastructure Startup Issues (Doc ID 1050908.1)ASTStruct
- Android Studio中的package name和application IDAndroidPackageAPP
- not an rpm package (or package manifest):Package
- not an rpm package (or package manifest)Package
- packagePackage
- backup or restore OLR in 11.2 Grid Infrastructure (Doc ID 1193643.1)RESTASTStruct
- OHASD not Starting After Reboot on SLES (Doc ID 1325718.1)boot
- Oracle10G RMAN Database Duplication (Doc ID 259694.1)OracleDatabase
- Adaptive Cursor Sharing: Worked Example (Doc ID 836256.1)APT
- Master Note - Oracle GoldenGate (Doc ID 1298817.1)ASTOracleGo
- 閃回資料庫-- Doc ID 249319.1資料庫
- Procedure PqStat to monitor Current PX Queries (Doc ID 240762.1)
- RMAN Backup Shell Script Example (Doc ID 137181.1)
- Recover A Lost Datafile With No Backup (Doc ID 1060605.6)
- Oracle Clusterware: Components installed. (Doc ID 556976.1)Oracle