Control file backup and recovery (RMAN tool)

Source: Internet
Author: User

Control file backup and recovery (RMAN tool) database version

SQL> select * from v$version;BANNER--------------------------------------------------------------------------------Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - ProductionPL/SQL Release 11.2.0.1.0 - ProductionCORE    11.2.0.1.0      ProductionTNS for 32-bit Windows: Version 11.2.0.1.0 - ProductionNLSRTL Version 11.2.0.1.0 - ProductionC:\Documents and Settings\Administrator>rman target / catalog rm_user/rm_user

 

Recovery Manager: Release 11.2.0.1.0-Production on Sunday August 11 16:00:49 2013 Copyright (c) 1982,200 9, Oracle and/or its affiliates. all rights reserved. connect to the target database: ORCL (DBID = 1318810635) to restore the directory database to view the rman Configuration
RMAN> show all; db_unique_name is the RMAN Configuration Parameter of the ORCL database: configure retention policy to redundancy 1; # defaultCONFIGURE backup optimization off; # defaultCONFIGURE default device type to disk; # defaconfigconfigure controlfile autobackup on; configure controlfile autobackup format for device type disk to 'f: \ rmanbackup \ controlfile \ % F'; configure device type disk parallelism 1 backup type to backupset; # defaultCONFIGURE datafile backup copies for device type disk to 1; # defaultCONFIGURE archivelog backup copies for device type disk to 1; # defaultCONFIGURE channel device type disk format 'd: \ backup \ % d _ % s. bak '; configure maxsetsize to unlimited; # defaultCONFIGURE encryption for database off; # defaultCONFIGURE encryption algorithm 'aes128 '; # defaultCONFIGURE compression algorithm 'basic 'as of release 'default' optimize for load true; # defaultCONFIGURE archivelog deletion policy to none; # defaultCONFIGURE snapshot controlfile name to 'e: \ APP \ ADMINISTRATOR \ PRODUCT \ 11.2.0 \ DBHOME_1 \ DATABASE \ SNCFORCL. ORA '; # default

 

This indicates that the backup policy of the control file is automatic backup. A data file is backed up at will (the control file automatically backed up when this data file is backed up) RMAN> backup datafile 7; start backup from April 11 to April 13 using channel ORA_DISK_1 channel ORA_DISK_1: starting all data file backup set channels ORA_DISK_1: specifying the data file input data file in the backup set: file No. = 00007 name = E: \ RMAN. DBF channel ORA_DISK_1: Starting segment 1 from September 11 to October 13. Channel ORA_DISK_1: Completed segment 1 from September 11 to October 13. segment handle = D: \ BACKUP \ ORCL_167.BAK flag = TAG20130811T152451 note = NONE channel ORA_DISK_1: BACKUP set completed. elapsed time: 00: 00: 03 complete backup start Control File and SPFILE Autobackup from September 11 to October 13. handle = F: \ RMANBACKUP \ CONTROLFILE \ C-1318810635-20130811-00comment = NONE complete Control File and SPFILE Autobackup in-13 RMAN> shutdown immediate; database closed database unmounted Oracle instance disabled manually delete all Control files; the recovery steps are as follows; RMAN> startup nomount; the database has been started
RMAN> restore controlfile from autobackup; start the restore from 11 to 8 months-13RMAN-00571: ========================================================== ============================== RMAN-00569: ================ error message stack follows ============================ RMAN-00571: ========================================================== ============================== RMAN-03002: restore command (on 15:28:47) failed RMAN-06004: Restoring directory database ORACLE error: ORA-03114: not connected to ORACLE

 

The connection to the database has been disconnected after the database is closed; RMAN> exit recovery manager is complete. Because the database cannot be started and cannot be used to restore the directory, connect to the target database. C: \ Documents ents and Settings \ Administrator> rman target/recovery Manager: release 11.2.0.1.0-Production on Sunday August 11 15:30:05 2013 Copyright (c) 1982,200 9, Oracle and/or its affiliates. all rights reserved. connect to the target database: ORCL (not loaded) RMAN> startup nomount; the database has started RMAN> restore controlfile from autobackup; start restore from September 11 to September 13, and use the target database control file to replace ORA_DISK_1 channel ORA_DISK_1: SID = 13. 3 device type = DISK recovery area target: F: \ rmanbackup database name used for search (or unique database name): ORCL channel ORA_DISK_1: in the recovery area, AUTOBACKUP was not found because DBID was not set and the format "% F" was not tried to search the AUTOBACKUPRMAN-00571: ========================================================== ============================== RMAN-00569: ================ error message stack follows ============================ RMAN-00571: ========================================================== ============================== RMAN-03002: restore command (on 15:30:20) failed RMAN -06172: AUTOBACKUP not found, or the specified handle is not a valid copy or segment RMAN> restore controlfile from 'f: \ rmanbackup \ controlfile \ C-1318810635-20130811-00 '; start restore on September 13,. Use channel ORA_DISK_1 ORA_DISK_1: restore control file channel ORA_DISK_1: restore complete, time: 00:00:03 output file name = E: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ ORCL \ CONTROL01.CTL output file name = E: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ ORCL \ CONTROL02.CTL after the restore is viewed from month 11 to month 13, the control file has been dumped to the target location; RMAN> alter database Mount; database loaded and released channels: ORA_DISK_1 RMAN> recover database; Enable recover to start the channel allocated by implicit crosscheck backup from 11 to 8 months to 13 months: ORA_DISK_1 channel ORA_DISK_1: SID = 133 device type = DISK cross-checked 2 objects completed implicit crosscheck backup start implicit crosscheck copy on September 11-8-13 Use channel ORA_DISK_1 to complete implicit crosscheck copy on September 11-8 searching for all files in the recovery area from April 13 is compiling the file directory... no directory for file preparation. Archive logs of sequence 190 of recovery thread 1 using channel ORA_DISK_1 starting media are used as file E: \ OR ACLE \ PRODUCT \ 10.2.0 \ ORADATA \ ORCL \ REDO03.LOG exists on the disk. The archive log file name = E: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ ORCL \ REDO03.LOG thread = 1 sequence = 190 media Recovery completed, time spent: 00:00:03 completed recover on-13 RMAN> alter database open resetlogs; the database has been opened. OCP has a question like Q606. You realize that the control file is damaged in your production database. after restoring the control file from autobackup, what is the next step that you must do to procee D with the database recovery? A. mount the databaseB. open the database in NORMAL modeC. open the database in RESTRICTED modeD. open the database with the RESETLOGS option Answer: A Recovering Using RMAN Backups Restoring the Control File from the AutobackupRestoring the control file from an autobackup is similar to the steps you use to restore an SPFILE from an autobackup. RMAN> startup nomount; RMAN> restore controlfile from autobackup; RMAN> alter database mount; RMAN> recover database; RMAN> alter database open resetlogs; Note that since there is no control file, you have to open the database with NOMOUNT and then restore the control file. after you mount the database, you must recover the database, because the backup control file contains information about an older version of the database. for the same reason, you must open the database with RESETLOGS. RMAN restores the control file to all locations specified by theinitialization parameter CONTROL_FILES. if one or more of those locations are still not available, you will have to edit the CONTROL_FILES parameter to specify alternative locations or temporarily restore the control file to adifferent location;

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.