Parameter configuration for dataguard Learning

Source: Internet
Author: User

To build a 10g replicuard environment, one of the difficulties is to configure database names, roles, archives, diskgroups, and other related parameters. Take the following environment as an example:

Hostname Role Instance_name Tnsnames. ora
Db1 Primary node1 Db1 Db1, DB2, DR1, Dr2
DB2 Primary node2 DB2 Db1, DB2, DR1, Dr2
DR1 Standby apply node1 Db1 Db1, DB2, DR1, Dr2
Dr2 Standby node2 DB2 Db1, DB2, DR1, Dr2


Summarize some parameters that need to be customized based on the host and database environment. Other parameters involved in dataguard, such as "log_archive_format", are not explained here.

1. db_name

You only need to pay attention to the use of the same db_name for the instances of the primary and standby nodes of the secondary uard. We recommend that you use the same name as SERVICE_NAME.

Primary Site Standby site
*. Db_name = 'db' *. Db_name = 'db'

2. db_unique_name

The unique name of the primary and standby databases, which cannot be changed once set.

Note:
If the Master/Slave db_unique_name is different, use it with log_archive_config.
Db_unique_name does not stipulate that it must be consistent with the database SERVICE_NAME. You can customize any name.

Primary Site Standby site
*. Db_unique_name = 'primary' *. Db_unique_name = 'standby'

3. log_archive_config

List the db_unique_name parameters in the Master/Slave database. By default, this parameter is defined to ensure that the database can send or receive redo logs.

1> when the primary and standby db_unique_name are inconsistent

Primary Site Standby site
*. Db_unique_name = primary *. Db_unique_name = standby
*. Log_archive_config = 'dg _ Config = (primary, standby )' *. Log_archive_config = 'dg _ Config = (primary, standby )'

2> when primary and db_unique_name of standby are consistent

Primary Site Standby site
*. Db_unique_name = test *. Db_unique_name = test
*. Log_archive_config ='' *. Log_archive_config =''

 

4. log_archive_dest_1

Local archive path. Primary and standby must define the archiving addresses of their online redo logs. The actual storage path of the system prevails. The format is as follows:

Primary Site: *.LOG_ARCHIVE_DEST_1='LOCATION=/arch/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) '
 
Standby Site:*.LOG_ARCHIVE_DEST_1='LOCATION=/stdby/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) '

Note:
1> when the db_unique_name defined at both ends of the master and slave nodes are inconsistent, the value of db_unique_name is set in log_archive_dest_1 and the value of db_unique_name is set to the local db_unique_name. Take priamry as an example. The format is as follows:

*.LOG_ARCHIVE_DEST_1='LOCATION=/archivelog/ VALID_FOR=(ALL_LOGFILES,
ALL_ROLES) DB_UNIQUE_NAME=Primary'                        

5. log_archive_dest_2

This parameter takes effect only when the database role is primary. Specify primary to transmit the redo log to the standby database defined by this parameter.

Log_archive_dest_2 is one of the most important parameters on mongouard. It defines the redo log transmission mode (Sync or async) and transmission target (standby apply node ), this directly determines the Data Protection Level of the dataguard.

The format is as follows:

Primary Site: *.LOG_ARCHIVE_DEST_2='SERVICE=DR1 lgwr async  VALID_FOR=(ONLINE_LOGFILES, 
Primary_role) 'standby site: (effective after switch over) *. log_archive_dest_2 = 'service = db1 lgwr async valid_for = (online_logfiles,
PRIMARY_ROLE) ' 

Note:
1> the service value defined in The log_archive_dest_2 parameter, such as DR1, is the Oracle Net Name Defined in the tnsnames. ora file.
2> sometimes, the value of db_unique_name is defined in log_archive_dest_2. The current node is set to db_unique_name of the database on the other end. Take the primary end as an example. The format is as follows:

*.LOG_ARCHIVE_DEST_2='SERVICE=DR1 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,
PRIMARY_ROLE) DB_UNIQUE_NAME=Standby'                       

 

6.LOG_ARCHIVE_DEST_3

This parameter takes effect only when the database role is standby. It defines the path of the redo log uploaded from the primary database for the standby database archive.

The official Oracle10g documentation only explains the log_archive_dest_3 parameter when creating logical standby. It does not provide any introduction when constructing physical standby.

Primary Site: *.LOG_ARCHIVE_DEST_3='LOCATION=/archivelog/standbylog/  VALID_FOR=
(STANDBY_LOGFILES,STANDBY_ROLE) 'Standby Site: *.LOG_ARCHIVE_DEST_3='LOCATION=/arch/arch3/  VALID_FOR=(STANDBY_LOGFILES, 
STANDBY_ROLE) '

Note:
The path defined by location is based on the actual path that the node can read and write.

7. log_archive_dest_state_n

Set to enable to activate the attributes defined by log_archive_dest_n.

8. fal_server and fal_client

FAL is short for Fetch archive log, which is the processing mechanism of gap between the primary and standby nodes of the dataguard.

There is no gap on primary, so fal_server and fal_client are also parameters that take effect only on standby. Of course, the switch over needs to be pre-configured on the primary side.

The database name defined by the FAL parameter is also taken from the Oracle Net service name configured in the local tnsnames. ora.

Primary Site Standby site
*. Fal_server = 'dr1', 'dr2' *. Fal_server = 'db1', 'db2'
*. Fal_client = 'db1' *. Fal_client = 'dr1'


9. db_file_name_convert

When the diskgroup name or data file storage path on primary and standby is inconsistent, You need to define this parameter for conversion. Otherwise, after standby applies, you cannot create a data file consistent with primary and report an error.

The format is as follows:

Primary Site: *.db_file_name_convert='+DATAGRP/db/datafile/','+DG1/db/datafile/'
Standby Site: *.db_file_name_convert='+DG1/db/datafile/','+DATAGRP/db/datafile/'        

1> + DG1/DB/datafile/is the path for storing datafile on primary dastabase
2> + upload RP/DB/datafile/is the path for storing datafile on standby.

Note:
1> this parameter on primary takes effect only after the master-slave switch over
2> note that the format should be consistent, for example "*. db_file_name_convert = '+ DG1/DB/datafile', '+ datagrp/DB/datafile/'. If one path is missing, "/" will cause standby apply to fail.
3> when you perform create tablespace and other add datafile operations on primary, you do not need to customize the full path name of datafile. The database automatically creates datafile.

10. log_file_name_convert

Similar to db_file_name_convert, it defines the storage path conversion for the master and slave log files.

 

-- Conclusion

During the sorting process, we found that some parameters involved many details. In particular, the log_archive_dest_2 parameter is directly related to the redo log transmission mechanism, and the attributes similar to "lgwr async" and "valid_for" are prone to habitual neglect.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.