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

Home -> Community -> Usenet -> c.d.o.server -> Re: Hot Backup issue (DBA only) ...

Re: Hot Backup issue (DBA only) ...

From: Gollum <gollum.NOSPAM_at_image.dk>
Date: Fri, 04 Feb 2000 21:28:36 GMT
Message-ID: <389b41ff.4669684@news.image.dk>


What about this:

#!/bin/sh

SCN=99 # Highest SCN to remove

while [ $SCN -gt 0 ] ; do

	# Use printf() function of awk to format filename
	ARCFILE=`echo $SCN | awk '{printf("arc%.7d.log",$1);}'`

	# If file exists, remove it. Otherwise no more files to
	# remove, so break out of loop (or your sequence is
	# broken).
	if [ -f $ARCFILE ] ; then
		rm $ARCFILE
	else
		break
	fi

	# Decrement SCN with 1
	SCN=`expr $SCN - 1`

done

Cheers,
Gollum

On Thu, 3 Feb 2000 23:01:49 +0200, "Zeev Milin" <zeev.milin_at_dealtime.com> wrote:

>Hi all.
>
>I would like to delete archive-log files that are generated before some
>seq#.
>Hot backup script i use:
>
>>archive log list; --1
>.... <hot backup commands> ...
>>archive log list; --2
>
>I would like to delete all archive logs that are useless (before old seq#)
>in script right after the backup;
>ex:
> If the first archive log list comand returns oldest archive sequence no.
>of 100,
> i need to delete them dynamicly in script using the returned value (not
>enough storage to keep them).
>
> rm arc0000001.log
> ...
> rm arc0000098.log
> rm arc0000099.log
>
>If anyone wrote such script(Unix/NT), please help.
>thanks.
>
>
>
Received on Fri Feb 04 2000 - 15:28:36 CST

Original text of this message

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