Environment:
Primary Database SID = TESTDB
Standby Database SID = UATDB
Color Legend:
Primary: Black
Standby: Pink
1) Replicate the issue
Enable OMF and add a datafile to an existing tablespace
Datafile will be created with different names in primary and standby
Change the db_create_file_dest parameter in both primary and standby
Add a datafile on primary and check the datafile name
Datafile will be created with different name in standby
select file_name from dba_data_files where tablespace_name='USERDATA';
2) Shutdown the Standby Database and rename/move the standby control file
3) In Primary backup the controlfile for standby with RMAN
BACKUP CURRENT CONTROLFILE FOR STANDBY FORMAT 'stbycf.bkp';
Backup control file will be created by defaultl in $ORACLE_HOME/dbs/
Alert Log,
4) Copy the control file to standby site
5) Query the online and standby logfile paths
select member from v$logfile;
6) Delete the Online Redo Logfiles are Standby log files from Standby database
7) Nomount the standby database
8) On Standby, Connect to RMAN and restore the standby control file
restore standby controlfile from '/u01/TESTDB/BACKUP/rman/stbycf.bkp';
9) Mount the database
alter database mount;
10) Use RMAN CATALOG and SWITCH commands to change the datafile names in the standby controlfile
catalog start with '/u01/TESTDB/ORADATA/'; #Location of database files/ location of datafiles on standby whose names are different than that of primary
report schema; #lists datafile names and their locations
list copy of database; #lists all cataloged datafiles
switch datafile 5 to copy; #renames the datafile 5 in control file with the cataloged version of datafile 5
report schema; #lists datafile names and their locations
Alert log,
10) If flashback is on, then turn it off and turn it on in the standby database
alter database flashback off;
alter database flashback on;
12) Since standby log file exist in primary, we need to execute clear logfile statement in the standby database so that they will be created automatically
show parameter log_file_name_convert
select group# from v$standby_log;
alter database clear logfile group 3;
alter database clear logfile group 4;
alter database clear logfile group 5;
13) Start a media-recovery process in the physical standby database. The online logfiles will be cleared automatically.
alter database recover managed standby database using current logfile disconnect;
Check whether the redo log files are created automatically after managed recovery was issued
Best Regards
Charan