How to Restore Lost Control Files in a RAC Environment with Zero Data Loss

To restore a lost control file in a RAC environment, you must ensure that your backups are intact and up-to-date.

The process is done in two stages. First, you will need to start only one instance in nomount mode and then perform the control file restore.

Next, you will need to restart the instance and bring it to mount mode, execute the restore, and recover the database. Finally, the database will be opened with open reset logs, and the missing instance will be started without reset logs.

Replace the values of <database_name> with the database name (db_unique_name), and <instance_name> with the instance name (instance_name or ORACLE_SID).

Also, replace the dbid value, and make sure to use the correct paths for the library and wallet.

First, let’s start one of the instances in nomount mode:

srvctl start instance -i <instance_name> -d <database_name> -o nomount

rman target / catalog /@zdl_ra01

set dbid xxx
run {
  ALLOCATE CHANNEL X1 DEVICE TYPE 'SBT_TAPE' FORMAT   '%d_%U' PARMS  "SBT_LIBRARY=/u01/app/oracle/product/19.0.0.0/lib/libra.so, SBT_PARMS=(_RA_NO_SSL=TRUE,RA_WALLET='location=file:/u01/app/oracle/wallets/zdl credential_alias=zdl_ra01')";
  restore controlfile;
}

Due to the use of control file names generated by ASM, it will be necessary to perform a shutdown in order to retrieve the new names generated by the restore.

srvctl stop database -d <database_name> -o immediate
srvctl start instance -i <instance_name> -d <database_name> -o mount

rman target / catalog /@zdl_ra01

run {
  ALLOCATE CHANNEL X1 DEVICE TYPE 'SBT_TAPE' FORMAT   '%d_%U' PARMS  "SBT_LIBRARY=/u01/app/oracle/product/19.0.0.0/lib/libra.so, SBT_PARMS=(_RA_NO_SSL=TRUE,RA_WALLET='location=file:/u01/app/oracle/wallets/zdl credential_alias=zdl_ra01')";
 restore database;
 recover database;
 sql 'alter database open resetlogs';
}

Start the missing instance:

srvctl start instance -i <instance_name> -d <database_name>

Deixe um comentário