Search notes:

Oracle: DBMS_SUPPORT

dbms_support needs to be installed manually with dbmssupp.sql (which is found in the $ORACLE_HOME/rdbms/admin directory):
SQL> @?/rdbms/admin/dbmssupp
After installing dbms_support, only sys has access to it. In order for other users to be able to use it, they need to be granted access:
grant execute on dbms_support to rene;

Functions and procedures

mysid
package_version
start_trace
start_trace_in_session
stop_trace
stop_trace_in_session

Starting a diagnostic trace

Event 10046, level 12
exec dbms_support.start_trace( binds=>true , waits=>true);
Event 10046, level 1, in another session
exec dbms_support.start_trace_in_session (sid => 1802, serial=>54321)
Stop trace:
exec dbms_support.stop_trace
exec dbms_support.stop_trace_in_session(1802, 54321)
Tracing (also for events different than 10046) also be set with dbms_system.set_ev or alter session set events ….

mysid

dbms_support.mysid returns the session id of the session executing this function. Thus, it allows to find the record in v$session that reveals the information about the current session:
select * from v$session where sid=sys.dbms_support.mysid;
See also Identifying the «own» session.

See also

Oracle DBMS PL/SQL packages
Metalink Note 62294.1

Index