Tuesday, October 6, 2009

Configure Standby Database using RMAN

Configure Physical Standby Database using RMAN:
Follow the below steps to configure physical standby database using RMAN

Target Database:
Make sure the target database is mount or on open stage.

$ export ORACLE_SID TEST
$ rman target /
RMAN> show all;
Using target database controlfile instead of recovery catalog RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS;
CONFIGURE BACKUP OPTIMIZATION OFF;CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/oradata/backup/Oracle_Backups d_ F.rman';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/u01/oradata/backup/Oracle_Backups d_ F.rman';
CONFIGURE MAXSETSIZE TO UNLIMITED;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/oradata/backup/ORACLEORA92DATABASESNCFTEST.ORA';

2. Backup the current production database to create a standby database:

RMAN> backup database include current controlfile for standby plus archivelog;

3. Manually copy the backup sets from the production server to the DR Server (location of backups must match on both production and DR). Make sure all DR filesystems are identical with respect to the target database environment.

4. On the DR Server start up the TEST database in nomount mode. Make sure the parameter file and password file are all present at DR server at $ORACLE_HOME/dbs location for UNIX system.

$ set ORACLE_SID TEST
$ sqlplus /nolog
SQL> connect / as sysdba
SQL> startup nomount
SQL> exit

5. Create the standby database using RMAN. This assumes the database file structures will be identical on both servers. Also you have initialization parameter, password file and backup piece are all placed in their correct locations. The tnsnames.ora and listener.ora must have information for target and auxiliary database and listener is up.

$ RMAN target ‘sys/password@TEST’ auxiliary / (This is executed from DR server.)
RMAN> duplicate target database for standby nofilenamecheck dorecover;

6. Once the DR database is created, you will need to manually add a tempfile:

SQL> alter database open read only;
SQL> alter tablespace temp add tempfile ‘/u01/oradata/TEMP01.DBF’ size 500M;

7. Put the DR database into managed standby mode:

SQL> shutdown immediate
SQL> startup nomount
SQL> alter database mount standby database;
SQL> alter database recover managed standby database disconnect;

8. On the production database switch logs to initiate replication:

SQL> alter system switch logfile;

The configuration of Dataguard is now complete.

For more detailed information to create a Physical standby database using RMAN, refer the below URL:
http://www.idevelopment.info/data/Oracle/DBA_tips/RMAN_9i/RMAN9_32.shtml

No comments:

Post a Comment