Tag: oradebug

How to get dump or list parameters set at session level?

Using oradebug one can get a dump of sessions parameters that are modified at session level, like optimization parameters. SQL> alter session set sql_trace=true; Session altered. SQL> alter session set optimizer_mode=first_rows; Session altered. -- connect to session SQL> oradebug setmypid Statement processed. SQL> oradebug dump modified_parameters 1; Statement processed. SQL> oradebug tracefile_name; i:\db\oracle\testdb\diagnostic_dest\diag\rdbms\testdb_a\testdb\trace\testdb_ora_4908.trc Contents of … Continue reading How to get dump or list parameters set at session level?

Using oradebug to dump call stack?

Using "oradebug dump errorstack <dump level>" one can dump the call stack of the process after attaching to a running session. There are 3 values that can be passed as dump level 0 - dump error buffer 1 - level 0 with call stack 2 - level 1 with process state 3 - level 2 … Continue reading Using oradebug to dump call stack?

How to find/list the events set in a session?

Using "oradebug dump events 1" one can find/list events set in a session. For example: In a session events 10046 and 1410 events are set SQL> ALTER SESSION SET EVENTS='10046 trace name context forever, level 12'; Session altered. SQL> ALTER SESSION SET EVENTS='1410 trace name context forever, level 12'; Session altered. SQL> SELECT distinct sid … Continue reading How to find/list the events set in a session?

How to suspend/resume a process using oradebug?

Suspend a running process SQL> oradebug setorapid 12 Unix process pid: 10932, image: oracle@localhost.localdomain (TNS V1-V3) SQL> oradebug suspend Statement processed. Resume a process SQL> oradebug resume Statement processed. If you have trace turned on a suspended and resume session you will see the following messages in the trace file. FETCH #5:c=54992,e=55962,p=0,cr=2334,cu=0,mis=0,r=1,dep=1,og=1,tim=1249098751175228 EXEC #5:c=0,e=72,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=1,tim=1249098751175408 Received … Continue reading How to suspend/resume a process using oradebug?

Using oradebug to set event

The following example shows how to set event on a oracle session To turn on event, needs to be run as sysdba SQL> connect /as sysdba – attach to session by OS process id SQL> oradebug setospid 5243378; Oracle pid: 68, Unix process pid: 5243378, image: oracle@hostname (TNS V1-V3) – sets maximum dump file size … Continue reading Using oradebug to set event

ORADEBUG – UNDOCUMENTED ORACLE UTILITY

Link to oradebug - debug utility http://www.evdbt.com/Oradebug_Modrakovic.pdf

How to find the trace file name?

To find the trace file one using oradebug one can find it using the example below: SQL> oradebug mysetpid Statement processed. SQL> oradebug tracefile_name /u01/oradata/admin/TEST/udump/test_ora_9964.trc If you try to run the above command without attaching to a session it will return ORA-00074 SQL> oradebug tracefile_name ORA-00074: no process has been specified

How to set unlimit size of trace file?

Using oradebug unlimit one can set to unlimit the size of the trace file. SQL> oradebug setmypid Statement processed. SQL> oradebug unlimit Statement processed.

How to use oradebug to connect to a session?

To use oradebug one first needs to connect to a session using the process id or ora pid. One can do so by doing one of the following, the following example shows how to connect using OS process id or oracle PID or current session. SELECT a.username, a.sid, a.serial#, b.spid, b.pid FROM v$session a, v$process … Continue reading How to use oradebug to connect to a session?

Enable trace in a running session from PL/SQL or SQL*Plus

Using Oracle SID and SERIAL# can turn trace on/off a Oracle session that has already started. The values of SID and serial# can be obtained from GV$SESSION. This will create trace file in directory set by the parameter user_dump_dest. To find the SID and SERIAL# you want to debug you can query GV$session to query … Continue reading Enable trace in a running session from PL/SQL or SQL*Plus