首页 > Linux操作系统 > Linux操作系统 > 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
SETORAPID
SHORT_STACK Dump abridged OS stack
DUMP
DUMPSGA [bytes] Dump fixed SGA
DUMPLIST Print a list of available dumps
EVENT
SESSION_EVENT
DUMPVAR
DUMPTYPE
SETVAR
PEEK
POKE
WAKEUP
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
-R
SETINST
SGATOFILE
DMPCOWSGA
MAPCOWSGA
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
WATCH
DELETE
SHOW
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]
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博客 ” ,链接:https://blog.itpub.net/23135684/viewspace-661759/ ,如需转载,请注明出处,否则将追究法律责任。