What is the ORADEBUG?
ORADEBUG is a command and can be executed from SQL*Plus to view process internal information.
You can see a list of ORADEBUG commands by following command.
SQL> oradebug help
Trace SQL statements with bind variables;
1- Set Process PID number which you want to trace
SQL> oradebug setospid 32318 Oracle pid: 29, Unix process pid: 32318, image: oracle@dbarge (TNS V1-V3)
Or you can trace your own process
SQL> oradebug setmypid
2- Start 10046 trace
SQL> oradebug EVENT 10046 trace name context forever, level 12
3- Analyze your trace file
# vi /oracle/diag/rdbms/dbarge/TEST11G/trace/TEST11G_ora_32318.trc
Trace Process Statistics;
1- Set process PID number which you want to trace. You can see it on PID column in V$PROCESS view. For example; to monitor LGWR process statistics which PID number is 11.
SQL> oradebug setorapid 11 Oracle pid: 11, Unix process pid: 16944, image:oracle@dbarge(LGWR)
2- Get statistics for LGWR process.
SQL> oradebug procstat
3- Write statistics to file.
SQL> oradebug TRACEFILE_NAME /oracle/diag/rdbms/dbarge/TEST11G/trace/TEST11G_lgwr_16944.trc
List used semaphores and shared memory segments;
SQL> oradebug ipc
Dumping error stack;
SQL> oradebug setospid 11301
SQL> oradebug event immediate trace name errorstack level 3
Talip Hakan Öztürk