In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The emergency switching exercise of the disaster recovery system should be done in production, and the disaster preparedness terminal is built by OGG. Since the production library is more than 10 T, I do not want to reinitialize the disaster recovery library after the drill. The production library version is 10.2.0.4, so I think of the new feature flashback database of 10g. Record a restore point before the start of the walkthrough, flash back to this restore point after the walkthrough, and resynchronize the ogg.
Test the flash database.
First, turn on FLASHBACK DATABASE
Database version: 10.2.0.4
Enabling the FLASHBACK DATABASE database must be in ARCHIVELOG mode, and a flashback recovery area is required to store the flashback logs, and the flashback recovery area in RAC must be in the cluster file system or ASM.
-- archiving is enabled in the database, but FLASHBACKSQL > select flashback_on,log_mode from v$database is not enabled yet FLASHBACK_ON LOG_MODE----NO ARCHIVELOG-- adjustment parameters SQL > alter system set db_recovery_file_dest_size=3G scope=spfile System altered.SQL > alter system set db_recovery_file_dest='/u01/app/oracle/flashback_area/' scope=spfile;System altered.SQL > alter system set db_flashback_retention_target=2880 scope=spfile;System altered.-- close database SQL > shutdown immediate;Database closed.Database dismounted.ORACLE instance shut down.-- start to mount state, open FLASHBACKSQL > startup mount ORACLE instance started.Total System Global Area 599785472 bytesFixed Size 2085776 bytesVariable Size 192941168 bytesDatabase Buffers 398458880 bytesRedo Buffers 6299648 bytesDatabase mounted.SQL > alter database flashback on;Database altered.-- Startup Database SQL > alter database open;Database altered.-- View New status SQL > select flashback_on,log_mode from v$database FLASHBACK_ON LOG_MODE----YES ARCHIVELOG
Official document: http://docs.oracle.com/cd/B19306_01/backup.102/b14192/rpfbdb003.htm#sthref509
The db_recovery_file_dest_size parameter indicates the size of the flashback recovery area
The db_recovery_file_dest parameter indicates the flashback recovery area directory
Db_flashback_retention_ target table is the time the flashback log is retained in minutes. Default is 1440 (1 day).
Check that flashback logs have been generated in the flashback recovery area
[oracle@rhel5 flashback_area] $cd / u01/app/oracle/flashback_area/MYDB/flashback/ [oracle @ rhel5 flashback] $ls-ltotal 8020 RWML r-1 oracle oinstall 8200192 Jan 9 14:48 o1_mf_d76cxc1r_.flb
Create a test table
SQL > conn zx/zxConnected.SQL > create table flash_t as select * from all_tables;Table created.SQL > insert into flash_t select * from flash_t;1559 rows created.SQL > / 3118 rows created.SQL > commit; Commit complete.SQL > select count (*) from flash_t; COUNT (*)-6236
Third, check the point of time at which the database can be flashed back
SQL > select * from V$FLASHBACK_DATABASE_LOG OLDEST_FLASHBACK_SCN OLDEST_FLASHBACK_ RETENTION_TARGET FLASHBACK_SIZE ESTIMATED_FLASHBACK_SIZE 7762668 20170109 14:37:32 2880 14467072 590954496
Test flashback database to a point in time
-- record the current SCN used for flashback database SQL > SELECT CURRENT_SCN FROM database database alternative CURRENTSCN-7765990-delete test table SQL > conn / as sysdbaConnected.SQL > select count (*) from zx.flash_t; COUNT (*)-6236SQL > drop table zx.flash_t;Table dropped.SQL > select count (*) from zx.flash_t Select count (*) from zx.flash_t * ERROR at line 1:ORA-00942: table or view does not exist-- Flashback Database SQL > shutdown immediate;Database closed.Database dismounted.ORACLE instance shut down.SQL > startup mount;ORACLE instance started.Total System Global Area 599785472 bytesFixed Size 2085776 bytesVariable Size 192941168 bytesDatabase Buffers 398458880 bytesRedo Buffers 6299648 bytesDatabase mounted.-- execute Flashback SQL > flashback database to scn 7765990 Flashback complete.-- opens the database SQL > alter database open resetlogs;-- in resetlogs mode. You can use alter database open read only to open the database to check the status of the database after flashback. If the flashback is not ideal, restart to mount mode and redo flashback databaseDatabase altered.-- verification test table to recover SQL > select count (*) from zx.flash_t; COUNT (*)-6236.
Flashback can also specify a time or restore point
FLASHBACK DATABASE TO RESTORE POINT BEFORE_CHANGES
FLASHBACK DATABASE TO TIME "TO_DATE ('09Accord 20Accord 2000").
Official document: http://docs.oracle.com/cd/B19306_01/backup.102/b14192/flashptr005.htm#BGBDCAFA
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: 257
*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.