What are the steps to restore a corrupted or lost controlfile from autobackup?
Question is closed for new answers.
meda Changed status to publish 16/07/2022
Lost or corrupted controlfile can be restored from autobackup provided that controlfile autobackup is configured using RMAN ‘CONFIGURE’ command:
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON
Once autobackup is configured, the assumption is that backup of controlfile is taken after configuration.
Here are the steps to restore the control file:
---Try to connect to the database with the missing controlfile SQL> conn sys/orcl@to_primary as sysdba; Connected to an idle instance. SQL> startup; ORACLE instance started. Total System Global Area 2499805184 bytes Fixed Size 8749920 bytes Variable Size 687869088 bytes Database Buffers 1795162112 bytes Redo Buffers 8024064 bytes ORA-00205: error in identifying control file, check alert log for more info ---Connect to RMAN and perform the restore and recover tasks SQL> $ rman target "'/ as sysbackup '" Recovery Manager: Release 12.2.0.1.0 - Production on Sat Feb 12 23:18:31 2022 Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved. connected to target database: ORCL (not mounted) ---Start in no mount state because there is no controlfile. RMAN> startup nomount; ---- Starts the background processes and allocates memory, doesn't read control files database is already started ---Restore the controlfile from autobackup RMAN> restore controlfile from autobackup; Starting restore at 12-FEB-22 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=379 device type=DISK recovery area destination: D:\app\Admin\virtual\fast_recovery_area\orcl database name (or database unique name) used for search: PRIMARY channel ORA_DISK_1: AUTOBACKUP D:\APP\ADMIN\VIRTUAL\FAST_RECOVERY_AREA\ORCL\PRIMARY\AUTOBACKUP\2022_02_12\O1_MF_S_1096499657_K0J58W84_.BKP found in the recovery area AUTOBACKUP search with format "%F" not attempted because DBID was not set channel ORA_DISK_1: restoring control file from AUTOBACKUP D:\APP\ADMIN\VIRTUAL\FAST_RECOVERY_AREA\ORCL\PRIMARY\AUTOBACKUP\2022_02_12\O1_MF_S_1096499657_K0J58W84_.BKP channel ORA_DISK_1: control file restore from AUTOBACKUP complete output file name=D:\APP\ADMIN\VIRTUAL\ORADATA\ORCL\CONTROL01.CTL output file name=D:\APP\ADMIN\VIRTUAL\FAST_RECOVERY_AREA\ORCL\CONTROL02.CTL Finished restore at 12-FEB-22 ---Now the controlfile is available and lets start the database in mount state-- RMAN> alter database mount; Statement processed released channel: ORA_DISK_1 ---Recover the database RMAN> recover database; Starting recover at 12-FEB-22 Starting implicit crosscheck backup at 12-FEB-22 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=379 device type=DISK Crosschecked 12 objects Finished implicit crosscheck backup at 12-FEB-22 Starting implicit crosscheck copy at 12-FEB-22 using channel ORA_DISK_1 Crosschecked 2 objects Finished implicit crosscheck copy at 12-FEB-22 searching for all files in the recovery area cataloging files... cataloging done List of Cataloged Files ======================= File Name: D:\APP\ADMIN\VIRTUAL\FAST_RECOVERY_AREA\ORCL\PRIMARY\AUTOBACKUP\2022_02_12\O1_MF_S_1096499657_K0J58W84_.BKP using channel ORA_DISK_1 starting media recovery archived log for thread 1 with sequence 2 is already on disk as file D:\APP\ADMIN\VIRTUAL\ORADATA\ORCL\REDO02.LOG archived log file name=D:\APP\ADMIN\VIRTUAL\ORADATA\ORCL\REDO02.LOG thread=1 sequence=2 media recovery complete, elapsed time: 00:00:01 Finished recover at 12-FEB-22 ---Open the database -- RMAN> alter database open resetlogs; Statement processed RMAN> exit Recovery Manager complete. ---Finally, you will be connected to your database without an error-- SQL> conn sys/orcl@to_primary as sysdba; Connected. SQL>
meda Changed status to publish 24/09/2022