Oracle常用的小工具

1.dbfsize工具:
[oracle@rhel1 oradata]$ dbfsize redo01.log
Database file: redo01.log
Database file type: file system
Database file size: 20480 512 byte blocks

#显示文件系统块或Oracle块的大小,redo01.log的块为512byte,一共有20480个块。

2.oerr工具:
[oracle@rhel1 dev]$ oerr ora 1555
01555, 00000, "snapshot too old: rollback segment number %s with name \"%s\" too small"
// *Cause: rollback records needed by a reader for consistent read are
//         overwritten by other writers
// *Action: If in Automatic Undo Management mode, increase undo_retention
//          setting. Otherwise, use larger rollback segments

#显示错误号的Cause,Action信息,使用起来非常方便,不过仅在Linux和Unix上有此工具。

3.oradebug工具:
[oracle@rhel1 dev]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Sun May 2 23:23:09 2010

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> oradebug
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
SHORT_STACK                              Dump abridged OS stack
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
CORE                                     Dump core without crashing process
IPC                                      Dump ipc information
UNLIMIT                                  Unlimit the size of the trace file
PROCSTAT                                 Dump process statistics
CALL           [-t count] [arg1]...[argn]  Invoke function with arguments
SQL>
SQL> oradebug setmypid
Statement processed.
SQL> alter session set events '10046 trace name context forever ,level 12';

Session altered.

SQL> oradebug eventdump session;
10046 trace name CONTEXT level 12, forever
SQL> oradebug tracefile_name
/u01/app/oracle/admin/ractest/udump/ractest1_ora_12387.trc
SQL> !vi /u01/app/oracle/admin/ractest/udump/ractest1_ora_12387.trc

#oradebug可以显示已经开启了的events事件,可以显示当前用户、其他用户的events事件,可以显示跟踪文件的名字等,功能很强大,以上的例子是在会话中开启了一个10046 event,然后通过oradebug得到跟踪文件的路径和名称。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23135684/viewspace-661759/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/23135684/viewspace-661759/

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值