Quick Tips

Duplicate target database for standby backup location

We are installing a standby database for DR side. One of our database is about 10TB and generating daily 500-700Gb archive logs.

Taking tape backups, duplicating them, sending to another city and then finishing restore takes 3-3.5 days long around.

in that period 1.5 TB archive had been generated. Sending these archive logs or taking incremental backup and send via ftp a little bit headache.

So we decided to take clone copy (we said BCV) of that database, take compresses full backup set, ftp to another city and restore.

On production side:

SQL> alter database begin backup

On clone side:

/SYMCLI/V7.1.2/bin/symclone -sid 78 -f /oracle/BCV/xxxpre0_BCV_XXX_devices recreate -noprompt

/SYMCLI/V7.1.2/bin/symclone -sid 78 -f /oracle/BCV/xxxpre0_BCV_XXX_devices activate -noprompt

On production side:

SQL> alter database end backup

On clone side:

SQL> startup mount;

So we can start taking backup.

[xxx:yyyy]@/oracle/dba/rman$ cat rman.cold.DB.full.sh

# TODO: Before running this script
# sqlplus /nolog
# conn / as sysdba
# shutdown immediate
# startup mount
# alter system set large_pool_size=1G;

export ORACLE_HOME=/oracle/product/11.2.0/db

rman target=/ nocatalog cmdfile=rman.cold.DB.full.rman log=rman.cold.DB.full.log

[xxx:yyyy]@/oracle/dba/rman$ cat rman.cold.DB.full.rman

configure controlfile autobackup on;

show all;

allocate channel c1  type disk format ‘/fra/rman_backup/db_%p_%s_%T.bkp’;
allocate channel c2  type disk format ‘/fra/rman_backup/db_%p_%s_%T.bkp’;
#64 channel opened here

backup as compressed backupset database SECTION SIZE=48G TAG ‘DB_FULL_20120218’;
backup current controlfile TAG ‘DB_FULL_20120218_CTL’;
backup spfile TAG ‘DB_FULL_20120218_SPF’;

release channel c1;
release channel c2;

#64 channel released here



so backup was finished about 7 hours with 64 channel and 100% cpu usage with total size about 1.5TB

So we can ftp  the backup files to DR side with 10 parallel ftp session taking about 8 hours.

Now we can start to restore that backup set for standby. we got initDB.ora parameter from prod and we did some changes on it.

SQL>startup nomount

[[email protected]:DB]/oracle/dba/rman$ vi rman.restore.DB.rman

allocate auxiliary channel c1  type disk ;
allocate auxiliary channel c2  type disk ;
#64 channel was used

duplicate target database for standby
backup location=’/orabackup1/db_full/’

release channel c1;
release channel c2;

#64 channel was released.


Restore operation had finished about 6 hours. So totally 23 hours standby DB had been ready for applying archives;

SQL>alter database recover managed standby database disconnect from session;

So our stand by database was ready and sync with production about 6 hours later.