Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem While Creating Physical Standby Using RMAN

939393Sep 23 2013 — edited Sep 25 2013

Hi Guru's

May be this incidence you all face while creating physical standby DB. I try to create Physical standby database Using RMAN Duplicate Command from one server

(pri machine) to Standby Machine.

The steps i followed to create the above are as follows:

Step 1:- Enable Forced Logging

SQL> ALTER DATABASE FORCE LOGGING;

Step 2:- Configure a Standby Redo Log

SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 10

  2> ('/oracle/dbs/log1c.rdo','/oracle/dbs/log2c.rdo') SIZE 500M;

Step 3:- Set Primary Database Initialization Parameters

SQL> create pfile='?/dbs/pfileorcl.ora' from spfile;

Edit the pfile to add the standby parameters, here shown:

db_unique_name='orcl'

LOG_ARCHIVE_CONFIG='DG_CONFIG=(orcl,orcldr)'

LOG_ARCHIVE_DEST_2='SERVICE=orcldr LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orcldr'

*.fal_server=orcldr

*.fal_client=orcl

*.standby_file_management=auto

Step 4:- Enable Archiving

SQL> SHUTDOWN IMMEDIATE;

SQL> STARTUP MOUNT;

SQL> ALTER DATABASE ARCHIVELOG;

SQL> ALTER DATABASE OPEN;

Step 5:- Setup tnsnames for standby database

This should be done on primary database by altering tnsnames.ora or using NetCA command, and create it by the name orcldr

orcldr =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = standby-svr)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = orcldr)

)

)

Step 6:- Backup database and copy it to standby

This backup script should be run on primary and copied to standby on the same mount point, running this scripts using RMAN, all files under /rman_backup should be copied to /rman_backup on standby server.

$rman target /

RMAN> run

{

allocate channel c1 type disk;

allocate channel c2 type disk;

backup database format '/rman_backup/%U';

backup archivelog all format '/rman_backup /%U';

backup current controlfile for standby format '/rman_backup/%U';

}

Step 7:- Standby Database Steps

Installing Oracle Software

This should be same release and patchset with exactly same ORACLE_HOME mount point.

Setting Up listener

Create and start a listener on standby database using NetCA, or creating listener.ora in $ORACLE_HOME/network/admin

LISTENER =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = standby-svr)(PORT = 1521))

  )

Step 8:- Set Standby Database Initialization Parameters

Copying the pfile created in primary database and renames it to initorcldr.ora, and changes these parameters:

db_unique_name='orcldr'

LOG_ARCHIVE_CONFIG='DG_CONFIG=(orcldr,orcl)'

LOG_ARCHIVE_DEST_2='SERVICE=orcl LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orcl'

*.fal_server=orcl

*.fal_client=orcldr

*.LOG_ARCHIVE_DEST_STATE_2='ENABLE'

Step 9:- Setup tnsnames for primary database

This should be done on standby database by altering tnsnames.ora or using NetCA command, and create it by the name orcl

orcl =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = primary-svr)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = orcl)

)

)

Step 10:- Copy a Password File

A password file must be created on the Primary and copied over to the Standby site. The sys password must be identical on both sites. Copy orapworcl to $ORACLE_HOME/dbs and rename file to orapworcldr

Step 11:- Create mount points for Oracle

Mount point should be created on standby server with the same convention used in primary, this includes the location for controlfiles, redo logs, datafiles, archive log destination and alert logs.

$ mkdir -p /u01/app/oracle/oradata/orcl/

$ mkdir -p /u01/app/oracle/flash_recovery_area/

$ mkdir -p /u01/app/oracle/admin/orcl/adump

$ mkdir -p /u01/app/oracle/admin/orcl/bdump

$ mkdir -p /u01/app/oracle/admin/orcl/cdump

$ mkdir -p /u01/app/oracle/admin/orcl/udump

Step 12:- Use RMAN to restore backup and setup standby

Connect to RMAN and execute the following command to create standby database, this should be performed on standby server after copying backup and setting tnsnames.

$ export ORACLE_SID=orcldr

$ rman target sys/tiger@orcl auxiliary sys/tiger@orcldr

RMAN> duplicate target database for standby dorecover;

Here i am getting problem as :

While trying to connect to traget database and auxiliary database i notice that when RMAN is connect to both databases it shows

orcl ( DBID xyz)

orcl (not mounted)

Here in my view the second database must be standby database name or auxiiary db name is standby db name which in my case is orcldr

after this issue i am facing the second issues as :

in command

duplicate target database for standby dorecover;

After modifying the command to

RMAN> duplicate target database to "standby";

rman-05520 database name mismatch

Can u please let me know where i am mistaking

This post has been answered by 939393 on Sep 25 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 23 2013
Added on Sep 23 2013
21 comments
1,497 views