Oracle controlfile backup and recovery

Source: Internet
Author: User

Oracle controlfile backup and recovery backup: alter database backup controlfile to 'xxxxxx' reuse; alter database bakcup controlfile to trace as 'xxxxxxxx'; RMAN backup control file recovery instance: 1. after the control file is corrupted, use the binary backup to restore (abnormal power failure) backup control file: alter database backup controlfile to '/home/oracle/control. ctl 'reuse; insert test data: SQL> insert into t1 values (1); SQL> commit; simulate power failure: SQL> shutdown abort; simulate control File Failure: rm-rf/database/oradata/skyread/control01.ctlrm -Rf/database/oradata/skyread/control02.ctlrm-rf/database/oradata/skyread/control03.ctl restart database: SQL> startup; ORA-00205: error in identifying control file, check alert log for more info error 00205 copy backup file to Database control File Location: cp/home/oracle/control. ctl/database/oradata/skyread/control01.ctlcp/home/oracle/control. ctl/database/oradata/skyread/control02.ctlcp/home/oracle/control. ctl/database/oradata/skyread /Control03.ctlSQL> startup force mountTotal System Global Area 5049942016 bytesFixed Size 2090880 bytesVariable Size 1375733888 bytesDatabase Buffers 3657433088 bytesRedo Buffers 14684160 bytesDatabase mounted. check the scn information of data files, data file headers, log files, and control files. The fuzzy status here is YESSQL> select file #, status, and fuzzy, CHECKPOINT_CHANGE # from v $ datafile_header; FILE # status fuz CHECKPOINT_CHANGE #------------------------- -- --- -------------------- 1 online yes 122694280130 2 online yes 122694280130 3 online yes 122694280130 4 online yes 122694280130 18 online yes 122694280130 26 online yes 122694280130 31 online yes 122694280130SQL> select group #, sequence #, members, archived, status, first_change # from v $ log; GROUP # SEQUENCE # members arc status FIRST_CHANGE #---------------------------------------------------------- -- --- ---------------- ------------------ 1 1 1 no current 122694212304 2 2 1 yes inactive 122693905385 5 3 1 yes inactive 122694191761 4 4 1 yes inactive 122694190542 3 5 1 yes inactive 122694168156 CONTROLFILE_CHANGE # It is during Backup control File SCN, the data file checkpoint must be greater than the backup control file. Therefore, when the data is opened, the checkpoint information of the data file, log file, and control file is inconsistent, the preceding V $ LOG and V $ DATAFILE must be consistent with the checkpoint of the backup control file. However, v $ datafile_header records the latest information, that is, before the database is closed. Therefore, if it is enabled, it will check whether the checkpoint count in the data file header is equal to the checkpoint Technology in the current control file. If it is equal, perform the second check, that is, check whether the SCN at the beginning of the data file header is equal to the SCN at the end of the control file. If they are equal, you do not need to restore them. If they are not equal, you need to restore them. This is obviously not the same, so we need a recovery. SQL> select checkpoint_change #, controlfile_change #, resetlogs_change # from v $ database; CHECKPOINT_CHANGE # CONTROLFILE_CHANGE # RESETLOGS_CHANGE # ------------------------------ medium 122694212305 122694259161 122693676208 media recovery database: prompt to apply redo01.logSQL> recover database using backup controlfile; ORA-00279: change 122694280130 generated at 05/03/2013 11:25:37 needed forthread 1ORA-0 0289: suggestion:/database/oradata/arch/keys limit 814447469.dbfora-00280: change 122694280130 for thread 1 is in sequence #1 Specify log: {<RET> = suggested | filename | AUTO | CANCEL}/database/oradata/skyread/redo01.logLog applied. media recovery complete. reset the log file to open the database: SQL> alter Database open resetlogs; database altered. 2. after the control file is corrupted, use the trace file to recreate the control file (normally shut down). The backup control file is in the text format. SQL> alter database backup controlfile to tr Ace as '/home/oracle/controlfile. SQL 'reuse; Database altered. close the database and destroy all control files. SQL> shutdown immediate; mv/database/oradata/skyread/control01.ctl/database/oradata/skyread/control01.ctl. bakmv/database/oradata/skyread/control02.ctl/database/oradata/skyread/control02.ctl. bakmv/database/oradata/skyread/control03.ctl/database/oradata/skyread/control03.ctl. an error occurred while opening the database in bak: SQL> startup; ORACLE instance start Ed. total System Global Area 5049942016 bytesFixed Size 2090880 bytesVariable Size 1375733888 bytesDatabase Buffers 3657433088 bytesRedo Buffers 14684160 bytesORA-00205: error in identifying control file, check alert log for more info in nomount mode with/home/oracle/controlfile. the SQL statement re-constructs the control file. Note that NORESETLOGS is used here. Here, we close the data for testing, which is equivalent to no damage to both the data file and log file, the control file is constructed based on the information of the data file header and Log File Header. Therefore, the control file and the data file header are consistent with the log file header. You can directly open the database without recover. Note: If the binary backup control file is used for restoration, recover is required because the backup binary file is inconsistent with the current data file header information. Create controlfile reuse database "SKYREAD" noresetlogs force logging archivelog maxlogfiles 20 MAXLOGMEMBERS 5 MAXDATAFILES 1000 MAXINSTANCES 8 MAXLOGHISTORY 2337 logfile group 1'/database/oradata/skyread/redo01.log 'SIZE 512 M, GROUP 2'/database/oradata/skyread/redo02.log 'SIZE 512 M, GROUP 3'/database/oradata/skyread/redo03.log' SIZE 512 M, GROUP 4'/database/oradata/skyread/redo04.log 'SIZE 512 M, GROUP 5'/database/oradata/skyread/redo05.log 'SIZE 512 MDATAFILE'/database/oradata/skyread/system01.dbf ','/database/oradata/skyread/tbs_test.dbf ', '/database/oradata/skyread/sysaux01.dbf','/database/oradata/skyread/users01.dbf ','/database2/oradata/skyread/TBS_MRPMUSIC01.dbf ', '/database/oradata/skyread/sf01.dbf','/database2/oradata/skyread/undotbs02 'character set UTF8; SQL> alter database open; Database altered

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.