Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Help: Standby database issue
eeknoch_at_gci.net (Edward Knoch) wrote in message news:<c242a22d.0105301411.240f7e98_at_posting.google.com>...
> "ff" <cfs3526_at_ureach.com> wrote in message news:<WhKH6.7841$Aj1.3878670_at_typhoon2.ba-dsg.net>...
You can start up a Server Manager/SQL Plus session in your perl script and check one of two views - v$log or v$archived_log (actually, you can also do 'archive log list', but there's unneccessary parsing involved to get the sequence number of the last archived log.)
In v$log, you can check the largest sequence# that has a value of YES in the ARCHIVED column. That is the last archived log. Or in v$archived_log, you can check for the max(sequence) and that will be your last archived log. Since you will have a certain log format, you can reconstruct the log filename in your script (so if your format is sid_sequence#.arc, then by getting the max sequence# from v$archived_log, you can generate the filename as /your/archive/dest/directory/${ORACLE_SID}_001200.arc and then copy all files in your archive destination that have sequence# less than this one over to your backup directory. . You can do a readdir() or glob in Perl to get the filenames in the directory. Put that in a while loop and you can repeat the actions for all the files. This way you dont have to do an 'ls -l'. If you have any problems getting this to work, post the specific nature of the problem and I can give you some code snippets. I would have given one now, but I'm late for work. I'm sure others will post valuable information as well. Best of luck. Received on Fri Jun 01 2001 - 10:13:52 CDT