Example Renaming Standby Database Files

Example Renaming Standby Database Files

The example below demonstrates various techniques Dbvisit Standby uses to rename standby database files when creating a standby database.

Primary database structure

Oracle database parameters in the primary database

We have chosen to create a filesystem standby database and edited the Oracle database parameters for the standby. Note we have enabled creating of OMF files in the standby by setting parameters db_create_file_dest, db_create_online_log_dest_1 and db_create_online_log_dest_2 to valid filesystem locations. We left the parameter control_files empty to create OMF control files,The following oracle database parameters will be set in the standby database pfile or spfile:

Dbvisit Standby prompted to provide filesystem locations for data/temp files as the primary database contains one non OMF datafile: +DATA/dbvlx102/users.dbf

Dbvisit Standby also prompted us to provide a valid filesystem location for ASM ALIAS redo logs:

+ARCHIVELOGS/dbvlx102/onlinelog/redo_1_2
+ARCHIVELOGS/dbvlx102/onlinelog/redo_1_1 

The standby database has been created with the following structure:

Note, two OMF control files have been created as we had set:

db_create_online_log_dest_1 = /oracle/oradata
db_create_online_log_dest_2 = /oracle/oradata

OMF datafiles have been created in the location specified by db_create_file_dest = /oracle/oradata. Non-OMF datafile has been created in the location /oracle/oradata/DBVLX102/datafile as we have specified.Tempfiles and redo logs do not get created for a standby database as they are not required, but the standby control file has a record of their names and locations.Two primary ASM ALIAS redo logs group 1 have been renamed to filesystem non-OMF files. However primary Oracle managed files (ASM FQSN) tempfiles and two redo logs group 2 have not been renamed in the standby controlfile.If the standby database is open read only, or activated to become a primary database, Oracle detects that tempfiles are OMF and will create them as OMF files in a location specified by db_create_file_dest:

Redo logs are created if the standby database gets activated to become primary. In this case Oracle again will detect that redo logs must be created as OMF files and will create them according the settings of db_create_onli_log_dest_n:

We chose to create a template when we created the standby database, to be able to repeat the creation process if required. Here is the template summary:

Dbvisit Standby has added the following parameter to the standby spfile:

log_file_name_convert = +ARCHIVELOGS/dbvlx102/onlinelog, /oracle/oradata/DBVLX102/onlinelog

This parameter was used to rename primary ASM ALIAS redo logs. The section "C – Database file locations" contains a record for datafile 4 with a standby name /oracle/oradata/DBVLX102/datafile/users.dbf. This information is used to generate "set newname" RMAN command to rename datafile 4 when restoring the standby controlfile.