|
|
|
Re: scripts for monitoring UNIX space [message #246728 is a reply to message #246695] |
Thu, 21 June 2007 12:59 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
DreamzZ
Messages: 1666 Registered: May 2007 Location: Dreamzland
|
Senior Member |
|
|
some thing like this>>> CUstomize it
#!/bin/ksh -x
. $HOME/.profile_DB
$ORACLE_HOME/bin/sqlplus /NOLOG <<HERE
-- Exit with failure, if SQL, PL/SQL or OS error is raised in top level proc
WHENEVER SQLERROR EXIT FAILURE;
WHENEVER OSERROR EXIT FAILURE;
CONNECT oracle/DREAMZ
#----------------------------------------------------------------------------------------------------------------
print "\n--- Reporting FREE Space in Tablespaces --- \n">>$STATS_LOG
$ORACLE_HOME/bin/sqlplus /NOLOG <<HERE
-- Exit with failure, if SQL, PL/SQL or OS error is raised in top level proc
WHENEVER SQLERROR EXIT FAILURE;
WHENEVER OSERROR EXIT FAILURE;
--
#-----------------------------------------------------------------------------------------------------------------
print "\n--- Reporting MOUNT POINT Disk Space Usage (df -lk) --- \n">>$STATS_LOG
df -lk >> $STATS_LOG
retcode=$?
if [ $retcode != '0' ]; then
print "FATAL ERROR: Reporting MOUNT POINT Disk Space Usage... failed: status $retcode; ERRNO $ERRNO \n">>$STATS_LOG
ERROR_FLG='1'
else
print "\n--- Reporting MOUNT POINT Disk Space Usage (df -lk)... COMPLETED! --- \n">>$STATS_LOG
fi
[Updated on: Thu, 21 June 2007 12:59] Report message to a moderator
|
|
|
|
|