Last active
August 29, 2015 14:13
-
-
Save na0AaooQ/d9d708d242e91bce5419 to your computer and use it in GitHub Desktop.
Oracle 11g アラートログ(alert.log)をtail -fで表示するスクリプト ref: http://qiita.com/na0AaooQ/items/eced881647a82f44c740
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[oracle@example-oracle-11g ~]$ echo $ORACLE_BASE | |
/oracle_example/opt/oracle/app/oracle | |
[oracle@example-oracle-11g ~]$ | |
[oracle@example-oracle-11g ~]$ echo $ORACLE_SID | |
testsid | |
[oracle@example-oracle-11g ~]$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[oracle@example-oracle-11g ~]$ vi tail_alert_log.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[oracle@example-oracle-11g ~]$ chmod 755 tail_alert_log.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[oracle@example-oracle-11g ~]$ chmod 755 tail_alert_log.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[oracle@example-oracle-11g ~]$ ./tail_alert_log.sh | |
(省略) | |
Wed Jan ** **:**:** 2015 | |
Thread 1 advanced to log sequence XXXXXX (LGWR switch) | |
Current log# 4 seq# XXXXXX mem# 0: /XXXXXXXXXX/testsid/redogXXm01.log | |
Current log# 4 seq# XXXXXX mem# 1: /XXXXXXXXXX/testsid/redogXXm02.log | |
Wed Jan ** **:**:** 2015 | |
Archived Log entry XXXXXX added for thread 1 sequence XXXXXX ID XXXXXXXXXXXXX dest 1: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ALERT_LOG="${ORACLE_BASE}/diag/rdbms/${ORACLE_SID}/${ORACLE_SID}/trace/alert_${ORACLE_SID}.log" | |
if [ -f ${ALERT_LOG} ] ; then | |
tail -f ${ALERT_LOG} | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment