Oracle DBMS_SUPPORT
Version 18.3.0.1

General Information
Library Note Morgan's Library Page Header
Coming to OpenWorld 2018? Be sure to visit the TidalScale booth in Moscone South and learn how to solve performance problems and lower costs with Software Defined Servers. Before you visit the booth, or if you can't make it this year, check out TidalScale at www.tidalscale.com. Be sure to click on the Solutions link and look through the Oracle resources.
Purpose Provides an API for tracing that includes access features not available with SQL_TRACE. This package is not part of the default installation and only supports database versions 7.2 through 8.0.5.

Normally I'd leave something like this out of the library but so far Oracle hasn't removed it from RDBMS/ADMIN so it keeps its place in the library.
AUTHID DEFINER
Dependencies
DBMS_STANDARD V$MYSTAT V$SESSION
DBMS_SYSTEM    
Documented No
First Available 7.2
Installation conn / as sysdba

@?\rdbms\admin\dbmssupp.sql

GRANT execute ON dbms_support TO uwclass;

CREATE PUBLIC SYNONYM dbms_support FOR dbms_support;
Security Model Owned by SYS with no privileges granted
Source {$ORACLE_HOME}/rdbms/admin/dbmssupp.sql
Subprograms
 
MYSID
Return Session SID dbms_support.mysid RETURN NUMBER;
SELECT sid FROM v$mystat WHERE rownum = 1;

SELECT SYS_CONTEXT('USERENV', 'SID') FROM dual;

SELECT dbms_support.mysid FROM dual;
 
PACKAGE_VERSION
Returns the minimum Oracle version of PL/SQL supported dbms_support.package_version RETURN VARCHAR2;
SELECT dbms_support.package_version
FROM dual;
 
START_TRACE
Starts Tracing In The Current Session dbms_support.start_trace(waits IN BOOLEAN DEFAULT TRUE, binds IN BOOLEAN DEFAULT FALSE);
DECLARE
 w BOOLEAN := TRUE;
 b BOOLEAN := TRUE;
BEGIN
  dbms_support.start_trace(w,b);
END;
/
 
START_TRACE_IN_SESSION
Starts tracing in the specified session dbms_support.start_trace_in_session (
sid    IN NUMBER,
serial IN NUMBER,
waits  IN BOOLEAN DEFAULT TRUE,
binds  IN BOOLEAN DEFAULT FALSE);
DECLARE
 s gv$session.sid%TYPE;
 r gv$session.serial#%TYPE;
 w BOOLEAN := TRUE;
 b BOOLEAN := TRUE;
BEGIN
  SELECT sid, serial#
  INTO s, r
  FROM gv$session
  WHERE username = 'UWCLASS';

  dbms_support.start_trace_in_session(s, r, w, b);

  dbms_lock.sleep(100);

  dbms_support.stop_trace_in_session(s, r);
END;
/
 
STOP_TRACE
Stops tracing dbms_support.stop_trace;
exec dbms_support.stop_trace;
 
STOP_TRACE_IN_SESSION
Stops tracing within a specified session dbms_support.stop_trace_in_session(id IN NUMBER, serial IN NUMBER);
See START_TRACE_IN_SESSION Demo Above

Related Topics
Built-in Functions
Built-in Packages
DBMS_MONITOR
DBMS_SYSTEM
DBMS_TRACE
Trace & TKPROF
What's New In 12cR2
What's New In 12cR3

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-2017 Daniel A. Morgan All Rights Reserved