How to Generate SQL Trace Files on AWS RDS
Generating trace files on AWS RDS is super easy by making use of the DBMS_MONITOR package. Below are some simple examples
To trace your current connected session
EXEC DBMS_MONITOR.session_trace_enable;
EXEC DBMS_MONITOR.session_trace_enable(waits=>TRUE, binds=>TRUE);
EXEC DBMS_MONITOR.session_trace_disable;
To trace a specific session
EXEC DBMS_MONITOR.session_trace_enable(session_id=>1234, serial_num=>4567);
EXEC DBMS_MONITOR.session_trace_enable(session_id =>1234, serial_num=>4567, waits=>TRUE, binds=>FALSE);
EXEC DBMS_MONITOR.session_trace_disable(session_id=>1234, serial_num=>4567);
After capturing your trace and subsequently turning the trace off, you can then either download the files or view the files using on of the following methods below
Viewing the Trace Files - https://www.markramsay.com/oracleonthecloud/view-files-in-directories
Downloading the Trace Files - http://oracledatabase.wikidot.com/startscriptshowtodownloadfilesfromrds
Published onÂ
20 August 2024 at 12:54:47