Follow the alert log

[sourcecode language=”bash”]
#!/bin/sh

# Tail the alert log from a database
# Author Matt Dee
# You should have the ORACLE_BASE in your env…if not I should write an if thing…

clear

# Test to make sure got SID name
if test -z "$1"
then
echo "No command-line arguments."
printf "Enter the database SID you wish to stalk>: "
read SID
clear
echo "#####################################"
echo "Here is the tail command"
echo "#####################################"
echo "tail -f $ORACLE_BASE/diag/rdbms/${SID}/${SID}/trace/alert_${SID}.log"
echo "#####################################"
tail -f $ORACLE_BASE/diag/rdbms/$SID/$SID/trace/alert_$SID.log
else
clear
echo "#####################################"
echo "Here is the tail command"
echo "#####################################"
echo "tail -f $ORACLE_BASE/diag/rdbms/${1}/${1}/trace/alert_${1}.log"
echo "#####################################"
tail -f $ORACLE_BASE/diag/rdbms/$1/$1/trace/alert_$1.log
fi

 

[/sourcecode]

Leave a Reply

Discover more from OraMatt: YABAOracle

Subscribe now to keep reading and get access to the full archive.

Continue reading