In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Snapshot Standby, this feature puts the standby library in a "read-write state" for things that are not convenient to test in the main library of the production environment, such as simulating online testing and other tasks. When the task is completed in the read and write state of the standby database, it is very easy to switch the Snapshot Standby database role back to the standby database role and restore data synchronization with the main database. In the state of Snapshot Standby database, the slave database can accept the logs passed by the main database, but the changes cannot be applied to the standby database.
Prerequisites for physical repository to be converted to Snapshot
Stop the log application on the repository.
Enable database flashback function for standby database
The following demonstration, if switched to snapshot.
1. Stop the log application on the repository.
DGMGRL > edit database 11gdg2 set state=APPLY-OFF;Succeeded.DGMGRL >
two。 Enable the flashback function of standby database
SQL > alter database flashback on;Database altered.
3. Convert repository to 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 make some data modifications on the main library.
SQL > select count (*) from T1; COUNT (*)-56SQL > insert into T1 select * from T1 politics 56 rows created.SQL > commit;Commit complete.
5. Modify data in the repository
SQL > conn / as sysdbaConnected.SQL > select open_mode from vested database * select open_mode from vested database > conn scott/tigerConnected.SQL > create table T2 as select * from T1 lead 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 reserve library
SQL > alter database open read only;Database altered.
7. Check whether the T2 table still exists in the standby library.
SQL > conn scott/tigerConnected.SQL > select * from T2 * select * from T2 * ERROR at line 1:ORA-00942: table or view does not existSQL >
8. See if the changes made to the main library have been applied after the conversion to snapshot.
SQL > select count (*) from T1; COUNT (*)-112SQL >
The conclusion is the same as step 4.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.