In Oracle : How to create an Oracle Physical Standby Database using RMAN

Oracle Applications EBS 11i, R12      Oracle Database      Data Warehouse & BI      Oracle Middleware      PL/SQL      Linux ...

Oracle DBA

Real Application Cluster (RAC) Maintenance tasks Backup and Recovery Database Architecture Replication Oracle Performance Tuning Oracle DBA - Other articles Oracle scripts/ Selects for DBA Oracle Errors (ORA-nnnnn)

The last articles in the site (HOT)

The most visited articles in the site

In-Oracle.com  -> Oracle DBA -> Oracle Replication

-> How to create an Oracle Physical Standby Database (using RMAN)

 

 Oracle Physical Standby Database (RMAN)

 

 

Here are the steps in creating a Physical Standby database using RMAN (without using the RMAN catalog):

 

1. Install Oracle binaries on the standby host 

2. Put the primary database in archivelog mode

3. Create the same directory structures

4. Backup the primary database

5. Copy the RMAN files to the standby host 

6. Create the pfile for the standby database

7. Ensuring SQL*NET connections to primary database

8. Create the standby database

1. Install Oracle binaries on the standby host 

 

Oracle binaries (the same patch level) must be installed on the standby host if is not already done. 

 

 

2. Put the primary database in archivelog mode

 

Put the primary database in archivelog mode if is not already done. 

 

SQL> shutdown immediate;

SQL> startup mount;

SQL> alter database archivelog;

SQL> alter database open;

 

 

3. Create the same directory structures

 

Create the same directory structure for the data files, control files, redo log files, archivelog files. 

 

If the data or redo log file directories are different the following line ( adapted to your case) must be added in pfile:

 

db_file_name_convert =("/u01/oradata/PRD","/u02/oradata/PRD")
log_file_name_convert =("/u01/oradata/PRD","/u02/oradata/PRD")

 

 

4. Backup the primary database

 

$ export ORACLE_SID=PRD 

$ rman target=/ 

Note: if you are not sure that rman from your $ORACLE_HOME is used run

$ which rman  

 

RMAN> run { 
    allocate channel c1 type disk; 
    backup format '/u02/backups/PRD/DataFile_t%t_s%s_p%p' database; 
    backup current controlfile for standby format '/u02/backups/PRD/sby_t%t_s%s_p%p';
    sql 'alter system archive log current'; 
    backup format '/u02/backups/PRD/ArhAll_t%t_s%s_p%p' archivelog all;
    release channel c1; 
}

 

 

5. Copy the RMAN files to the standby host 

 

Copy all the RMAN file (created for this backup) to the standby host in the same location (/u02/backups/PRD).

 

 

6. Create the pfile for the standby database

 

If the primary database use a spfile, create a pfile (connected as sys):

SQL> create pfile from spfile;

 

Copy the pfile from the primary database host to the standby database host to $ORACLE_HOME/dbs directory. 

Add in the standby pfile the line: db_unique_name=PRD_sb           (if the database name/ instance name is PRD )

 

 

7. Ensuring SQL*NET connections to primary database

 

On the standby host configure the tnsnames.ora in order to point to the primary database. Try to connect from the standby database host to the primary database as sys. 

 

If you receive ORA-01031: insufficient privileges when conn sys/password as sysdba, please assure that:

 

  a) the password file has a good name (orapwPRD , if the instance is PRD; the file name is case sensitive)

      To recreate the password file you can use orapwd:

      orapwd file=$ORACLE_HOME/dbs/orapwsid password=new_sys_password entries=15
 

  b) pfile/ spfile remote_login_passwordfile parameter is set to EXCLUSIVE or SHARE.

 

  If the problem is not fixed please check the Metalink note 18089.1 

 

 

8. Create the standby database

 

$ export ORACLE_SID=PRD
$ rman target sys/sys_password@PRD auxiliary /

RMAN> RUN {
               allocate channel C1 device type disk;
               allocate auxiliary channel C2 device type disk;
               duplicate target database for standby nofilenamecheck dorecover;
               }

RMAN>

 

(The database will be in mount state !!!) 

 

To check the status of the new database you can run (connected as sys or system): 

SQL> select NAME, OPEN_MODE, DB_UNIQUE_NAME, DATABASE_ROLE from V$database;

 

Oracle Physical Standby Database (RMAN)

 

 

In-Oracle.com  -> Oracle DBA -> Oracle Replication

-> How to create an Oracle Physical Standby Database (using RMAN)

Oracle Applications EBS 11i, R12      Oracle Database      Data Warehouse & BI      Oracle Middleware      PL/SQL      Linux ...

 

     Copyright (c) 2011-2015  www.in-oracle.com  |  Disclaimer: The views expressed on this web site are my own and do not reflect the views of Oracle Corporation. You may use the information from this site only at your risk.