Backup | recovery | Hot BACKUP | data
Use hot backup for time-sharing recovery
----How to recover incrementally from archiving to shorten data migration time
Last Updated:monday, 2004-11-15 10:32 eygle
A lot of times you may encounter a situation like this:
The migration of a large database, but with little downtime, seems fraught with difficulty. But we can shorten the downtime by various means.
This example applies to the same platform, the same version of the database migration.
In this case, we can use a hot backup to apply the archive to restore the database to a consistent state, at which point the database can be opened by read only.
Then we can continue to apply the archive for recovery, the last only need a short downtime, copy the original database of online logs and archive logs, control files to the new library, to recover, at this time
It only takes a very short time to complete the recovery.
This method can greatly shorten the cutting time. The following is a sample step for reference:
1. Start the database
Query Archive situation
Sql> select name from V$archived_log; NAME--------------------------------------------------------------------------------E:\ORACLE\ORADATA\EYGLE\ REDO01. Loge:\oracle\oradata\eygle\redo02. Loge:\oracle\oradata\eygle\redo03. Loge:\oracle\oradata\eygle\archive\arc00001.001e:\oracle\oradata\eygle\archive\arc00002.001e:\oracle\oradata\ Eygle\archive\arc00003.001e:\oracle\oradata\eygle\archive\arc00004.001e:\oracle\oradata\eygle\archive\ Arc00005.001e:\oracle\oradata\eygle\archive\arc00006.001e:\oracle\oradata\eygle\archive\arc00001.001e:\oracle\ Oradata\eygle\archive\ Arc00002.001name--------------------------------------------------------------------------------E:\ORACLE\ Oradata\eygle\archive\arc00003.001e:\oracle\oradata\eygle\archive\arc00004.001e:\oracle\oradata\eygle\archive\ ARC00005.001E:\ORACLE\ORADATA\EYGLE\ARCHIVE\ARC00006.001 has selected 15 rows.
Archive Current Log
sql> alter system switch logfile;
The system has changed.
2. Backing Up the database
Backup scripts:
Alter TABLESPACE system begin backup;host Copy E:\ORACLE\ORADATA\EYGLE YSTEM01. DBF E:\oracle\orabak YSTEM01. Dbfalter tablespace system End Backup;alter tablespace undotbs1 begin backup;host Copy E:\ORACLE\ORADATA\EYGLE\UNDOTBS01 . DBF e:\oracle\orabak\UNDOTBS01. Dbfalter tablespace undotbs1 End backup;alter tablespace eygle begin backup;host Copy E:\ORACLE\ORADATA\EYGLE\EYGLE01. DBF e:\oracle\orabak\EYGLE01. DBF alter tablespace Eygle end backup;
To perform a backup:
Sql> @e:\a.sql table space has changed. 1 files have been copied. The table space has changed. The table space has changed. 1 files have been copied. The table space has changed. The table space has changed. 1 files have been copied. The table space has changed. The database has changed.
3. Change data and archive part of the log
sql> INSERT INTO eygle.test select *from eygle.test; 224 rows have been created. Sql> Commit, Commit, complete. sql> ALTER SYSTEM switch logfile the system has changed. sql> INSERT INTO eygle.test select *from eygle.test; 448 rows have been created. Sql> Commit, Commit, complete. sql> ALTER SYSTEM switch logfile the system has changed. sql> INSERT INTO eygle.test select *from eygle.test; 896 rows have been created. Sql> Commit, Commit, complete. sql> shutdown immediate; The database has been closed. The database has been unloaded. The ORACLE routine has been closed.
4. Implementation of recovery
Recovering backed-up data files, starting the database
Use current log and control file
The sql> startup Mount;oracle routine has started. Total System Global area 47259136 bytesfixed size 454144 bytesvariable size 29360128 bytesdatabase buffers 16777216 Edo buffers 667648 bytes database mount completed. sql> Recover database using Backup Controlfile until cancel;ora-00279: Change 197282 (generated at 11/13/2004 23:30:48) is required for thread 1 ORA-00289: Recommendation: E:\ORACLE\ORADATA\EYGLE\ARCHIVE\ARC00008.001ORA-00280: Change 197282 for thread 1 is the specified log in sequence # 8: {=suggested | fil ename | AUTO | cancel}ora-00279: Change 197393 (generated in 11/13/2004 23:32:22) is required for thread 1 ORA-00289: Recommendation: E:\ORACLE\ORADATA\EYGLE\ARCHIVE\ARC00009 .001ora-00280: Change 197393 ORA-00278 for thread 1 is in sequence # 9: This restore no longer requires log file ' E:\ORACLE\ORADATA\EYGLE\ARCHIVE\ARC00008.001 ' to specify the log: {= Suggested | filename | AUTO | Cancel}cancel Media recovery has been canceled. Sql> ALTER DATABASE open read only; the database has changed. sql> shutdown immediate; The database has been closed. The database has been unloaded. The ORACLE routine has been closed. The sql> startup Mount;oracle routine has started. Total System Global area 47259136 bytesfixed size 454144 bytesvariable size 29360128 bytesdatabase buffers 16777216Redo buffers 667648 Bytes Database mount completed. sql> Recover database using Backup Controlfile until cancel;ora-00279: Change 197393 (generated at 11/13/2004 23:32:22) is required for thread 1 ORA-00289: Recommendation: E:\ORACLE\ORADATA\EYGLE\ARCHIVE\ARC00009.001ORA-00280: Change 197393 for thread 1 is the specified log in sequence # 9: {=suggested | fil ename | AUTO | cancel}ora-00279: Change 197423 (generated in 11/13/2004 23:32:51) is required for thread 1 ORA-00289: Recommendation: E:\ORACLE\ORADATA\EYGLE\ARCHIVE\ARC00010 .001ora-00280: Change 197423 ORA-00278 for thread 1 is in sequence # 10: This restore no longer requires log file ' E:\ORACLE\ORADATA\EYGLE\ARCHIVE\ARC00009.001 ' to specify the log: { =suggested | filename | AUTO | Cancel}cancel Media recovery has been canceled. Sql> ALTER DATABASE open read only; the database has changed. sql> shutdown immediate; The database has been closed. The database has been unloaded. The ORACLE routine has been closed. The sql> startup Mount;oracle routine has started. Total System Global area 47259136 bytesfixed size 454144 bytesvariable size 29360128 bytesdatabase buffers 16777216 Edo buffers 667648 bytes database mount completed. sql> Recover database using Backup Controlfile until cancel;ora-00279: Change 197423 (generated at 11/13/2004 23:32:51) is required for thread 1 ORA-00289: Recommendation: E:\ORACLE\ORADATA\EYGLE\ARCHIVE\ARC00010.001ORA-00280: Change 197423 for thread 1 is the specified log in sequence # 10: {=suggested | fil ename | AUTO | Cancel}e:\oracle\oradata\eygle\redo01. LOGORA-00310: Archive log contains sequence 9; required sequence 10ora-00334: Archive log: ' E:\ORACLE\ORADATA\EYGLE\REDO01. LOG ' sql> recover database using Backup Controlfile until cancel;ora-00279: Change 197423 (generated at 11/13/2004 23:32:51) for thread 1 is required ORA-00289: Recommendation: E:\ORACLE\ORADATA\EYGLE\ARCHIVE\ARC00010.001ORA-00280: Change 197423 for thread 1 is the specified log in sequence # 10: {=suggested | filename | AUTO | Cancel}e:\oracle\oradata\eygle\redo02. Log that has been applied. Complete media recovery. sql> ALTER DATABASE Open;alter database Open*error is on line 1th: ORA-01589: To open the database, you must use the Resetlogs or Noresetlogs option sql> alt The ER database open resetlogs the database has changed. Sql>
Note that the middle part, read only open does not affect the further recovery of the database. That is to say, the recovery can be done in a step-by-step way.
The author of this article:
Eygle,oracle technology concern, from China's largest Oracle technology forum Itpub.
Www.eygle.com is the author's personal site. You can contact the author by Guoqiang.Gai@gmail.com. Welcome technical discussions and exchange of links.
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.