PLSQL Trace Utility
- Edit the trcs.sql file and update the connections
- Execute trcs.sql to grant all the necessary privileges as SYS
- Connect as the owner schema
- Execute trch.sql to compile the package header
- Execute trcb.sql to compile the package body
- Create a local directory on the filesystem
- Map the directory to a database directory using the CREATE DIRECTORY command in Oracle
- Update the directory name in the TRACE_CONFIG table
You must have a session running the trace listener. Simply open a SQL*Plus window and execute:
exec trace.listener
Open a new session and start a trace
exec trace.start_trace(&app_name, &prg_name);
app_name is your application name as specified in the TRACE_CONFIG table
prg_name is your program name as specified in the TRACE_CONFIG table
exec trace.it('Hello World!');
Make sure the trace_level in TRACE_CONFIG is set to 9
exec trace.stop_trace
Check your directory and a trace file should have been created with the message Hello World!