How Oracle Dataguard Configures physical standby

Source: Internet
Author: User
Tags file system log file permissions linux

Although there are a lot of Oracle Dataguard configuration tutorials on the web, it's not hard to see that many of them are using Rman duplicate, although this approach is simpler. But in a way, but also misled the beginner, although also can be configured successfully, but only know that they do not know why, the essence of Dataguard did not understand, also not conducive to its maintenance and tuning.

This configuration document is based on Oracle's official documentation and is designed to deepen your understanding of dataguard.

The result of this configuration is the asynchronous transfer in maximum performance mode, so that in the parameter file, only basic primary parameters are involved, and the real time apply under switchover and maximum performance mode is not considered. The application of data Guard Broker is also not considered in the listening configuration

Configuration environment:

Main Library: Standby library:

Operating system version: Oracle Linux 6.3 Oracle Linux 6.3

Database version: Oracle 11.2.0.1.0 Oracle 11.2.0.1.0

Host Name: Node1.being.com node2.being.com

ip:192.168.1.11 192.168.1.12

Db_name ORCL Victor

Db_unique_name ORCL ORCL

Instance_name ORCL Victor

Service_names ORCL Victor

Note: 1. Dataguard only need db_unique_name consistency

2. In addition to installing Oracle software in the main library, you need to DBCA to build a library. In the repository, you only need to install Oracle software, that is, in the./runinstaller installation process, the third step to choose install software only

Can

3. Oracle_base=/u01/app/oracle,oracle_home= $ORACLE _base/product/11.2.0.1/db_1 of the main reserve library

First, configuration monitoring

1> the main library

[Oracle@node1 ~]$ CD $ORACLE _home/network/admin/

[Oracle@node1 admin]$ Cat Tnsnames.ora

To_victor =
  (DESCRIPTION = (
    address_list =
      (address = (PROTOCOL = TCP) (HOST = 192.168.1.12) (PORT = 1521)) 
  
   )
    (Connect_data =
      (SERVER = dedicated)
      (service_name = Victor)
    )
  
  

Where To_victor is the network service name, which is used in later configurations log_archive_dest_2 and Fal_server

2> on the Standby library

[Oracle@node2 ~]$ CD $ORACLE _home/network/admin/

[Oracle@node2 admin]$ Cat Tnsnames.ora

TO_ORCL =
  (DESCRIPTION = (
    address_list =
      (address = (PROTOCOL = TCP) (HOST = 192.168.1.11) (PORT = 1521)) 
  )
    (Connect_data =
      (SERVER = dedicated)
      (service_name = ORCL)
    )
  

Note: This configuration is based on a basic Dataguard configuration and does not consider the configuration of dataguard broker

Second, the main library environment ready -->> to operate on Node1

1> set the database to archive mode

Sql> Archive Log List-->> if the database log mode is no archive mode, it means that it is running in a non-archive model. Perform the following actions

sql> shutdown Immediate

Sql> Startup Mount

sql> ALTER DATABASE Archivelog;

sql> ALTER DATABASE open;

2> set the database to force logging mode

Sql> select force_logging from V$database; If-->> is no, do the following

sql> ALTER DATABASE force logging;

3> Modify the main library parameter file

Sql> alter system set log_archive_config= ' dg_config= (orcl,victor) ';

-->> represents the Dataguard is two nodes, one from the main, to configure multiple nodes, you need to add here.

Sql> alter system set log_archive_dest_1= ' Location=use_db_recovery_file_dest valid_for= (online_logfiles,primary_ role) DB_UNIQUE_NAME=ORCL ';

-->> location represents a local archive. Here we use the Flashback area as an archive directory for the online log files, in a real-world production environment, if the archive log is archived on a local file system, the flash-back zone is not recommended because the Flashback zone and database software are in the same directory, and if there are too many archived logs, the flash-back space grows too fast and is prone to low disk space. This makes it easy to hang up the database. Valid_for represents the archive directory only if the library is the main library and the online log files are archived.

Sql> alter system set log_archive_dest_2= ' service=to_victor async valid_for= (online_logfiles,primary_role) db_ Unique_name=victor ';

The-->> service is followed by the network services name

Sql> alter system set log_archive_dest_state_1= ' Enable ';

Sql> alter system set log_archive_dest_state_2= ' Enable ';

Sql> alter system set remote_login_passwordfile=exclusive Scope=spfile; -->> Set Password file permissions, this setting needs to restart the database in order to take effect

Sql> alter system set log_archive_format= '%t_%s_%r.arc ' scope=spfile; -->> The format of the archive log, which requires the restart of the database to take effect

-->> the last two items can not be explicitly set

Related Article

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.