Oracle中檢視sql命令歷史,檢視rman命令歷史

tengrid發表於2009-05-21

就像$HOME下的.bash_history 會儲存當前使用者的shell命令執行歷史一樣
如果在oracle server上安裝了uniread以解決SQL提示符下命令記錄問題,那麼,同樣可以獲得sql或rman命令的執行歷史.
當我們需要查詢曾經執行過哪些命令時,直接從uniread歷史檔案中查詢比從SQL>或RMAN>下透過上下方向鍵查詢要方便得多.

uniread --help
Usage: /usr/bin/uniread [options] command args...
Options:
--history history_file  Loads and saves history from this file. Default is to
                        use the file ~/.uniread/

--inputrc inputrc       Use readline configuration from given file. Default is
                        ~/.inputrc or the INPUTRC environment variable.
--force-readline        Force to always get input in readline mode, even if
                        it appears the program does not want a line of text.
--eat-echo              Eat the command that is echoed back by some programs
                        that try to do the readline themselves.
--quiet                 Do not display any messages from uniread itself
--verbose               Display verbose messages from uniread itself
--version               Display version info
--help                  Displays this usage message

Report bugs to <>
pwd 
/home/oracle/.uniread
more sqlplus
host pwd
@create_db.sql
startup nomount pfile=/opt/oracle/admin/orcl/pfile/initorcl.ora;
exit
startup nomount pfile=/opt/oracle/admin/orcl/pfile/initorcl.ora;
exit
startup nomount pfile=/opt/oracle/admin/orcl/pfile/initorcl.ora;
exit
startup nomount pfile=/opt/oracle/admin/orcl/pfile/initorcl.ora;
shutdown
exit

grep "shutdown immediate" sqlplus |wc -l
42

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

相關文章