Oracle 11g Dataguard Physical standby configuration (ii) Active Dataguard test

Source: Internet
Author: User

Prior to Oracle 11g, the database needed to be in the Mount state when the physical repository (physical Standby) applied Redo. Starting from 11g, when applying redo, physical repositories can be in read-only mode, which is called Active Data Guard, which can realize real-time query function.

1. operation on standby Library

1) View the current status of the standby mount

Sql> select Open_mode,database_role,db_unique_name from V$database;

Open_mode Database_role Db_unique_name

-------------------- ---------------- ------------------------------

Mounted physical STANDBY Slave

2) Cancel the automatic recovery of the standby library

sql> ALTER DATABASE recover managed standby database cancel;

The database has changed.

3 The Open library is read-only (Dataguard can only boot to readonly mode)

sql> ALTER DATABASE open;

The database has changed.

Sql> select Open_mode,database_role,db_unique_name from V$database;

Open_mode Database_role Db_unique_name

-------------------- ---------------- ------------------------------

READ only physical STANDBY slave

4) Open Real-time application state mode

sql> ALTER DATABASE recover managed standby database using current logfile disconnect;

The database has changed.

Sql> select Open_mode,database_role,db_unique_name from V$database;

Open_mode Database_role Db_unique_name

-------------------- ---------------- ------------------------------

READ only with APPLY physical STANDBY slave

To view the real-time application of the database on the standby

Sql> select name from V$tablespace;

NAME

------------------------------

SYSTEM

Sysaux

UNDOTBS1

USERS

TEMP

5 rows have been selected.

2. Operations on the main library perform DDL,DML operation validation

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/

sql> Create tablespace abcd datafile '/u01/app/oracle/oradata/orcl/abcd.dbf ' size 10m autoextend on next

10m;

The table space has been created.

Sql> Conn ABC/ABC

is connected.

Sql> SELECT * FROM ABC;

ID NAME

---------- ----------

0 AAA

Sql>

Sql> INSERT INTO ABC values (1, ' BBB ');

1 lines have been created.

Sql> commit;

Submit completed.

Sql> SELECT * FROM ABC;

ID NAME

---------- ----------

0 AAA

1 BBB

Sql>

3. Verification operation on standby library

Sql> select name from V$tablespace;

NAME

------------------------------

SYSTEM

Sysaux

UNDOTBS1

USERS

TEMP

Abcd

6 rows have been selected.

The table space is already in the standby library.

Sql> Conn ABC/ABC

is connected.

Sql> SELECT * FROM ABC;

ID NAME

---------- ----------

0 AAA

1 BBB

Sql>

The table record has been applied.

Active Dataguard experiment ended.

This article is from "Koumm Linux Technology blog" blog, please be sure to keep this source http://koumm.blog.51cto.com/703525/1275246

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.