Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Archive log destination space check - shell script

Re: Archive log destination space check - shell script

From: Viraj Luthra <viraj999_at_lycos.com>
Date: Mon, 25 Jun 2001 23:21:53 -0700
Message-ID: <F001.00337A44.20010625230054@fatcity.com>

Thanks Jared for the script, have modified (the little that had to be done :-), and works like a charm.

the next problem that I have, is that I want to make this an automatic affair, so I want that this shell should first read the parameter, LOG_ARCHIVE_DEST, get the archive destination from there and see if the file system is more than 80% or not?

so i think i will first connect to an sqlplus session and get this going in the shell.

any more ideas, appreciate it.
viraj  

--

On Mon, 25 Jun 2001 21:40:30  
 Jared Still wrote:

>On Monday 25 June 2001 20:00, Viraj Luthra wrote:
>> Hello all,
>>
>> I had seen a unix shell script on this list, which basically checks the
>> space availability for the archive log. If the space is less than 10%
>> available for the archive log, then it can send a pager or email stating
>> that.
>
>Here, I whipped one up for you, completely untested.
>
>Your mission, should you choose to accept it, is to
>complete the missing portions. This would include
>a correct email address ( or pager address ), the
>appropriate action to take when the filesystem is
>too full, and of course, specifying the correct
>filesytem to check.
>
>And of course, make sure it works.
>
>This message will never self destruct, as I'm sure
>there are several unknown servers archiving this
>entire list to parts unknown.
>
>Jared
>
>----------------
>#!/usr/bin/ksh
>
>USRBIN=/usr/bin
>BIN=/bin
>
>MAILX=$USRBIN/mailx
>AWK=$USRBIN/awk
>CUT=$USRBIN/cut
>DF=$BIN/df
>GREP=$USRBIN/grep
>DATE=$BIN/date
>FIND=$USRBIN/find
>RM=$BIN/rm
>XARGS=$USRBIN/xargs
>
>FILESYSTEM=/u02
>ARCH_DIR=$FILESYSTEM/arch/db01
>
>MAX_PCT_USED=20
>
>ADDRESS=dba_at_oracle.com
>
>PCT_USED=$($DF -k /u02 | $GREP -v ^Filesystem | $AWK '{ print $5 }' | $CUT -d% -f1)
>
>echo PCT USED: $PCT_USED
>
>[ $PCT_USED -gt $MAX_PCT_USED ] && {
>
> # log your actions here in some log file
> # LOGDATE=$( $DATE +%Y%m%d:%H%M%S )
> # LOGFILE=$ORACLE_HOME/admin/bdump/archive_move.log
> # echo $LOGDATE - cleaning up log dir
>
> # tell somebody
> echo "filesystem $FILESYSTEM is $PCT_USED full " | $MAILX -s 'Hey! Cleaning
>up archive logs' $ADDRESS
>
> for f in $( $FIND $ARCH_DIR -name "arch*.log" -print )
> do
> $ECHO $f
> #$ECHO $f >> $LOGFILE
>
> # remove file?
> #$RM $f
>
> # ftp file somewhere, back it up, etc...
> # your commands here
>
>
> done
>
>
>}
>
>
>
>--
>Please see the official ORACLE-L FAQ: http://www.orafaq.com
>--
>Author: Jared Still
> INET: jkstill_at_cybcon.com
>
>Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
>San Diego, California -- Public Internet access / Mailing Lists
>--------------------------------------------------------------------
>To REMOVE yourself from this mailing list, send an E-Mail message
>to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
>the message BODY, include a line containing: UNSUB ORACLE-L
>(or the name of mailing list you want to be removed from). You may
>also send the HELP command for other information (like subscribing).
>
Get 250 color business cards for FREE! http://businesscards.lycos.com/vp/fastpath/ -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Viraj Luthra INET: viraj999_at_lycos.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Received on Tue Jun 26 2001 - 01:21:53 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US