Using RMAN Incremental Backups to Roll Forward a Physical Standby Database

We can use rman incremental backup to roll forward physical standby database. Nevertheless, there is one particular step which we might pay attention to.

In general, physical standby database would have different datafile paths. Things could be even more complex when you are using OMF. The doc only states that we can manually edit the file names in your standby control file or use the RMAN SET NEWNAME command to assign the datafile names.

In fact, setting db_file_name_convert is not an option because we cannot specify full name in OMF format for standby database.
Set newname would not be an option either because it would treat the new path as a data copy and restore datafile is required.
In our case, the solution is to rename file to the correct path, so that recover database can continue.

# on primary db

backup incremental from scn 412400569 database format '/tmp/ForStandby_%U' tag 'FORSTANDBY';

RESTORE STANDBY CONTROLFILE FROM '/tmp/ForStandby_d8rf4hbu_1_1';

# Here we rename datafile and continue the recover

alter system set standby_file_management=MANUAL;
alter database rename file '/oradata/KOBRA/datafile/o1_mf_system_7jr18vxj_.dbf' to '/oradata/KOBRASTD/datafile/o1_mf_system_7k7s4psv_.dbf';
alter database rename file '/oradata/KOBRA/datafile/o1_mf_sysaux_7jr194ph_.dbf' to '/oradata/KOBRASTD/datafile/o1_mf_sysaux_7k7s4pto_.dbf';
alter database rename file '/oradata/KOBRA/datafile/o1_mf_undotbs1_7jr19c92_.dbf' to '/oradata/KOBRASTD/datafile/o1_mf_undotbs1_7k7s4psq_.dbf';
alter database rename file '/oradata/KOBRA/datafile/o1_mf_users_7jr19n2r_.dbf' to '/oradata/KOBRASTD/datafile/o1_mf_users_7k7s4prj_.dbf';
alter database rename file '/oradata/KOBRAPRI/datafile/o1_mf_tivolior_7kdj0jxo_.dbf' to '/oradata/KOBRASTD/datafile/o1_mf_tivolior_7kdr6h00_.dbf';
alter system set standby_file_management=AUTO;

alter database mount;

recover database noredo;

Reference:
https://docs.oracle.com/cd/E11882_01/server.112/e41134/rman.htm#SBYDB00759
http://docs.oracle.com/cd/B19306_01/server.102/b14239/scenarios.htm#CIHEGFEG
https://oracle-base.com/articles/misc/renaming-or-moving-oracle-files

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s