archived redo log destination [message #61962] |
Mon, 14 June 2004 06:26 |
Paul Krause
Messages: 1 Registered: June 2004
|
Junior Member |
|
|
Hi all -- just a quick question here. I apologize if this question has been answered elsewhere. I checked these forums as well as Google groups, but was unable to find the answer.
I'm working on a backup script for Oracle 9.2 here, and I need a reliable way (or a couple of ways) to find the destination directory for the archived redo logs. I have trying to rely on the log_archive_dest (1,2) parameters in v$parameter, but since we have several customers, not all databases are carbon copies. Some are fresh Oracle 9.2 installs, and some are Oracle 7.3 migrations. The one particular instance I found this morning had null for each and every log_archive_dest_* parameter.
Is there somewhere in the registry to find the destination for archived redo logs? Or is there perhaps another table that I could check? I see v$archived_log, but I was hoping that there would be a simpler method than parsing out a directory name from there.
Thanks,
Paul
|
|
|
Re: archived redo log destination [message #61965 is a reply to message #61962] |
Mon, 14 June 2004 09:26 |
Frank Naude
Messages: 4589 Registered: April 1998
|
Senior Member |
|
|
Hi Paul,
You can get that from v$archived_log. Here is an example:
SQL> connect / as sysdba
Connected.
SQL> alter session set nls_date_format = 'DD Mon YYYY HH24:MI:SS';
Session altered.
SQL> -- Create test archlog directories...
SQL> ! mkdir /tmp/dir1
SQL> ! mkdir /tmp/dir2
SQL> -- Swicth to DIR1 and switch log...
SQL> alter system set log_archive_dest_1 = 'location=/tmp/dir1' scope=memory;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> -- Swicth to DIR2 and switch log...
SQL> alter system set log_archive_dest_1 = 'location=/tmp/dir2' scope=memory;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> -- List archived locations...
SQL> col NAME format a30
SQL> select THREAD#, SEQUENCE#, NAME, ARCHIVED, COMPLETION_TIME from v$archived_log;
THREAD# SEQUENCE# NAME ARC COMPLETION_TIME
---------- ---------- ------------------------------ --- --------------------
1 81 /tmp/dir1/1_81_525556110.dbf YES 14 Jun 2004 19:31:36
1 82 /tmp/dir2/1_82_525556110.dbf YES 14 Jun 2004 19:31:36
Best regards.
Frank
|
|
|