We're here to help!

Manual Copy Archive Logs from Primary to Standby (Dbvisit ARCHDEST)

Follow
Description

Dbvisit Standby Version 7, renames the archive logs when it copies them from the Primary to the Standby. But if for some reason you have to do it manually once-off, you have two options:

  1. Copy the archive logs from primary to standby (Dbvisit ARCHDEST location), rename the files and then run dbvisit to apply logs.
  2. Copy the archive logs from primary to standby (Dbvisit ARCHDEST location), use RMAN to catalog the files and then apply them using RMAN.
Solution

Option 1: Copy and Rename Files

Dbvisit Standby renames the archive logs to:

<thread>_<sequence>_<resetlogs\_id><STANDBY\_ARCHIVELOG\_NAME\_EXTENSION>

Where STANDBY_ARCHIVELOG_NAME_EXTENSION defaults to .arc

Example: 1_45628_ 812975118.arc

Example archivelog name prior to rename: o1_mf_1_5243_9bzhlbjl_.arc

Dbvisit Standby version 7 will not pickup this file and you will see output like this:

dbvisit devdb
=============================================================
Dbvisit Standby Database Technology (7.0.03.11530) (pid 20968)
dbvisit started on dbvlin502: Sun Jan 5 16:24:36 2014 ()

Sending heartbeat message... - done.
Log file(s) for devdb from dbvlin501 will be applied to dbvlin502
No new logs to apply.
No Mail sent as SEND_MAIL_FLAG_DR = N

=============================================================
dbvisit ended on dbvlin502: Sun Jan 5 16:24:42 2014

You have to rename the file to the correct format Dbvisit Standby expects on the standby:

oracle@dbvlin502[/u01/app/oracle/archive/devdb]: mv o1_mf_1_5243_9bzhlbjl_.arc 1_5243_799696346.arc

The above rename (mv on unix) renames the log from thread 1 sequence 5243 to the format thread#_sequence#_resetlogs_id.arc

The Resetlogs_id can be obtained from v$archived_log:

SQL> select resetlogs_id from v$archived_log where thread#=1 and sequence#=5243;
RESETLOGS_ID
799696346

Option 2: Using RMAN

You can manually copy all the archive logs to the standby database server into the Dbvisit Standby ARCHDEST location.

Catalog the archive logs and then recover the database.

Example

oracle@dbvlin502[/u01/app/oracle/archive/devdb]: ls -l
total 69820
-rw-r----- 1 oracle oinstall 24064 Jan 5 16:38 o1_mf_1_5240_9bz4sr9j_.arc
-rw-r----- 1 oracle oinstall 17920 Jan 5 16:38 o1_mf_1_5241_9bz51v2l_.arc
-rw-r----- 1 oracle oinstall 671232 Jan 5 16:38 o1_mf_1_5242_9bz5cwjq_.arc
-rw-r----- 1 oracle oinstall 10087936 Jan 5 16:38 o1_mf_1_5243_9bzhlbjl_.arc
-rw-r----- 1 oracle oinstall 10087936 Jan 5 16:38 o1_mf_1_5244_9bzhln3b_.arc
-rw-r----- 1 oracle oinstall 10087936 Jan 5 16:38 o1_mf_1_5245_9bzhs5kb_.arc
-rw-r----- 1 oracle oinstall 10087936 Jan 5 16:38 o1_mf_1_5246_9bzhs70n_.arc
-rw-r----- 1 oracle oinstall 10087936 Jan 5 16:38 o1_mf_1_5247_9bzhs892_.arc
-rw-r----- 1 oracle oinstall 10087936 Jan 5 16:38 o1_mf_1_5248_9bzpmq73_.arc
-rw-r----- 1 oracle oinstall 10085376 Jan 5 16:38 o1_mf_1_5249_9c1ccr1k_.arc

oracle@dbvlin502[/u01/app/oracle/archive/devdb]: rman
Recovery Manager: Release 10.2.0.1.0 - Production on Sun Jan 5 16:38:56 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
RMAN>

RMAN> connect target /
connected to target database: DEVDB (DBID=704426330, not open)

RMAN> catalog start with '/u01/app/oracle/archive/devdb';
using target database control file instead of recovery catalog
searching for all files that match the pattern /u01/app/oracle/archive/devdb
List of Files Unknown to the Database
File Name: /u01/app/oracle/archive/devdb/o1_mf_1_5240_9bz4sr9j_.arc
File Name: /u01/app/oracle/archive/devdb/o1_mf_1_5241_9bz51v2l_.arc
File Name: /u01/app/oracle/archive/devdb/o1_mf_1_5242_9bz5cwjq_.arc
File Name: /u01/app/oracle/archive/devdb/o1_mf_1_5243_9bzhlbjl_.arc
File Name: /u01/app/oracle/archive/devdb/o1_mf_1_5244_9bzhln3b_.arc
File Name: /u01/app/oracle/archive/devdb/o1_mf_1_5245_9bzhs5kb_.arc
File Name: /u01/app/oracle/archive/devdb/o1_mf_1_5246_9bzhs70n_.arc
File Name: /u01/app/oracle/archive/devdb/o1_mf_1_5247_9bzhs892_.arc
File Name: /u01/app/oracle/archive/devdb/o1_mf_1_5248_9bzpmq73_.arc
File Name: /u01/app/oracle/archive/devdb/o1_mf_1_5249_9c1ccr1k_.arc
Do you really want to catalog the above files (enter YES or NO)? YES
cataloging files...
cataloging done
List of Cataloged Files
File Name: /u01/app/oracle/archive/devdb/o1_mf_1_5240_9bz4sr9j_.arc
File Name: /u01/app/oracle/archive/devdb/o1_mf_1_5241_9bz51v2l_.arc
File Name: /u01/app/oracle/archive/devdb/o1_mf_1_5242_9bz5cwjq_.arc
File Name: /u01/app/oracle/archive/devdb/o1_mf_1_5243_9bzhlbjl_.arc
File Name: /u01/app/oracle/archive/devdb/o1_mf_1_5244_9bzhln3b_.arc
File Name: /u01/app/oracle/archive/devdb/o1_mf_1_5245_9bzhs5kb_.arc
File Name: /u01/app/oracle/archive/devdb/o1_mf_1_5246_9bzhs70n_.arc
File Name: /u01/app/oracle/archive/devdb/o1_mf_1_5247_9bzhs892_.arc
File Name: /u01/app/oracle/archive/devdb/o1_mf_1_5248_9bzpmq73_.arc
File Name: /u01/app/oracle/archive/devdb/o1_mf_1_5249_9c1ccr1k_.arc

RMAN> recover database;
Starting recover at 05/01/2014:16:39:36
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=159 devtype=DISK
starting media recovery
archive log thread 1 sequence 5244 is already on disk as file /u01/app/oracle/archive/devdb/o1_mf_1_5244_9bzhln3b_.arc
archive log thread 1 sequence 5245 is already on disk as file /u01/app/oracle/archive/devdb/o1_mf_1_5245_9bzhs5kb_.arc
archive log thread 1 sequence 5246 is already on disk as file /u01/app/oracle/archive/devdb/o1_mf_1_5246_9bzhs70n_.arc
archive log thread 1 sequence 5247 is already on disk as file /u01/app/oracle/archive/devdb/o1_mf_1_5247_9bzhs892_.arc
archive log thread 1 sequence 5248 is already on disk as file /u01/app/oracle/archive/devdb/o1_mf_1_5248_9bzpmq73_.arc
archive log thread 1 sequence 5249 is already on disk as file /u01/app/oracle/archive/devdb/o1_mf_1_5249_9c1ccr1k_.arc
archive log filename=/u01/app/oracle/archive/devdb/o1_mf_1_5244_9bzhln3b_.arc thread=1 sequence=5244
archive log filename=/u01/app/oracle/archive/devdb/o1_mf_1_5245_9bzhs5kb_.arc thread=1 sequence=5245
archive log filename=/u01/app/oracle/archive/devdb/o1_mf_1_5246_9bzhs70n_.arc thread=1 sequence=5246
archive log filename=/u01/app/oracle/archive/devdb/o1_mf_1_5247_9bzhs892_.arc thread=1 sequence=5247
archive log filename=/u01/app/oracle/archive/devdb/o1_mf_1_5248_9bzpmq73_.arc thread=1 sequence=5248
archive log filename=/u01/app/oracle/archive/devdb/o1_mf_1_5249_9c1ccr1k_.arc thread=1 sequence=5249
unable to find archive log
archive log thread=1 sequence=5250
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 01/05/2014 16:40:08
RMAN-06054: media recovery requesting unknown log: thread 1 seq 5250 lowscn 14528020
RMAN>

The error above is due to RMAN looking for the next log for recovery which does not exit yet. This can be ignored in this case.

Once this is done you can run

dbvisit -R <DDC> (Version 7.0)
dbvctl -d <DDC> -R (Version 8.0)

from the primary database and then continue to run Dbvisit as normal after that.

Anton Els January 06, 2014 10:54

Have more questions? Submit a request

Comments