[oradebug命令學習1]Using ORADEBUG Utility

尛樣兒發表於2012-11-10

Using ORADEBUG Utility

ORADEBUG utility is a debugging tool that sends debug commands through SQL*Plus to an Oracle . It is primarily for use by developers and Oracle Support Services personnel. Use this utility only when instructed to do so by Oracle Support Services. You must have database administrator privileges to use ORADEBUG utility.

To start ORADEBUG utility:

  1. Start SQL*Plus from the command prompt:

    C:\> sqlplus / NOLOG  
  2. Connect to Oracle9i database as SYSDBA:

    SQL> CONNECT / AS SYSDBA  
  3. Enter the following at the SQL*Plus prompt:

    SQL> ORADEBUG  

    ORADEBUG utility runs and prompts you for parameters. To obtain a list of these parameters, enter the following at the SQL*Plus prompt:

    SQL> ORADEBUG HELP  

    Output from most debug commands is written to a . Trace files are created in the directory specified by initialization parameters BACKGROUND_DUMP_DEST and USER_DUMP_DEST. By default, these parameters are set to ORACLE_BASE\ADMIN\db_name\bdump and ORACLE_BASE\ADMIN\db_name\udump, respectively. To find the location of your trace file, enter the following at the SQL*Plus prompt:

    SQL> ORADEBUG TRACEFILE_NAME  

    If output from a debug command produces more than one line of output, then the result is sent to a trace file, and a message indicating that the command has completed is relayed to SQL*Plus. If output from a debug command produces only one line of output, then the output is relayed directly to SQL*Plus.


    Note:

    There is currently a limitation when using ORADEBUG utility. If you attempt to debug a thread that is blocking on I/O, ORADEBUG can cause SQL*Plus to hang until that I/O completes.


SQL> oradebug help
HELP           [command]                 Describe one or all commands
SETMYPID                                 Debug current process
SETOSPID                         Set OS pid of process to debug
SETORAPID       ['force']        Set Oracle pid of process to debug
SETORAPNAME                    Set Oracle process name to debug
SHORT_STACK                              Get abridged OS stack
CURRENT_SQL                              Get current SQL
DUMP           [addr]  Invoke named dump
DUMPSGA        [bytes]                   Dump fixed SGA
DUMPLIST                                 Print a list of available dumps
EVENT                              Set trace event in process
SESSION_EVENT                      Set trace event in session
DUMPVAR        

[level]  Print/dump a fixed PGA/SGA/UGA variable


DUMPTYPE      
 Print/dump an address with type info
SETVAR        

 Modify a fixed PGA/SGA/UGA variable

PEEK           [level]      Print/Dump memory
POKE                Modify memory
WAKEUP                          Wake up Oracle process
SUSPEND                                  Suspend execution
RESUME                                   Resume execution
FLUSH                                    Flush pending writes to trace file
CLOSE_TRACE                              Close trace file
TRACEFILE_NAME                           Get name of trace file
LKDEBUG                                  Invoke global enqueue service debugger
NSDBX                                    Invoke CGS name-service debugger
-G               Parallel oradebug command prefix
-R               Parallel oradebug prefix (return output

SETINST              Set instance list in double quotes
SGATOFILE               Dump SGA to file; dirname in double quotes

DMPCOWSGA       Dump & map SGA as COW; dirname in double quotes
MAPCOWSGA               Map SGA as COW; dirname in double quotes
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
SKDSTTPCS                Helps translate PCs to names
WATCH          
 Watch a region of memory

DELETE         watchpoint    Delete a watchpoint
SHOW           watchpoints        Show  watchpoints
DIRECT_ACCESS   Fixed table access
CORE                                     Dump core without crashing process
IPC                                      Dump ipc information
UNLIMIT                                  Unlimit the size of the trace file
PROCSTAT                                 Dump process statistics
CALL           [arg1] ... [argn]  Invoke function with arguments



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23135684/viewspace-748942/,如需轉載,請註明出處,否則將追究法律責任。

相關文章