Oracle 11g Active standby uard

Source: Internet
Author: User

Oracle 11g Active standby uard

Log applications and database read-only queries in log uard are mutually exclusive. If logs need to be applied, the database can only use the recover managed standby database disconnect from session in the Mount state to continuously apply logs from the background.
To view the data in the standby database, you can only use recover managed standby database cancel to cancel the log application, and then start the database to read only. This situation is also justified in principle, but it is still not convenient enough. After all, we hope that the slave database can play a role, not just application logs, some large queries can be executed directly on the slave database to relieve the pressure on the master database. The 11g active transaction uard does this. The focus is on the active state. At this time, the database is started in the read only state and logs can be applied at the same time. If the mode for configuring the slave database is high, you may even feel the same as that for the master database.
Let's take a look at this feature.
Let's take a look at the information of the slave database.
Idle> select name, database_role from v $ database;
NAME DATABASE_ROLE
-------------------------
TEST11G PHYSICAL STANDBY
1 row selected.
Instance information. In the Mount status.
Idle> select instance_name, status from v $ instance;
INSTANCE_NAME STATUS
----------------------------
DG11G MOUNTED
1 row selected.
View the application status of the log, and find that the log application needs to be 78 in the latest record.
Idle> select * from v $ dataguard_status
Remote File Server Warning 0 28 0 NO 01-JUN-15 RFS [2]: No standby redo logfiles of size 84490 blocks available
Log Apply Services Informational 0 29 0 NO 01-JUN-15 Media Recovery Log/u02/dg11g/flash_recovery_area/DG11G/archivelog/41077_880742847.dbf
Log Apply Services Warning 0 30 0 NO 01-JUN-15 Media Recovery Waiting for thread 1 sequence 78
30 rows selected.

Switch the log in the master database.
#### Primary database
Alter system switch logfile;

The slave database is quickly matched. It can be seen that the logging application of the slave uard is correct. These parts are consistent in 10 Gb.
######### Standby alert log
Mon Jun 01 22:46:51 2015
RFS [2]: No standby redo logfiles of size 57697 blocks available
RFS [2]: Opened log for thread 1 sequence 78 dbid 1028247664 branch 880742847
Archived Log entry 110 added for thread 1 sequence 78 rlc 880742847 ID 0x3d942dcb dest 2:
Mon Jun 01 22:46:54 2015
Media Recovery Log/u02/dg11g/flash_recovery_area/DG11G/archivelog/41078_880742847.dbf
Media Recovery Waiting for thread 1 sequence 79

At this time, we cancel the log application and start the database.
Idle> recover managed standby database cancel;
Media recovery complete.
Idle> alter database open;
Database altered.

In this case, the database status is read only.
Idle> select open_mode from v $ database;
OPEN_MODE
--------------------
READ ONLY
1 row selected.

At this time, we will enable the log application, which is also a feature of the 11g.
Idle> recover managed standby database using current logfile disconnect from session;
Media recovery complete.
In this case, the status changes slightly.
Idle> select open_mode from v $ database;
OPEN_MODE
--------------------
READ ONLY WITH APPLY
1 row selected.

In this case, to verify what we do from the master database, such as creating a small table to see if the slave database can also apply logs in the open state.
Run the command in the master database.
Sys @ TEST11G> conn n1/n1
Connected.
N1 @ TEST11G> create table aaa as select * from cat;
Table created.

N1 @ TEST11G> select count (*) from aaa;
COUNT (*)
----------
19
1 row selected.

In this case, it is ineffective to immediately view the data in the slave database.
##### Standby datababse
N1 @ TEST11G> select * from aaa;
Select * from aaa
*
ERROR at line 1:
ORA-00942: table or view does not exist

N1 @ TEST11G> show user
USER is "N1"
N1 @ TEST11G>

At this time, we try to switch the logs of the master database to see how the slave database responds.
#### Primary
Alter system switch logfile;

The alert Log in the standby database is shown as follows:
### Standby log
Mon Jun 01 22:59:57 2015
RFS [2]: Selected log 8 for thread 1 sequence 79 dbid 1028247664 branch 880742847
Mon Jun 01 22:59:57 2015
Archived Log entry 111 added for thread 1 sequence 79 ID 0x3d942dcb dest 1:
Archived Log entry 112 added for thread 1 sequence 79 ID 0x3d942dcb dest 3:
Mon Jun 01 22:59:57 2015
Media Recovery Log/u02/dg11g/switchover/DG11G/archivelog/10979_880742847.dbf
Media Recovery Waiting for thread 1 sequence 80

At this time, you can view the changes in the slave database again and find that all the data changes have been synchronized.
N1 @ TEST11G> select count (*) from aaa;
COUNT (*)
----------
19
1 row selected.
N1 @ TEST11G> show user
USER is "N1"

References:

Important configuration parameters of Oracle Data Guard

Configure Oracle 11g Data Guard based on the same host

Explore Oracle 11g elastic uard

Oracle Data Guard (RAC + DG) archive deletion policies and scripts

Role conversion for Oracle Data Guard

FAL gap in Oracle Data Guard logs

Oracle 11g Data Guard Error 16143 Heartbeat failed to connect to standby

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.