Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Before creating standby database, you need to consider where your standby database files will be located and make sure the filesystem has necessary paths available and pre-created.

Dbvisit will create standby database files regardless whether on ASM, Filesystem or ACFS according to the general Oracle rules and concept. The main consideration here is always whether you will do file path conversion or not.

Table of Contents
stylenone

1 OMF files

Location of OMF files on standby server is completely driven by OMF parameters db_create_file_dest , db_create_online_log_dest_The behavior is different for OMF files and non-OMF files. If you don’t know which type of files your primary database is using, be sure to check https://dbvisit.atlassian.net/wiki/spaces/DSMP/pages/3806167060/Prerequisites#5.-Check-Primary-Database-Files-Naming-Structure

Table of Contents
stylenone

1 OMF files

Location of OMF files on standby server is completely driven by OMF parameters db_create_file_dest , db_create_online_log_dest_[x] and db_recovery_file_dest. You may change it to place your files on different ASM diskgroup, different filesystem mountpoint etc … OMF parameters on primary and standby are needed even if you don’t make any type of name/path conversion.

...

...

OMF init parameters are:

Code Block
db_create_
online_log_dest_1 = /u02/app/oracle/oradata/DEV, you would end up with nonsense path: /u02/app/oracle/oradata/DEV/DEV/onlinelog/o1_mf_3_lw9or7g1_.log

If you have identical filesystem structure on standby and on primary (no path conversion done):

  • You will need to set OMF parameters when creating standby database to the same values as on your primary

Note
Code Block
OMF parameters db_create_file_dest, db_recovery_file_dest or
file_dest                 
db_create_online_log_dest_1          
db_create_online_log_dest_2
db_create_online_log_dest_3
db_create_online_log_dest_
[x] are needed even if your standby file locations are the same as on primary. They will be automatically copied from your current primary database init parameters during create standby database process.

If you would like to have different file paths on primary and standby or if you’re converting between ASM and filesystem (path conversion is done):

  • You will need to set OMF parameters when creating standby database to intended locations

OMF init parameters are:

db_create_file_dest                 
4
db_create_online_log_dest_5

If db_create_online_log_dest_[x] is not set, Oracle creates redo in db_create_file_dest and creates automatically mirror in db_recovery_file_dest

Info

Don’t forget that Oracle automatically adds db_unique_name to the OMF path. Never set OMF parameters to contain any actual name. For example if you would set db_create_online_log_dest_1

db_create_online_log_dest_2 db_create_online_log_dest_3 db_create_online_log_dest_4 db_create_online_log_dest_5

For each type of file OMF rules are applied differently:

OMF datafiles and tempfiles

will be created on standby in location <db_create_file_dest>/<db_unique_name>/datafile. For example if you have OMF datafile on primary (primary db_unique_name=SOLO):

Code Block
+DATA/SOLO/DATAFILE/system.292.1148040717

and your standby will be on filesystem with init parameters:

db_create_file_dest = /u01/app/oracle/oradata

db_unique_name=dev

then standby OMF file will be created like so:

Code Block
/u01/app/oracle/oradata/DEV/datafile/o1_mf_system_kqh8ln12_.dbf
Info

db_unique_name is converted by oracle to capital letters for filesystem location.

...

Info

Redo member paths on standby will be changed only during standby database activation or graceful switchover

Will be created on standby in location(s) <db_create_online_log_dest_[x]>/<db_unique_name>/onlinelog.

If parameters db_create_online_log_dest_[x] are not set, oracle will automatically create redo in <db_create_file_dest>/<db_unique_name>/onlinelog and its mirror in <db_recovery_file_dest>/<db_unique_name>/onlinelog.

For example if your primary has redo logs (only group 3 is displayed):

Code Block
/u02/app/oracle/oradata/SLASH/onlinelog/o1_mf_3_lw9or7g1_.log
/u03/app/oracle/oradata/SLASH/onlinelog/o1_mf_3_lw9or7mw_.log

and your standby will be on filesystem with init parameters

db_create_file_dest = /u02/app/oracle/oradata

db_recovery_file_dest = /u02/app/oracle/fast_recovery_area

db_unique_name=dev

db_create_online_log_dest_[x] are not set

...

= /u02/app/oracle/oradata/DEV, you would end up with nonsense path: /u02/app/oracle/oradata/DEV/DEV/onlinelog/o1_mf_3_lw9or7g1_.log

If you have identical filesystem structure on standby and on primary (no path conversion done):

  • You will need to set OMF parameters when creating standby database to the same values as on your primary. This is done automatically during create standby database wizard, so you don’t have to worry about it further.

Note

OMF parameters on primary and on standby are needed even if your standby file locations are the same on primary and standby.

If you would like to have different file paths on primary and standby or if you’re converting between ASM and filesystem (path conversion is done):

  • You will need to set OMF parameters when creating standby database to intended locations as described further

Following rules will apply for different types of files when standby database is created:

Location of OMF datafiles and tempfiles on standby

They will be created on standby in location <db_create_file_dest>/<db_unique_name>/datafile. For example if you have OMF datafile on primary (primary db_unique_name=SOLO):

Code Block
+DATA/SOLO/DATAFILE/system.292.1148040717

and your standby will be on filesystem with init parameters:

db_create_file_dest = /u01/app/oracle/oradata

db_unique_name=dev

then standby OMF file will be created like so:

Code Block
/u01/app/oracle/oradata/DEV/datafile/o1_mf_system_kqh8ln12_.dbf
Info

db_unique_name is converted by oracle to uppercase for filesystem location.

Location of OMF redo logs on standby

Info

Redo member paths on standby will be changed only during standby database activation or graceful switchover

They will be created on standby in location(s) <db_create_online_log_dest_[x]>/<db_unique_name>/onlinelog.

If parameters db_create_online_log_dest_[x] are not set, oracle will automatically create redo in <db_create_file_dest>/<db_unique_name>/onlinelog and its mirror in <db_recovery_file_dest>/<db_unique_name>/onlinelog.

For example if your primary has redo logs (only group 3 is displayed):

Code Block
/u02/app/oracle/oradata/DEVSLASH/onlinelog/o1_mf_3_lw9or7g1_.log
/u02u03/app/oracle/fast_recovery_area/DEVoradata/SLASH/onlinelog/o1_mf_3_lw9or7mw_.log
Note

If your primary database uses exclusively OMF files, make sure that db_file_name_convert and log_file_name_convert parameters are not set at all when you create standby database

Primary ASM to Standby filesystem conversion example with OMF files

Let’s have a look how primary ASM to Standby Filesystem conversion works for exclusively OMF primary database.

Primary database has following configuration:

...

and your standby will be on filesystem with init parameters

db_create_file_dest = /u02/app/oracle/oradata

db_recovery_file_dest = /u02/app/oracle/fast_recovery_area

db_unique_name=dev

db_create_online_log_dest_[x] are not set

then standby OMF redo logs will be created like so (only group 3 is displayed):

Code Block
/u02/app/oracle/oradata/DEV/onlinelog/o1_mf_3_lw9or7g1_.log
/u02/app/oracle/fast_recovery_area/DEV/onlinelog/o1_mf_3_lw9or7mw_.log
Note

If your primary database uses exclusively OMF files, make sure that db_file_name_convert and log_file_name_convert parameters are not set at all when you create standby database

Primary ASM to Standby filesystem conversion example with OMF files

Let’s have a look how primary ASM to Standby Filesystem conversion works for exclusively OMF primary database.

Primary database has following configuration:

Code Block
-- controlfiles:
+DATA/SOLO/DATAFILECONTROLFILE/systemcurrent.283279.11480404611148040283
+DATARECO/SOLO/DATAFILECONTROLFILE/sysauxcurrent.282.11480406333073.1148040285

-- redo:
+DATA/SOLO/DATAFILEONLINELOG/undotbs1group_1.285304.11480406711149332117
+DATA/SOLO/DATAFILEONLINELOG/usersgroup_2.291303.11480407051149332119
+DATA/SOLO/DATAFILEONLINELOG/newgroup_tbs3.300.1148040849

-- tempfiles:302.1149332125
+DATARECO/SOLO/TEMPFILEONLINELOG/tempgroup_1.2992269.1149332231

-- db_unique_name = SOLO
-- db_create_file_dest = +DATA
-- db_recovery_file_dest = +RECO
-- db_create1149332119
+RECO/SOLO/ONLINELOG/group_2.2268.1149332119
+RECO/SOLO/ONLINELOG/group_3.1492.1149332125

-- datafiles:
+DATA/SOLO/DATAFILE/system.283.1148040461
+DATA/SOLO/DATAFILE/sysaux.282.1148040633
+DATA/SOLO/DATAFILE/undotbs1.285.1148040671
+DATA/SOLO/DATAFILE/users.291.1148040705
+DATA/SOLO/DATAFILE/new_tbs.300.1148040849

-- tempfiles:
+DATA/SOLO/TEMPFILE/temp.299.1149332231

-- db_unique_name = SOLO
-- db_create_file_dest = +DATA
-- db_recovery_file_dest = +RECO
-- db_create_online_log_dest_[x] are not set
-- db_file_name_convert and log_file_name_convert are not set

During create standby database we would set OMF parameters like so:

...

Unique db name for standby database is set during DDC configuration creation, cannot be set during create standby database process
Info
Note

db_file_name_convert and log_file_name_convert must not be set if primary database files are OMF exclusively

Info

control_files parameter is not set as controlfiles are OMF

Info

Unique db name for standby database is set during DDC configuration creation, cannot be set during create standby database process

After standby database is created it will have following structure:

...

Info

Redo member locations will still point to ASM with primary db_unique_name on standby database. This is expected, the paths will be changed only during activation or graceful switchover

...

If you would like to have different file paths on primary and standby or if you’re converting between ASM and filesystem (path conversion is done):

Such conversion is possible, but you need to set You need to set the convert parameters for your standby database during standby database creation. There are two convert parameters to set:

Code Block
db_file_name_convert = 'PATHA','PATHB','PATHC','PATHD',...
log_file_name_convert = 'PATHA','PATHB','PATHC','PATHD',...

The convert parameters have following properties:

  • They contain pair or pairs of strings which are used for path conversion when standby database is created

  • They are valid on standby database only. On primary, they are not effective.

  • They are For Dbvisit to work properly, they need always set on primary and standby - (their values are reversed)

Primary filesystem to Standby filesystem conversion example with non-OMF files

...

Note

For setting convert parameters in the create standby database wizard, we don’t use single quotes. Make sure to not use any trailing slashes and empty spaces for parameter values.

Info

Note that for parameter db_file_name_convert we have to add one more path conversion pair for primary datafile /u02/app/oracle/oradata/DBVONE/convert_tbs_01.dbf.

Setting db_file_name_convert only to u01,u02 would place this datafile on standby to the same path as on primary: /u02/app/oracle/oradata/DBVONE/convert_tbs_01.dbf. There’s no way to convert it back if it’s placed on standby together with other datafiles. It would be impossible to perform graceful switchover as the datafile would be expected to be in /u01/app/oracle/oradata/DBVONE/convert_tbs_01.dbf on the old primary / new standby.

If the datafile convert_tbs_01.dbf on primary wouldn’t exist, we would only set db_file_name_convert to u01,u02.

...

Code Block
-- controlfile:
/u02/app/oracle/oradata/DBVONE/control01.ctl

-- redo:
/u02/app/oracle/oradata/DBVONE/redo2.rdo
/u02/app/oracle/oradata/DBVONE/redo3.rdo
/u02/app/oracle/oradata/DBVONE/redo1.rdo

-- datafiles:
/u02/app/oracle/oradata/DBVONE/system01.dbf
/u02/app/oracle/oradata/DBVONE/sysaux01.dbf
/u02/app/oracle/oradata/DBVONE/undotbs01.dbf
/u02/app/oracle/oradata/DBVONE/users01.dbf
/u02/app/oracle/oradata/DBVONE_u02/convert_tbs_u02/convert_tbs_01.dbf

-- tempfiles:
/u02/app/oracle/oradata/DBVONE/temp01.dbf

-- db_unique_name = DBVONE
-- db_create_file_dest is not set
-- db_recovery_file_dest = /u02/app/oracle/oradata/fast_recovery_area
-- db_create_online_log_dest_[x] is not set
-- db_file_name_convert = u01, u02, /u02/app/oracle/oradata/DBVONE, /u02/app/oracle/oradata/DBVONE_u02
-- log_file_name_convert = u01, u02
Note

After standby database is created, you should set convert parameters on your primary database with opposite values (requires restart):

SQL> alter system set db_file_name_convert ='u02','u01','/u02/app/oracle/oradata/DBVONE_u02','/u02/app/oracle/oradata/DBVONE' scope=spfile;

SQL> alter system set log_file_name_convert = ‘u02','u01' scope=spfile;

This is for proper functionality of failover and switchover.

If you skip this step, Dbvisit will set these parameters during switchover automatically.

Info

Oracle doesn’t use in any way db_unique_name for non-OMF standby database files names. If you would like to create standby database with different db_unique_name you need to provide full path in the convert parameters. For example if we would choose db_unique_name = DBVONEDR for our standby database, we should set:

db_file_name_convert = /u01/app/oracle/oradata/DBVONE, /u02/app/oracle/oradata/DBVONEDR

log_file_name_convert = /u01/app/oracle/oradata/DBVONE, /u02/app/oracle/oradata/DBVONEDR

3 Mixing OMF and Non-OMF files

This configuration is very complex for standby database creation and placement of database files on standby.

If you have identical filesystem structure on standby and on primary (no path conversion done):

  • You will need to set OMF parameters when creating standby database to the same values as on your primary

  • There’s no need to set any specific parameters for non-OMF files

If you would like to have different file paths on primary and standby or if you’re converting between ASM and filesystem (path conversion is done):

  • You will need to set OMF parameters when creating standby database to intended locations

  • You will need to set db_file_name_convert and log_file_name_convert as well

...

01.dbf

-- tempfiles:
/u02/app/oracle/oradata/DBVONE/temp01.dbf

-- db_unique_name = DBVONE
-- db_create_file_dest is not set
-- db_recovery_file_dest = /u02/app/oracle/oradata/fast_recovery_area
-- db_create_online_log_dest_[x] is not set
-- db_file_name_convert = u01, u02, /u02/app/oracle/oradata/DBVONE, /u02/app/oracle/oradata/DBVONE_u02
-- log_file_name_convert = u01, u02
Note

After standby database is created, you should set convert parameters on your primary database with reverse values (requires restart):

SQL> alter system set db_file_name_convert ='u02','u01','/u02/app/oracle/oradata/DBVONE_u02','/u02/app/oracle/oradata/DBVONE' scope=spfile;

SQL> alter system set log_file_name_convert = ‘u02','u01' scope=spfile;

This is for proper functionality of failover and switchover.

If you skip this step, Dbvisit will set these parameters during switchover automatically.

Info

Oracle doesn’t use in any way db_unique_name for non-OMF standby database files names. If you would like to create standby database with different db_unique_name you need to provide full path in the convert parameters. For example if we would choose db_unique_name = DBVONEDR for our standby database, we should set:

db_file_name_convert = /u01/app/oracle/oradata/DBVONE, /u02/app/oracle/oradata/DBVONEDR

log_file_name_convert = /u01/app/oracle/oradata/DBVONE, /u02/app/oracle/oradata/DBVONEDR

3 Mixing OMF and Non-OMF files

This configuration is very complex for standby database creation and placement of database files on standby.

If you have identical filesystem structure on standby and on primary (no path conversion done):

  • You will need to set OMF parameters when creating standby database to the same values as on your primary (this is done automatically during create standby database wizard)

  • There’s no need to set any specific parameters for non-OMF files

If you would like to have different file paths on primary and standby or if you’re converting between ASM and filesystem (path conversion is done):

  • You will need to set OMF parameters when creating standby database to intended locations

  • You will need to set db_file_name_convert and log_file_name_convert as well

Primary filesystem to Standby filesystem path conversion example with OMF and non-OMF mix:

Primary database has following configuration:

Code Block
-- controlfile:
/u02/app/oracle/oradata/SLASH/controlfile/o1_mf_kqh8jsfk_.ctl
/u02/app/oracle/fast_recovery_area/SLASH/controlfile/o1_mf_kqh8jsjw_.ctl

-- redo:
/u02/app/oracle/fast_recovery_area/SLASH/onlinelog/o1_mf_1_lw9or6g7_.log
/u02/app/oracle/fast_recovery_area/SLASH/onlinelog/o1_mf_2_lw9orcp3_.log
/u02/app/oracle/fast_recovery_area/SLASH/onlinelog/o1_mf_3_lw9or7mw_.log
/u02/app/oracle/oradata/SLASH/onlinelog/o1_mf_1_lw9or606_.log
/u02/app/oracle/oradata/SLASH/onlinelog/o1_mf_2_lw9orck6_.log
/u02/app/oracle/oradata/SLASH/onlinelog/o1_mf_3_lw9or7g1_.log
/u02/app/oracle/oradata/SLASH/onlinelog/redo99.log

-- datafiles:
/u02/app/oracle/oradata/SLASH/datafile/o1_mf_system_kqh8ln12_.dbf
/u02/app/oracle/oradata/SLASH/datafile/o1_mf_sysaux_kqh8n4jq_.dbf
/u02/app/oracle/oradata/SLASH/datafile/o1_mf_undotbs1_kqh8ohhc_.dbf
/u02/app/oracle/oradata/SLASH/datafile/o1_mf_users_kqh8pjld_.dbf
/u02/app/oracle/oradata/SLASH/datafile/nonomf.dbf

-- tempfiles:
/u02/app/oracle/oradata/SLASH/datafile/o1_mf_temp_lw9ornvw_.tmp

-- db_unique_name = SLASH
-- db_create_file_dest = /u02/app/oracle/oradata
-- db_recovery_file_dest = /u02/app/oracle/oradata/fast_recovery_area
-- db_create_online_log_dest_[x] is not set
-- db_file_name_convert is not set
-- log_file_name_convert is not set

All files are OMF except of one datafile (nonomf.dbf) and one redo member (redo99.log).

On standby server we want to place all files on u01 instead of u02. So during the create standby database we need to specify following parameters:

...

We need to specify OMF parameters and convert parameters as well, becausew we’re using OMF and non-OMF file types and we want to have path conversion.

Code Block
-- controlfile:
/u01/app/oracle/oradata/SLASH/controlfile/o1_mf_lxvn3m9f_.ctl
/u01/app/oracle/fast_recovery_area/SLASH/controlfile/o1_mf_lxvn3md3_.ctl

-- redo:
/u01/app/oracle/fast_recovery_area/SLASH/onlinelog/o1_mf_1_lw9or6g7_.log
/u01/app/oracle/fast_recovery_area/SLASH/onlinelog/o1_mf_2_lw9orcp3_.log
/u01/app/oracle/fast_recovery_area/SLASH/onlinelog/o1_mf_3_lw9or7mw_.log
/u01/app/oracle/oradata/SLASH/onlinelog/o1_mf_1_lw9or606_.log
/u01/app/oracle/oradata/SLASH/onlinelog/o1_mf_2_lw9orck6_.log
/u01/app/oracle/oradata/SLASH/onlinelog/o1_mf_3_lw9or7g1_.log
/u01/app/oracle/oradata/SLASH/onlinelog/redo99.log

-- datafiles:
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/SLASH/datafile/o1_mf_system_lxvn5vtq_.dbf
/u01/app/oracle/oradata/SLASH/datafile/o1_mf_sysaux_lxvn7om1_.dbf
/u01/app/oracle/oradata/SLASH/datafile/o1_mf_undotbs1_lxvn9h7h_.dbf
/u01/app/oracle/oradata/SLASH/datafile/o1_mf_users_lxvnb6rp_.dbf
/u01/app/oracle/oradata/SLASH/datafile/nonomf.dbf

-- tempfiles:
/u01/app/oracle/oradata/SLASH/datafile/o1_mf_temp_%u_.tmp

-- db_unique_name = SLASH
-- db_create_file_dest = /u01/app/oracle/oradata
-- db_recovery_file_dest = /u01/app/oracle/oradata/fast_recovery_area
-- db_create_online_log_dest_[x] is not set
-- db_file_name_convert = u02,u01
-- log_file_name_convert = u02,u01
Note

After standby database is created, you should set convert parameters on your primary database with reverse values (requires restart):

SQL> alter system set db_file_name_convert ='u01','u02' scope=spfile;

SQL> alter system set log_file_name_convert = ‘u01','u02' scope=spfile;

This is for proper functionality of failover and switchover.

If you skip this step, Dbvisit will set these parameters during switchover automatically.

Info

non-OMF tempfiles and redologs will be forcefully created as OMF by Dbvisit if you perform graceful switchover or failover.