OraMatt: YABAOracle

Yet Another Blog About Oracle

, ,

Follow the alert log

#!/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

 

Leave a comment

Navigation

About

I’m Matt and I do Oracle things.