Oracle11gDataGuard usage Summary

Source: Internet
Author: User
Compared with 10 Gb, the most advantageous feature of Oracle11g is active‑uard. This improvement has prompted users to put the database

Compared with 10 Gb, Oracle's 11g replica uard has the most advantageous feature of active replica uard. This improvement has prompted users to put the database

Compared with 10 Gb, Oracle's 11g replica uard has the most advantageous feature of active replica uard. This improvement has prompted users to upgrade the database from 10 Gb to 11 GB, read/write splitting is sublimated at this time, and data synchronization is performed in the background as needed. Compared with the use of 10 Gb, the database is started to read only when you want to read data, however, at this time, the log synchronization data is not accepted. If you need to synchronize the data, you need to start the database to the mount stage again, which is complicated.

The active dataurad function of the 11g is very powerful. At the same time, the duplicate option of rman was greatly improved in the 11g architecture. We do not need to make a dedicated backup, the data files can be directly transmitted from the master database to the slave database through duplicate, and the recovery process is more concise.

Of course, the general system is one master and one slave, and the key system even requires one master and two slave. If there are more systems, manual management is easy to confuse, at this time, we should use the enhanced version of the dg broker to do it. In the past, we felt that we had to manage it manually at 10 Gbit/s, and manually switchover and failover were relatively steadfast, because switchover was also in the 10 Gbit/s process, failover has encountered some problems, but it leaves some shadows. When it was 11 GB, it was widely used at work, and I tried it myself and found that it was really good, in addition, it is much easier to set up a slave database than to set up a slave database manually. Therefore, we still need to embrace changes and embrace new things. On the one hand, we can heal ourselves. On the other hand, we need to restore our confidence in using new things, at least in the event of a disaster.

Let's take a simple look at an example to illustrate how to use the dg broker to build a consumer uard. The steps are much simpler than manual ones, and the reliability is much higher because of the manual checkpoint, this will be done in the check of the dg broker.

Out of force logging, the master database is set to archive.

All we need to do is configure the network listener. Of course, this is not difficult either. The listener. ora tnsnames. ora master and backup are very similar.

For example, we use port 1523 to interconnect between primary and standby.

The host part of the listener. ora master database is different from that of the slave database.


LISTENER_1523 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 10. xxxxx.45) (PORT = 1523 ))
)
)
)

SID_LIST_LISTENER_1523 =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = test11g)
(ORACLE_HOME =/DATA/app/oracle/product/11.2.0.4)
(SID_NAME = test11g)
)
)

The master and slave databases of tnsnames. ora are consistent.
TEST11G =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 10. xxxxx.45) (PORT = 1523 ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = test11g)
)
)

STEST11G =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 10. xxxxxx.46) (PORT = 1523 ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = test11g)
)
)

Then, you can use tnsping to start checking and checking the firewall.
Add slave database logs
To check the log status of the master database, use the following method.
SQL> select member, group #, status from v $ logfile
Member group # STATUS
-------------------------------------------------------------------
/DATA/app/oracle/oradata/test11g/redo03.log 3
/DATA/app/oracle/oradata/test11g/redo02.log 2
/DATA/app/oracle/oradata/test11g/redo01.log 1
SQL> select group #, status, bytes, blocksize, status from v $ log;
GROUP # STATUS BYTES BLOCKSIZE STATUS
--------------------------------------------------------------
1 INACTIVE 52428800 512 INACTIVE
2 CURRENT 52428800 512 CURRENT
3 INACTIVE 52428800 512 INACTIVE
The statement for adding a slave database log is similar:
Alter database add standby logfile group 4'/DATA/app/oracle/oradata/test11g/redo04.log 'SIZE 524288000;
Modify the following database parameters,
Alter system set standby_file_management = auto scope = both;
Alter system set dg_broker_start = TRUE scope = both;
Alter system set local_listener = TEST11G scope = both;

Check the dmon status
SQL>! Ps-ef | grep dmon_test11g
Oracle 8129 1 0? 00:00:00 ora_dmon_test11g
Oracle 8138 8108 0 00:00:00 pts/0/bin/bash-c ps-ef | grep dmon_test11g
Oracle 8140 8138 0 00:00:00 pts/0 grep dmon_test11g

Check the log of the dg broker. If there is no configuration file at the beginning, it will be created again.
DMON: cannot open configuration file "/DATA/app/oracle/product/11.2.0.4/dbs/dr2test11g. dat"
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
DMON: cannot open configuration file "/DATA/app/oracle/product/11.2.0.4/dbs/dr2test11g. dat"
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Configuration does not exist, Data Guard broker ready

Database alert Log:
Mon Jul 27 11:25:15 2015
DMON started with pid = 26, OS id = 8129
Starting Data Guard Broker (DMON)
Mon Jul 27 11:25:23 2015

Then copy the password file, the parameter file (spfile) to the slave database.

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.