Oracle Learning Dataguard (11) Snapshot database

Source: Internet
Author: User

Snapshot Standby , this feature allows the repository to be "read and write" for content that is not easy to test in the main library of the production environment, such as simulating on-line testing tasks. When the task is completed in the read and write state of the standby library, it is very easy to complete the snapshot standby database role switch back to the repository role and restore the synchronization with the master library data. In the snapshot standby database state, the repository is a log that can accept the main library, but it is not able to apply the changes to the repository.

Prerequisites for converting a physical standby Library to Snapshot

    • Stop the log app on the repository.

    • standby to turn on database flashback

As shown below, if you switch to snapshot.

1. Stop the log application on the standby library.

dgmgrl> Edit Database 11gdg2 set State=apply-off; Succeeded.dgmgrl>

2. Turn on the standby database flash back function

Sql> ALTER DATABASE Flashback On;database altered.


3. Turn the standby library into snapshot

Dgmgrl> CONVERT DATABASE 11gdg2 to SNAPSHOT STANDBY; Converting database "11GDG2" to a Snapshot Standby database, please wait ... Database "11GDG2" converted successfully

4. At this point, we do some data modification on the main library.

Sql> Select COUNT (*) from T1; COUNT (*)----------56sql> INSERT INTO T1 SELECT * from t1;56 rows created. Sql> commit; Commit complete.

5. Modifying data in the Standby repository

sql> conn/as sysdbaconnected.sql> Select Open_mode from V$database;open_ MODE------------------------------------------------------------READ writesql> Conn Scott/tigerconnected.sql > CREATE TABLE t2 as select * from T1; Table created.  Sql> Select COUNT (*) from T2; COUNT (*)----------56sql>


6. Convert snapshot to physical standby

dgmgrl> convert database 11gdg2 to physical standby; converting database  "11GDG2"  to a physical standby database, please  wait ... operation requires shutdown of instance  "Dgtst"  on database  "11GDG2" shutting down instance  "Dgtst" ... Database closed. Database dismounted. Oracle instance shut down. operation requires startup of instance  "Dgtst"  on database  "11GDG2" starting instance  "Dgtst" ... Oracle instance started. Database mounted. continuing to convert database  "11gdg2"   operation requires shutdown of instance  "Dgtst"  on database  "11GDG2" shutting down instance  "Dgtst" ... Ora-01109: database not opendatabase dismounted. Oracle instance shut down. Operation requires startup of instance  "Dgtst"  on database  "11GDG2" starting  instance  "Dgtst" ... Oracle instance started. Database mounted. database  "11GDG2"  converted successfully

Open the Standby library

Sql> ALTER DATABASE open read Only;database altered.

7. Check if the T2 table still exists in the standby library

Sql> Conn scott/tigerconnected.sql> SELECT * from T2;select * from T2 *error @ line 1:ora-00942:table Or view does not existsql>

8. See if the change data made to the main library is applied after switching to snapshot.

Sql> Select COUNT (*) from T1; COUNT (*)----------112sql>

And the 4th step is the same as the conclusion.


This article is from the "Ding Dong" blog, please be sure to keep this source http://lqding.blog.51cto.com/9123978/1682805

Oracle Learning Dataguard (11) Snapshot database

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.