Simulate cold backup and recovery in archive Mode

Source: Internet
Author: User


1. Cold backup copies all database files to another directory when the database is closed. Here, you can perform some operations on the database (such as creating a table and inserting corresponding values into it, mainly to achieve the effect after restoration) 2. simulate that the database file is deleted. Delete the dbf file. Www.2cto. com3. enter the database mount status. View the scn Number of the database file header. Select file #, name, checkpoint_change # from v $ datafile_header;
You can see nothing. 4. view the data file checkpoint www.2cto in the control file. comselect file #, name, checkpoint_change # from v $ datafile; the corresponding file information is displayed because the information sources of views v $ datafile and v $ datafile_header are different.
The v $ datafile information is obtained directly from the control file. V $ datafile_header is obtained directly from the data file header. The data files are deleted, but the corresponding values cannot be found. Www.2cto. com6. open the database now. Alterdatabase open; an error is reported. You can see from this figure that the system01.dbf data file is required. Copy the backup file to this directory. 7. Run the select file #, name, checkpoint_change # from v $ datafile_header; select checkpoint_change # from v $ database. You can see from this figure. The scn number is different. Because the data file is the one backed up just now, the scn is certainly different. Now the main task is to restore the scn of the database file to the current scn through the archive file. Now we can recover 8. use the v $ recover_file view to check which databases need to be restored, such as select file #, error, change #, onine_status from v $ recover_file. The following SQL statement shows detailed information about the archived logs. Select name, first_change #, next_change #, status from v $ archive_log; you can see from the scn number which archive log is restored 9. now run the restore command www.2cto. comrecover datafile 1; 10. now, you can view the scn number in the data file header, and you can see that the current scn number is similar to the current scn. (It may be a little different because the latest data has not been updated here, only changed in memory) 11. copying other data files. Recover database; 12. Start the database now, and you will be able to query the modified content after the backup. 14. Now all the scn numbers are consistent.

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.