Creating the physical standby database

In order to create a physical standby database, we first need to install Oracle database binaries to the standby database server and then start a standby database instance. Installing Oracle binaries is out of this book's scope, so it's assumed a standby server is ready with the Oracle database software installed. We will start by covering a standby database instance and copying database files from primary to standby, but first let's look at the initialization parameters that we need to set on standby before starting the instance.

Standby database related initialization parameters

The following are the important Data-Guard-related initialization parameters we set on physical standby databases.

FAL_SERVER

This parameter specifies from where the standby database should request missing archived logs if there is a gap in the logs. It is used only when the database is in the standby role and has a gap in the received archived logs.

A redo gap occurs when the redo transport doesn't run for a while. A maintenance operation on the standby server or a network interruption may cause this. Setting this parameter allows the standby to find the missing redo and have it transported.

On the standby database, you need to set the Oracle Net Service name of the primary database as the value of this parameter. Also, taking account of a possible switchover, don't forget to set FAL_SERVER on the primary database with the value of the standby database service name.

Tip

The FAL_CLIENT parameter is no longer required in 11g. In earlier releases, you set the FAL_CLIENT parameter on the standby database, and the value is the Oracle Net Service name that the primary database uses to connect the standby database. In 11g, when it's not set, the primary database will obtain the client service name from the related LOG_ARCHIVE_DEST_n parameter.

STANDBY_FILE_MANAGEMENT

The STANDBY_FILE_MANAGEMENT parameter is used only for the environment of the physical standby databases. By default, its value is MANUAL. By setting this parameter to AUTO, we'll make sure that, when we add or drop datafiles on our primary database, those files are also added or dropped on the standby database. Setting this parameter to AUTO can cause files to be created automatically on the standby database and it can even overwrite existing files; we should be careful when we set both DB_FILE_NAME_CONVERT and STANDBY_FILE_MANAGEMENT and ensure that the existing datafiles on standby won't be overwritten.

SQL> alter system set standby_file_management='AUTO';
System altered.

When the parameter is set to MANUAL, if any datafile is added in primary, you'll see the following errors:

File #5 added to control file as 'UNNAMED0007' because
the parameter STANDBY_FILE_MANAGEMENT is set to MANUAL
The file should be manually created to continue.
MRP0: Background Media Recovery terminated with error 1274
Some recovered datafiles maybe left media fuzzy
Media recovery may continue but open resetlogs may fail

DB_FILE_NAME_CONVERT

In some cases, the directory structure may not be the same in source/primary and destination/standby database locations. The DB_FILE_NAME_CONVERT parameter is used to convert the file locations of datafiles. When you add a datafile in the primary database, assuming you have a STANDBY_FILE_MANAGEMENT parameter setting of AUTO, it will create a datafile on the standby database according to the settings of the DB_FILE_NAME_CONVERT parameter. Before setting DB_FILE_NAME_CONVERT, make sure that filesystem exists and is writable.

When setting this parameter, we must specify one or more paired strings. The first string is the pattern of the primary database file location whereas the second string is the pattern of the standby database file location.

The following is an example of DB_FILE_NAME_CONVERT:

alter system set db_file_name_convert= "'/u01/app/oracle/oradata/turkey_un', '/u01/app/oracle/oradata/india_un'" scope=spfile;

When using ASM, the settings are very simple. We need to mention only the disk groups of primary and standby as follows:

alter system set db_file_name_convert="'+DATA_AREA','+DATA_STBY'" scope=spfile;

Tip

Note that this is a static parameter and it requires the instance to restart for the change to become active.

LOG_FILE_NAME_CONVERT

This parameter plays a similar role to DB_FILE_NAME_CONVERT and is valid for online and standby redo logfiles. The LOG_FILE_NAME_CONVERT parameter converts the file location of a new logfile on the primary database to the desired location on the standby database.

SQL> alter system set log_file_name_convert= "'/u01/app/oracle/oradata/turkey_un', '/u01/app/oracle/oradata/india_un'" scope=spfile;

Tip

The DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT parameters can be used for physical standby databases and RMAN Duplicate/TSPITR (Tablespace Point-in-Time Recovery) operations. It cannot be used on logical standby databases and for RMAN restore operations.

The physical standby database instance

Now it's time to start a database instance on the standby server. In our example, we're going to start a single database instance, not RAC. If an RAC standby database is going to be configured, you need to start instances on RAC nodes and then register the instances to cluster. Considerations about RAC standby databases will be covered in Chapter 8, Integrating Data Guard with the Complete Oracle Environment.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.70.38