Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

41028

October 8th, 2014 12:00

Avamar/Oracle RMAN clone from backup with RMAN DUPLICATE???

Is anyone having success cloning Oracle databases from an Avamar backup using RMAN? We are able to backup up and restore, but are stuck with the scenario of restoring (DUPLICATE'ing) an Avamar/RMAN backup from one host to a new instance on another host.

The documentation for this plug in is somewhat lacking, confusing, and sparse. Here's a couple working examples for an RMAN-initiated backup and recovery scripts, then an example of a RMAN DUPLICATE script causing an error (We use ASM, btw):

Backup (works):

run{

allocate channel c1 type sbt PARMS="SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so ENV=(PATH=/bin:/usr/local/avamar/bin)";

send channel='c1' '"--flagfile=/usr/local/avamar/etc/avtar-flags.txt" "--logfile=/var/avamar/c1_qebs_avoracle.log" "--bindir=/usr/local/avamar/bin" "--cacheprefix=c1_qebs"';

crosscheck backup;

backup format 'df_%d_%T_%s_%U' database;

crosscheck archivelog all;

backup format 'al_%d_%T_%s_%U' archivelog all not backed up 1 times;

release channel c1;

}

Recovery to same instance/host (works):

set dbid=1234;

run{

allocate channel c1 type sbt PARMS="SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so ENV=(PATH=/bin:/usr/local/avamar/bin)";

send channel='c1' '"--flagfile=/usr/local/avamar/etc/avtar-flags.txt"

"--logfile=/var/avamar/c1_QEBS_avoracle.log" "--bindir=/usr/local/avamar/bin"’;

restore controlfile;

startup mount;

restore database;

recover database;

release channel c1;

}

Clone/Duplicate from hostA "QVCP" backup to hostB instance "IVCP" (does not work):

# Startup database

sqlplus / as sysdba <

startup nomount

EOF

# Start the duplication using RMAN:

$ORACLE_HOME/bin/rman catalog lrman/$PWRMAN@lrepo auxiliary / target sys/$PWSYST@qvcp

RUN {

allocate auxiliary channel c1 type sbt PARMS="SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so ENV=(PATH=/bin:/usr/local/avamar/bin)";


send channel='c1' '"--flagfile=/usr/local/avamar/etc/avtar-flags.txt" "--logfile=/var/avamar/c1_IVCP_avoracle.log" "--bindir=/usr/local/avamar/bin" ';

DUPLICATE DATABASE QVCP DBID 2812146303 TO "IVCP"

db_file_name_convert=('+QADISKGRPHIGH','+DEVDISKGRPHIGH')

logfile group 1 ('+DEVDISKGRPHIGH') size 1g,

        group 2 ('+DEVDISKGRPHIGH') size 1g,

        group 3 ('+DEVDISKGRPHIGH') size 1g,

        group 4 ('+DEVDISKGRPHIGH') size 1g;

}

Starting restore at 07-OCT-2014 11:21:54

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of Duplicate Db command at 10/07/2014 11:22:04

RMAN-05501: aborting duplication of target database

RMAN-03015: error occurred in stored script Memory Script

ORA-27191: sbtinfo2 returned error

Additional information: 3474

10/07 11:25 Removed spfile. Restarted.

Starting restore at 07-OCT-2014 11:26:31

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of Duplicate Db command at 10/07/2014 11:26:32

RMAN-05501: aborting duplication of target database

RMAN-03015: error occurred in stored script Memory Script

ORA-27191: sbtinfo2 returned error

Additional information: 3474

10 Posts

October 22nd, 2014 07:00

Here's the 'fix' we ended up with:

This example is an instance clone/refresh of a backup taken on the same host.

We are restoring to instance "NEW" from backup of instance "TEST".

We are using ASM for our datafiles, and 2 RMAN channels.

So we'll connect to "NEW" using sqlplus, drop the database, and put it in "startup nomount", ready for a clone/restore.

"su - " to oracle user that has access to instance "NEW" and prepare the instance:

# Drop, Startup database:

sqlplus / as sysdba <

shutdown abort

startup mount restrict

REM drop database ;

shutdown abort

startup nomount

EOF

Set up your environment, execute RMAN, connecting to target (TEST), aux (NEW) and catalog:

# su - oracle-user

# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/avamar/lib

We can now execute RMAN. (connect to target, auxiliary and catalog)

# rman target sys/SYS_PASSWORD@TEMP auxiliary / catalog CAT_USER/CAT_PASSWORD@CATALOG

DUPLICATE the backed up TEMP instance to NEW, renaming the files/paths (ASM in this example) appropriately.

----------------START RMAN DUPLICATE SCRIPT----------------

RUN {

ALLOCATE auxiliary channel x1 type sbt_tape PARMS 'SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so ENV=(PATH=/bin:/usr/local/avamar/bin)'

SEND '"--flagfile=/usr/local/avamar/etc/avtar-flags.txt" "--logfile=/var/avamar/x1_NEW_avoracle.log" "--bindir=/usr/local/avamar/bin"';

ALLOCATE auxiliary channel x2 type sbt_tape PARMS 'SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so ENV=(PATH=/bin:/usr/local/avamar/bin)'

SEND '"--flagfile=/usr/local/avamar/etc/avtar-flags.txt" "--logfile=/var/avamar/x2_NEW_avoracle.log" "--bindir=/usr/local/avamar/bin"';

DUPLICATE TARGET DATABASE TO NEW db_file_name_convert=('+ASMDISKGROUP/TEMP','+ASMDISKGROUP/NEW')

logfile group 1 ('+ASMDISKGROUP') size 1g,

        group 2 ('+ASMDISKGROUP') size 1g,

        group 3 ('+ASMDISKGROUP') size 1g,

        group 4 ('+ASMDISKGROUP') size 1g;

}

----------------END RMAN DUPLICATE SCRIPT----------------

Note: Merged SEND cmd into ALLOCATE cmd in the above example.

Note: The spfile must exist, and the db_name and db_unique_name and ORACLE_SID should all match.

Note: The avtar-flags file must be from the server where the source db was backed up from.

No Events found!

Top