Expert secrets on oradebug
 

Oracle provides an internal and poorly documented utility called oradebug.

The oradebug utility provides useful functions for debugging and tracing Oracle database errors and can also be quite handy for tracing SQL statements to output to the tkprof utility for analysis by Oracle technicians. However, there are some caveats with the use of the oradebug tool and it should be used only under the careful guidance of Oracle support to avoid potential damage to production and other critical Oracle databases.

  Here are a few of the many functions available for the expert Oracle DBA with oradebug.

 

C:\oradebug>sqlplus /nolog

 SQL*Plus: Release 10.2.0.1.0 - Production on Mon May 19 14:46:19 2008

 Copyright (c) 1982, 2005, Oracle.  All rights reserved.

 SQL> connect / as sysdba
Connected.

 

SQL> oradebug help
HELP           [command]                 Describe one or all commands
SETMYPID                                 Debug current process
SETOSPID       <ospid>                   Set OS pid of process to debug
SETORAPID      <orapid> ['force']   Set Oracle pid of process to debug
SHORT_STACK                              Dump abridged OS stack
DUMP           <dump_name> <lvl> [addr]  Invoke named dump
DUMPSGA        [bytes]                   Dump fixed SGA
DUMPLIST                                Print a list of available dumps
EVENT          <text>                    Set trace event in process
SESSION_EVENT  <text>                    Set trace event in session
DUMPVAR        <p|s|uga> <name> [level]  Print/dump a fixed PGA/SGA/UGA DUMPTYPE       <address> <type> <count>  Print/dump an address with type info
SETVAR         <p|s|uga> <name> <value>  Modify a fixed PGA/SGA/UGA PEEK           <addr> <len> [level]      Print/Dump memory
POKE           <addr> <len> <value>      Modify memory
WAKEUP         <orapid>                  Wake up Oracle process
SUSPEND                                  Suspend execution
RESUME                                   Resume execution
FLUSH                                    Flush pending writes to trace CLOSE_TRACE                              Close trace file
TRACEFILE_NAME                           Get name of trace file
LKDEBUG                                  Invoke global enqueue service              

 

SGATOFILE      <SGA dump dir>         Dump SGA to file
DMPCOWSGA      <SGA dump dir>         Dump & map SGA as COW
MAPCOWSGA      <SGA dump dir>         Map SGA as COW
HANGANALYZE    [level] [syslevel]     Analyze system hang
FFBEGIN                               Flash Freeze the Instance
FFDEREGISTER                       FF deregister instance from cluster
FFTERMINST                         Call exit and terminate instance
FFRESUMEINST                       Resume the flash frozen instance
FFSTATUS                           Flash freeze status of instance
UNLIMIT                            Unlimit the size of the trace file
PROCSTAT                           Dump process statistics

 

 As you can see, there are quite a few options to the oradebug utility.

Read more about Oracle debugging and tracing with the Oradebug utility here:

http://www.dba-oracle.com/t_oradebug_tips.htm

*****************************************

Need a Health Check?

Oracle is the worlds most complex and robust database and there are hundreds of sub-optimal setting that can cripple your database performance.

Burleson Consulting has a great Oracle health check where we identify all database bottlenecks to ensure that your mission-critical system is running at optimal speeds.

Just call 800-766-1884 to schedule your health check.

*****************************************

Need Oracle Training?

The very best Oracle training comes from Burleson Consulting, where you get an on-site visit by an experienced Oracle expert and author.  Whether it's one-on-one mentoring or getting a customized on-site Oracle training class, there is no substitute for BC Oracle training.  Just call 800-766-1884 for details, and check-out our on-site Oracle training catalog at the following link:

http://www.dba-oracle.com/bc-catalog.pdf