Oracle DBMS_SUPPORT
Version 19.2.0.1

General Information
Library Note Morgan's Library Page Header
For how many years have you been working with physical servers that are starving your database of the memory necessary to deploy important new performance features such as the Result Cache, Memoptimize Pool, In-Memory Aggregation, In-Memory Column Store, and Full Database Caching? Too long? Contact me to learn how to improve all queries ... not just some queries.
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 18cR3
What's New In 19cR2

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