方便檢視11g錯誤日誌的指令碼
寫了個指令碼,showalert11.sh 呼叫adrci命令,顯示最近N天的 ORA- 錯誤
[oracle@billdb01 olm]$ ./showalert11.sh 2
ADR Home = /oracle/app/oracle/diag/rdbms/bill1/bill1:
*************************************************************************
2012-10-09 08:45:29.117000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_21045.trc.
2012-10-09 14:00:30.947000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_21030.trc.
2012-10-09 15:03:25.025000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_24370.trc.
2012-10-09 15:13:35.803000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_21085.trc.
2012-10-09 15:28:57.215000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_21044.trc.
2012-10-09 16:45:23.198000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_11987.trc.
2012-10-09 17:19:44.845000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_12118.trc.
2012-10-09 18:19:30.327000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_12039.trc.
2012-10-10 09:15:29.608000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_11987.trc.
2012-10-10 09:25:41.059000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_21085.trc.
2012-10-10 11:25:12.234000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_12039.trc.
2012-10-10 13:01:44.408000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_21045.trc.
2012-10-10 13:51:26.219000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_11987.trc.
2012-10-10 15:46:43.646000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_12013.trc.
2012-10-10 21:14:52.300000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_21045.trc.
2012-10-11 05:37:17.204000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_12039.trc.
2012-10-11 07:54:03.627000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_12071.trc.
2012-10-11 09:06:28.600000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_24370.trc.
2012-10-11 10:00:21.904000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_12013.trc.
2012-10-11 10:00:26.882000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_12013.trc.
指令碼如下:
[oracle@billdb01 olm]$ cat showalert11.sh
runsql(){
sqlplus -silent "/as sysdba" <
set pagesize 0 feedback off verify off heading off echo off long 9999 linesize 130
$1
EOF
}
TMPTEXT=`runsql "SELECT substr(VALUE,INSTR(VALUE,'diag'))||' '||to_char(SYSDATE-$1,'yyyy-mm-dd') FROM v\\$diag_info WHERE NAME='ADR Home';"`
ADRHOME=`echo $TMPTEXT|awk '{print $1}'`
QRYDATE=`echo $TMPTEXT|awk '{print $2}'`
adrci exec="set home $ADRHOME;show alert -term -p \\\"ORIGINATING_TIMESTAMP>'$QRYDATE' and message_text like '%ORA-%'\\\" "
[oracle@billdb01 olm]$ ./showalert11.sh 2
ADR Home = /oracle/app/oracle/diag/rdbms/bill1/bill1:
*************************************************************************
2012-10-09 08:45:29.117000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_21045.trc.
2012-10-09 14:00:30.947000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_21030.trc.
2012-10-09 15:03:25.025000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_24370.trc.
2012-10-09 15:13:35.803000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_21085.trc.
2012-10-09 15:28:57.215000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_21044.trc.
2012-10-09 16:45:23.198000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_11987.trc.
2012-10-09 17:19:44.845000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_12118.trc.
2012-10-09 18:19:30.327000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_12039.trc.
2012-10-10 09:15:29.608000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_11987.trc.
2012-10-10 09:25:41.059000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_21085.trc.
2012-10-10 11:25:12.234000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_12039.trc.
2012-10-10 13:01:44.408000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_21045.trc.
2012-10-10 13:51:26.219000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_11987.trc.
2012-10-10 15:46:43.646000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_12013.trc.
2012-10-10 21:14:52.300000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_21045.trc.
2012-10-11 05:37:17.204000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_12039.trc.
2012-10-11 07:54:03.627000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_12071.trc.
2012-10-11 09:06:28.600000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_24370.trc.
2012-10-11 10:00:21.904000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_12013.trc.
2012-10-11 10:00:26.882000 +08:00
ORA-00060: Deadlock detected. More info in file /oracle/app/oracle/diag/rdbms/bill1/bill1/trace/bill1_ora_12013.trc.
指令碼如下:
[oracle@billdb01 olm]$ cat showalert11.sh
runsql(){
sqlplus -silent "/as sysdba" <
set pagesize 0 feedback off verify off heading off echo off long 9999 linesize 130
$1
EOF
}
TMPTEXT=`runsql "SELECT substr(VALUE,INSTR(VALUE,'diag'))||' '||to_char(SYSDATE-$1,'yyyy-mm-dd') FROM v\\$diag_info WHERE NAME='ADR Home';"`
ADRHOME=`echo $TMPTEXT|awk '{print $1}'`
QRYDATE=`echo $TMPTEXT|awk '{print $2}'`
adrci exec="set home $ADRHOME;show alert -term -p \\\"ORIGINATING_TIMESTAMP>'$QRYDATE' and message_text like '%ORA-%'\\\" "
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8242091/viewspace-746145/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 方便檢視11g錯誤日誌的指令碼(新)指令碼
- 錯誤日誌檢視
- 檢查Linux系統日誌error和mysql錯誤日誌的指令碼薦LinuxErrorMySql指令碼
- win10系統怎麼檢視系統錯誤日誌_win10如何檢視錯誤日誌Win10
- ABAP 檢視webservice錯誤日誌事務碼:SRT_UTILWeb
- 如何使錯誤日誌更加方便地排查問題
- oracle 11g檢視alert日誌方法Oracle
- Oracle 11g 檢視監聽日誌Oracle
- Oracle 11g RAC檢視ASM日誌、grid日誌和DB日誌OracleASM
- Oracle檢視每小時日誌切換量指令碼Oracle指令碼
- 巡檢昨天到現在asm 、系統、資料庫等錯誤日誌 shell指令碼ASM資料庫指令碼
- mysql錯誤碼的檢視方法MySql
- 11g 日誌目錄查詢檢視
- 檢視mysql日誌及日誌編碼問題MySql
- mysql 日誌之錯誤日誌MySql
- 檢視日誌
- Ubuntu下啟動、停止、重啟MySQL,檢視錯誤日誌命令大全UbuntuMySql
- 排查錯誤日誌
- 物化檢視日誌表被DROP後建立物化檢視報錯
- alertmanager: 檢視日誌
- Apche日誌系列(2):錯誤日誌(轉)
- 檢視docker映象的日誌Docker
- 檢視系統的日誌
- Mabatis配置錯誤日誌BAT
- net 日誌分析錯誤
- 日誌查詢錯誤
- SQL Server 錯誤日誌SQLServer
- 11g告警日誌中大量ORA-12170錯誤
- MYSQL啟用日誌和檢視日誌MySql
- 檢視oracle固定目錄下日誌和trace檔案大小指令碼Oracle指令碼
- SAP 錯誤日誌的調查
- 上一個日誌的錯誤
- Linux 檢視日誌Linux
- Hyperf日誌檢視元件元件
- oracle 日誌檢視方法Oracle
- sql 日誌檢視工具SQL
- 檢視日誌的幾種形式
- 物化檢視日誌的維護