Re: Archived logs backup

2002-12-08 Thread Yechiel Adar



Hello Vladimir

We decided to separate the copy of the archive logs to 
tape and the deletion of them. This copy is run several times during the 
day.

So, copy all the archive logs to tape without delete and 
once a day delete all archive logs older then one day. This way you have 
multiple copies of the archive logs on tape, in case one of the copies has an 
error. You have the last day of archived logs online for speedy recovery and no 
problems with archive logs that were created just as you copy them.

Yechiel AdarMehish

  - Original Message - 
  From: 
  Vladimir Barac 
  
  To: Multiple recipients of list ORACLE-L 
  Sent: Thursday, December 05, 2002 12:53 
  PM
  Subject: Archived logs backup
  
  Hi!
  
  I want to write unix script to automate 
  archved logs backup to tape ... After hot backup of data filesis 
  completed...
  
  Within script how do I skip archived 
  log file that is being written by oracle?
  
  Thanks,
  Vladimir Barac
  


Re: Archived logs backup

2002-12-05 Thread Markus Reger
must be currently reserved/open for writing. try lsof to find out yr file to be 
excluded.
kr mr

 [EMAIL PROTECTED] 12/05/02 12:32 PM 
Hi!

I want to write unix script to automate archved logs backup to tape ... After hot 
backup of data files is completed...

Within script how do I skip archived log file that is being written by oracle?

Thanks,
Vladimir Barac

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Markus Reger
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (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).




Re: Archived logs backup

2002-12-05 Thread Tim Gorman
more portable to query V$ARCHIVED_LOG after runninig ARCHIVE LOG ALL instead
of using OS utilities...

- Original Message -
To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
Sent: Thursday, December 05, 2002 5:18 AM


 must be currently reserved/open for writing. try lsof to find out yr file
to be excluded.
 kr mr

  [EMAIL PROTECTED] 12/05/02 12:32 PM 
 Hi!

 I want to write unix script to automate archved logs backup to tape ...
After hot backup of data files is completed...

 Within script how do I skip archived log file that is being written by
oracle?

 Thanks,
 Vladimir Barac

 --
 Please see the official ORACLE-L FAQ: http://www.orafaq.com
 --
 Author: Markus Reger
   INET: [EMAIL PROTECTED]

 Fat City Network Services-- 858-538-5051 http://www.fatcity.com
 San Diego, California-- Mailing list and web hosting services
 -
 To REMOVE yourself from this mailing list, send an E-Mail message
 to: [EMAIL PROTECTED] (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).


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Tim Gorman
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (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).




RE: Archived logs backup

2002-12-05 Thread Stephen Lee

-Original Message-
Within script how do I skip archived log file that is being written by
oracle?
-

I took another look at this and figured out what you were really asking.
The commands: ls -1rt or ls -1t will list the files in the directory and
sort according to time.  Note that the 1 is a one.  This will allow you to
see the most recent files.  If you would like to keep the two most recent
then something like:

#!/bin/ksh

COUNT=0
for i in `ls -1t *.dbf`; do
   COUNT=$(( $COUNT + 1 ))
   if [ $COUNT -gt 2 ]; then
  SEND $i TO TAPE
  if [ $? -ne 0 ]; then
 print SOMETHING BROKE
  else
 rm $i
 (or maybe safer to move it to a pre-delete filesystem, then delete
it later)
  fi
   fi
done
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Stephen Lee
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (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).




RE: Archived logs backup

2002-12-05 Thread Stephen Lee

-Original Message-
I want to write unix script to automate archved logs backup to tape ...
After hot backup of data files is completed...

Within script how do I skip archived log file that is being written by
oracle?
---

Here is my crontab entry (paste it back together).  The 70 means start a
backup if the archive directory hits 70% full.  This does NOT run around the
time when the normal backup is running.

0,30 1-18 * * * /oracle/app/oracle/admin/dbascripts/rman/check_arch_dir.ksh
70  /oracle/app/oracle/admin/dbascripts/rman/arch_debug 21

Here is my script (which calls the backup script)

- Snip --
#!/bin/ksh

PERCENT1=`/usr/bin/df -k /z01 | /usr/bin/nawk 'NR == 2 {print
substr($5,1,match($5,%)-1)}'`
PERCENT2=`/usr/bin/df -k /z02 | /usr/bin/nawk 'NR == 2 {print
substr($5,1,match($5,%)-1)}'`
PERCENT3=`/usr/bin/df -k /z03 | /usr/bin/nawk 'NR == 2 {print
substr($5,1,match($5,%)-1)}'`
PERCENT4=`/usr/bin/df -k /z04 | /usr/bin/nawk 'NR == 2 {print
substr($5,1,match($5,%)-1)}'`

PERCENT1=`echo $PERCENT1 | /usr/bin/sed 's/[^0-9]*//g'`
PERCENT2=`echo $PERCENT2 | /usr/bin/sed 's/[^0-9]*//g'`
PERCENT3=`echo $PERCENT3 | /usr/bin/sed 's/[^0-9]*//g'`
PERCENT4=`echo $PERCENT4 | /usr/bin/sed 's/[^0-9]*//g'`

if [ -z $PERCENT1 ]; then PERCENT1=0; fi
if [ -z $PERCENT2 ]; then PERCENT2=0; fi
if [ -z $PERCENT3 ]; then PERCENT3=0; fi
if [ -z $PERCENT4 ]; then PERCENT4=0; fi

if [ $PERCENT1 -gt $PERCENT2 ]; then
   PERCENT=$PERCENT1
else
   PERCENT=$PERCENT2
fi

if [ $PERCENT3 -gt $PERCENT ]; then
   PERCENT=$PERCENT3
fi

if [ $PERCENT4 -gt $PERCENT ]; then
   PERCENT=$PERCENT4
fi

THRESHOLD=$1
if [ -z $THRESHOLD ]; then
   THRESHOLD=50
fi
if [ $PERCENT -gt $THRESHOLD ]; then
   /oracle/app/oracle/admin/dbascripts/rman/backup.ksh ARCH ALL 
/oracle/app/oracle/admin/dbascripts/rman/debug 21
fi

exit 0
-- Snip --

The backup.ksh script is a 1559 line big boy I wrote to automate a lot of
stuff and do a lot checking and verifying.  I don't think you want to see
it.  One thing that might be of interest is a C (not PERL!) frontend I wrote
to make SUID oracle so a non-oracle operator can start a backup by hand if
needed without us opening the permissions on any of our security-sensitive
areas.
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Stephen Lee
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (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).




Re: Archived logs backup

2002-12-05 Thread Markus Reger
if it's not just running ...
... bur i agree it's MOST portable yr way
kr mr

 [EMAIL PROTECTED] 12/05/02 15:48 PM 
more portable to query V$ARCHIVED_LOG after runninig ARCHIVE LOG ALL instead
of using OS utilities...

- Original Message -
To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
Sent: Thursday, December 05, 2002 5:18 AM


 must be currently reserved/open for writing. try lsof to find out yr file
to be excluded.
 kr mr

  [EMAIL PROTECTED] 12/05/02 12:32 PM 
 Hi!

 I want to write unix script to automate archved logs backup to tape ...
After hot backup of data files is completed...

 Within script how do I skip archived log file that is being written by
oracle?

 Thanks,
 Vladimir Barac

 --
 Please see the official ORACLE-L FAQ: http://www.orafaq.com
 --
 Author: Markus Reger
   INET: [EMAIL PROTECTED]

 Fat City Network Services-- 858-538-5051 http://www.fatcity.com
 San Diego, California-- Mailing list and web hosting services
 -
 To REMOVE yourself from this mailing list, send an E-Mail message
 to: [EMAIL PROTECTED] (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).


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Tim Gorman
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (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).


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Markus Reger
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (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).