Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Auto log apply to standby db using Perl
Rob
(Jo?),
<SPAN
class=156590918-29082001>
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
<SPAN
class=156590918-29082001>
<SPAN
class=156590918-29082001>...
<SPAN
class=156590918-29082001>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.
<SPAN
class=156590918-29082001>
The following PERL script performs what is outlined in this step:
<SPAN
class=156590918-29082001>
#!/usr/local/bin/perl
<SPAN
class=156590918-29082001>
#How many hours the standby database should lag behind the primary
database $LAG_HOUR =
4;
<SPAN
class=156590918-29082001>
#The manual recovery
directory $DEST_DIR =
'/fs2/oracle/stdby/';
<SPAN
class=156590918-29082001>
#The flag for whether there are new logs to be
applied. $needApply =
0;
<SPAN
class=156590918-29082001>
#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 )
{
$DEST_DIR\n";
$DEST_DIR";
1; } } #If redo logs were
--------------------------------Jack C.ApplewhiteDatabase Administrator/DeveloperOCP Oracle8 DBAiNetProfit, Inc.Austin,
<FONT face=Tahoma
size=2>-----Original Message-----From: root_at_fatcity.com
[mailto:root_at_fatcity.com]On Behalf Of Jo KingSent:
Wednesday, August 29, 2001 1:23 PMTo: Multiple recipients of list
ORACLE-LSubject: Auto log apply to standby db using
Perl
Environment
could give
me an example on how to achieve, I'd be
very grateful.
<FONT face=Arial
size=2> <FONT face=Arial
size=2>/Rob
Received on Wed Aug 29 2001 - 13:01:16 CDT
![]() |
![]() |