Step-By-Step Guide To Create Physical Standby On Normal File System For ASM Primary using RMAN

ruanrong發表於2011-05-02

Purpose

This Article cover the detailed steps for creating a physcial standby database on a normal file system using RMAN for a primary database in ASM.

[@more@]

Step-By-Step Guide To Create Physical Standby On Normal File System For ASM Primary using RMAN

Overview

Here the Standby database can be created using the following 2 methods

1. Normal Restore and Recovery using RMAN.
2. Creating a Duplicate database for Standby using RMAN.


Method 1

+ Perform the backup of the ASM primary database ( Datafiles, Controlfile for
standby and Archivelogs )
+ Make the backup pieces available on the Standby server .
+ Create the parameter file and password file on standby.
+ Configure Oracle net services on both the servers.
+ Perform restore and Recovery on standby database.
+ Configure the primary database to transfer the archives to standby
+ Kick start the Redo apply by putting the database in Recover managed mode.

Method 2

Use RMAN Duplicate feature to create the standby database . Steps to accomplish the same are outlined in the following article. Note 787793.1 : Creating a physical standby from ASM primary

Steps to accomplish Method 1

1 - Perform the backup of the ASM primary database ( Datafiles, Controlfile for standby
& Archivelogs )

$ rman target /

RMAN>backup database format '/backup/database_%U.bkp';
RMAN>backup archivelog format '/backup/archivelog_%U.bkp';
RMAN>backup current controlfile for standby format '/backup/stdb_cntl_%U.bkp';

Note : For disk RMAN backup take backup to file system. You can also take backup directly to Tape using Media Manager

2. Make the backup pieces available on the Standby server

++ FTP or SCP the backup pieces to standby server. While doing FTP make sure
to do it in binary mode only. OR
++ NFS mount then mount the NFS on standby server with the same name as you
mounted on primary database. OR
++ If the backups are on tape then make sure that you make proper changes on
standby server so that you can restore the backups on standby server.

3. Create the parameter file & password file on standby

Copy the primary database parameter file and make necessary changes : ++ Restore the database .

db_unique_name='stnd10g'
instance_name='stnd10g'
standby_archive_dest=''
db_file_name_convert='+DATA/prim10g/datafile/','/u01/oradata/stnd10g/','+DATA/prim10g/tempfile/','/u01/oradata/stnd10g/' log_file_name_convert='+DATA/prim10g/onlinelog/','/u01/oradata/stnd10g/'

Create the password file for standby database with the same password as primary

$ export ORACLE_SID=stand10g
$ orapwd file=orapwstand10g password=oracle


4. Configure Oracle net services on both the servers

In standby server
- configure listener.
In Primary server
- configure tnsnames for standby.
- check connectivity using tnsping.

5. Perform restore and Recovery on standby database.

++ Starup Nomount the standby instance and restore the standby controlfile from
the backup of the standby_controlfile performed in step 1

$ export ORACLE_SID=stnd10g
$ rman target /
RMAN>restore standby controlfile from '/backup/stdb_cntl_3oqff2fb_.bkp';


++ Mount the database

RMAN>Alter database mount;

If backup pieces are in exactly same directory structure or if the directory structure is NFS mounted on
the standby server then directly restore the database
else
If the backup pieces are in different location you need to catalog them manually

for example

RMAN> catalog backuppiece '/backup/database_2x21kd12.bkp';

For more information on cataloging options refer the metalink Note 470463.1

+ Restore the database using the following syntax

RMAN>restore database;

+ Recover database

Get to know the last sequence available in the archivelog backup using the following command.This will help us in recovering the database till that archivelog.

RMAN > list backup of archivelog all;

Let us assume the last sequence of last archivelog in the backup is 50. Since we are recovering the database here till the archivelog sequence 50 the sequence number in the UNTIL SEQUENCE clause should be 50 (+1)

RMAN>Recover database until sequence 51;

6. Configure the primary database to transfer the archives to standby

+ Set the following parameter in the primary database :

log_archive_dest_2='SERVICE=stnd10g'

+ Perform a log switch and make sure that archive are getting transfer to standby destination.

7. Kick start the Redo apply by putting the database in Recover managed mode.

In Standby database start the managed recovery process

SQL>Recover managed standby database disconnect from session;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/1933/viewspace-1049314/,如需轉載,請註明出處,否則將追究法律責任。

相關文章