Rob (Jo?),
 
This is from the Oracle8i docs (Chapter 5 of "Oracle8i Standby Database Concepts and Administration"), but it's so basic that I believe it would apply to 8.0
 
...
9.Write a script that you can periodically run to check the log files in the managed recovery directory and move
          the log files that have a specified timestamp to the manual recovery directory. If new redo logs are being moved,
          start the manual recovery mode and apply the newly moved redo logs.
 
          The following PERL script performs what is outlined in this step:
 
          #!/usr/local/bin/perl
 
          #How many hours the standby database should lag behind the primary database
          $LAG_HOUR = 4;
 
          #The manual recovery directory
          $DEST_DIR = '/fs2/oracle/stdby/';
 
          #The flag for whether there are new logs to be applied.
          $needApply = 0;
 
          #Check the managed recovery directory
          while ( </fs2/oracle/stby_log/*.arc> ) {
              # Get the timestamp of the file
              $file_time = (stat($_))[9];
              # See if the file is "old enough"
              if ( time-$file_time > $LAG_HOUR*60*60 ) {
                  print  "mv $_ $DEST_DIR\n";
                  system "mv $_ $DEST_DIR";
                  $needApply = 1;
               }
          }
          #If redo logs were moved in this round, apply them
          if ( $needApply == 1 ) {
              system "/usr/Lagged_Standby/ApplyLog";
          }
 
          The SHELL script (/usr/Lagged_Standby/ApplyLog) used to apply the redo logs consists of the following:
 
          sqlplus internal << EOF
 
              recover automatic standby database;
              cancel
              exit
 
          EOF
 

       10.Refer to your platform-specific documentation for information on how to create a job that is triggered at specific
          times throughout the day.
 
          For example, in UNIX, you can write a CRON job file. Issue the man crontab command at the UNIX
          command shell to get help on how to write a CRON job file.
...
 
Jack

--------------------------------
Jack C. Applewhite
Database Administrator/Developer
OCP Oracle8 DBA
iNetProfit, Inc.
Austin, Texas
www.iNetProfit.com
[EMAIL PROTECTED]
(512)327-9068

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jo King
Sent: Wednesday, August 29, 2001 1:23 PM
To: Multiple recipients of list ORACLE-L
Subject: Auto log apply to standby db using Perl

 
 
        Environment is NT4 with Oracle 8.0.5.
 
        I wish to automate the procedure for applying the archive logs to a
        standby database. The logs are automatically transferred to standby
        destination 'area'.
        I am planning to use Perl (currently learning) to perform this. After 
        gaining connectivity to database via svrmgr30 and issuing command : -
                 recover automatic standby database; 
         I'm NOT sure how to go about coding ( 'stacking') responses to ..
        "Archive file not found message..". when there are no longer any more
        archive files to apply.
 
       I wish to respond cancel to the standard message : -
                Enter <RET>...........<CANCEL>....
       and then exit out of svrmgr30.
 
        If anybody has a Perl script for handling such a situation (or similar) or 
        could give me an example on how to achieve, I'd be very grateful.
 
        /Rob 
 

Reply via email to