Control file and parameter file recovery of Rman database recovery

Source: Internet
Author: User

One, the recovery of control files
1, the path of the query control file

SQL>SELECT* from v$controlfile; STATUS NAME is_recovery_dest_file block_size file_size_blks------------------------------------- -----------------------------------------------------------------------------16384594  16384594

2. Delete the control file

Sql> shutdownimmediate; The database is closed. The database has been uninstalled. The ORACLE routine has been closed. SQL>host del D:\APP\ADMINISTRATOR\ORADATA\ORCL\CONTROL01. Ctlsql>The startuporacle routine has been started. Total System Global Area647204864bytesfixed Size2178536bytesvariable Size478151192bytesDatabaseBuffers159383552Bytesredo Buffers7491584Bytesora-00205:.....  SQL> shutdownImmediate;ora-01507: The ORACLE routine has been closed. 

3, start database to Nomount status

 rman>  set  dbid=  1392118573   >   startup Nomount;oracle routine has started. Total System Global area  647204864   bytesfixed Size  2178536   bytesvariable Size  478151192   bytes  database  Buffers 159383552   Bytesredo buffers  7491584  bytes 

4. Restore Control files

RMAN> RESTOREControlfile fromAutobackup;--The control file is restored to the initialization parameter: Control_files the specified path. StartRestoreIn +-December- -Use the target database control file instead of the channel for recovering directory allocations: Ora_disk_1 Channel Ora_disk_1:sid=TenDevice type=DISKRecovery Zone target: D:\app\Administrator\flash_recovery_area the database name (or unique name of the database) used for the search: ORCL Channel ora_disk_1: Find Autobackup d:\ in the recovery area App\administrator\flash_recovery_area\orcl\autobackup\2014_12_ +\o1_mf_s_866919295_b9f9r0bl_. BKP The format was not attempted because DBID was not set "%F "Search Autobackup Channel Ora_disk_1: D:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\AUTOBACKUP\2014_12_ from Autobackup  +\o1_mf_s_866919295_b9f9r0bl_. BKP Restore control File Channel ora_disk_1: Restore control file from autobackup output file name completed=D:\APP\ADMINISTRATOR\ORADATA\ORCL\CONTROL01. CTL Output File name=D:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\CONTROL02. CTL CompleteRestoreIn +-December- -

5. Mount-recover-open Database

RMAN> ALTER DATABASEMount; The database has loaded the freed channel: Ora_disk_1rman>RECOVERDATABASE; start recover in +-December- -Start implicit crosscheckBackupIn +-December- -Allocated channel: Ora_disk_1 Channel Ora_disk_1:sid=TenDevice type=DISKCross-checked7Object Completion Implicit CrosscheckBackupIn +-December- -start implicit crosscheck copy on +-December- -use channel ora_disk_1 to complete implicit crosscheck copy +-December- -Search all files in recovery area are being compiled file directory ... List of directory-listed files that have been compiled=======================file name: D:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\AUTOBACKUP\2014_12_ +\o1_mf_s_866919295_b9f9r0bl_. BKP using a channel ora_disk_1 the recovery thread that is starting the media1Sequence AThe archive log has been used as a file D:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2014_12_ +\o1_mf_1_22_b9dr7ds3_. ARC Save Thread1Sequence atThe archive log has been used as a file D:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2014_12_ +\o1_mf_1_23_b9dzjwgj_. ARC Save Thread1Sequence -The archive log has been used as a file D:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2014_12_ +\o1_mf_1_24_b9f6wmp8_. ARC Save Thread1Sequence -The archive log has been D:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO03 as a file.LOGArchive log file name exists on disk=D:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2014_12_ +\o1_mf_1_22_b9dr7ds3_. ARC thread=1Sequence= AArchive log file name=D:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2014_12_ +\o1_mf_1_23_b9dzjwgj_. ARC thread=1Sequence= atArchive log file name=D:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2014_12_ +\o1_mf_1_24_b9f6wmp8_. ARC thread=1Sequence= -Archive log file name=D:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO03.LOGThread=1Sequence= -Media recovery Complete, time:xx:xx:Genevacomplete Recover in +-December- -RMAN> ALTER DATABASE OPENresetlogs; The database is open

----------------------------------------------------------------
Description:
1, due to loss of control file, You can only start the database to the Nomount state. However, before starting the database, you must first set the dbid through set. Queries about dbid can be queried through the v$database view, or it is the backup log for Rman, and dbid is also displayed when the file name of the automatic backup contains a Dbid;rman connection to the target database.
2, if it is in Nocatalog mode, the backup information created by Rman will be saved in the control file of the target database, so once the control file is lost, not only the target database crashes, but also the backup information of Rman is lost. If you have a backup control file, you can restore it, and if not, you can only rewrite the control file by writing a script.
3, because the control file is restored through the backup, so the resetlogs must be specified when opening;
4, if the default path of the automatic backup has been modified before the backup is performed, the backup file will not be found when the restore Controlfile from Autobackup is executed. You need to reset the automatic backup path, or manually copy the automatic backup control file to the current default path.
When you modify the save path for automatic backup of control files in Nocatalog mode, use the SET command:
rman> set autobackup FORMAT for DEVICE TYPE DISK to ' previously modified path ';
Then execute the restore command to recover the control files from the automatic backup.
rman> RESTORE controlfile from Autobackup;
5. Restore the control file from the specified backup set
rman> restore Controlfile from ' backup set path ';--you can also add the to parameter to restore the control file to the specified path.

Second, restore the server-side initialization parameter file SPFile
The backup SPFile command may have been manually backed up to initialize the parameter file. However, the general Rman automatically backs up the spfile when it backs up the control files;
The recovery parameters file is similar to the recovery control file:
Execute recovery Parameters File command:
RESTORE SPFILE from Autobackup;
SPFile File Modification:
Since the SPFile file is a binary file and cannot be edited directly, if you want to modify it, you can first create the Pfile (client initialization parameter file) through SPFile, and Pfile can open the edit directly with Notepad. You can then create the SPFile by Pfile.

Sql>SHOW PARAMETER spfile;name TYPE VALUE------- ----------- ------------------------------SPFile string D:\APP\ADMINISTRATOR\PRODUCT\11.2.0\dbhome_1\DATABASE\SPFILEORCL. Orasql> CreatePfile= 'D:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_1\DATABASE\PFILEORCL. ORA'  fromSPFile--The absolute path can also be added after the From spfile= ' ... ';The file was created. SQL> CreateSPFile fromPfile= 'D:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_1\DATABASE\PFILEORCL. ORA';--Create the SPFile file from the Pfile file. 

Control file and parameter file recovery of Rman database recovery

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.