Restore & Recover Entire Container 19c From Full Backup

Recovery and Restore of Oracle Muti-tenant Environment

Scenario: In this scenario we have full backup of entire container and we want to restore the entire container on the exact same location.

NOTE: The procedure will be the same on Standalone and RAC the only difference will come in picture incase of RAC that instead of file system you will have to restore and recover on ASM also I will suggest you to set cluster parameter to false in RAC, take one instance down and start restore and recover using single instance and once done start up the other instances.

 

–this will take backup of complete container including all pdbs,controlfile,spfile.

–the below script is just for the sake of knowledge sharing how the backup was taken.

NOTE: Make sure the directory already persist where backup files will be created.

 

RUN

{

  ALLOCATE CHANNEL c1 DEVICE TYPE DISK;

  ALLOCATE CHANNEL c2 DEVICE TYPE DISK;

  ALLOCATE CHANNEL c3 DEVICE TYPE DISK;

  ALLOCATE CHANNEL c4 DEVICE TYPE DISK;

 

  BACKUP AS COMPRESSED BACKUPSET DATABASE FORMAT ‘/u01/backup/FULLBACKUP/%d_%T_%s_%p_FULL’;

  BACKUP AS COMPRESSED BACKUPSET ARCHIVELOG ALL FORMAT ‘/u01/backup/FULLBACKUP/%d_%T_%s_%p_ARCH’;

  BACKUP CURRENT CONTROLFILE FORMAT ‘/u01/backup/FULLBACKUP/%d_%T_%s_%p_CTRL’;

  BACKUP SPFILE FORMAT ‘/u01/backup/FULLBACKUP/%d_%T_%s_%p_SPFILE’;

 

  RELEASE CHANNEL c1;

  RELEASE CHANNEL c2;

  RELEASE CHANNEL c3;

  RELEASE CHANNEL c4;

}

 

–Backup is copied to the destination server where software only is already installed so we will proceed with the below steps.

 

sqlplus / as sysdba

SQL> startup nomount pfile=’/tmp/pfile.ora’;          –this pfile is manually created and has just db_name so that to start database in nomount

rman target /

RMAN> restore spfile from ‘/u01/backup/FULLBACKUP/T24_20260224_167_1_SPFILE’;

 

 

 

SQL> shu abort;

SQL> startup nomount;

SQL> create pfile=’/tmp/prod_pfile.ora’ from spfile;

vi /tmp/prod_pfile.ora              –edit necessary information in pfile

sqlplus / as sysdba

SQL> shu abort;

SQL> startup nomount pfile=’/tmp/prod_pfile.ora’;

SQL> create spfile from pfile=’/tmp/prod_pfile.ora’;

SQL> shu abort;

SQL> startup nomount;

 

SQL> show parameter spfile;            –verify instance started from spfile.

 

rman target /

RMAN> restore controlfile from ‘/u01/backup/FULLBACKUP/T24_20260224_166_1_CTRL’;

SQL> ALTER DATABASE MOUNT;

 

RMAN> list incarnation; — note the incarnation before cataloging.

RMAN> catalog start with ‘/u01/backup/FULLBACKUP’;

RMAN> list incarnation; — note the incarnation after cataloging.

 

RMAN> crosscheck backup;

RMAN> crosscheck archivelog all;

RMAN> delete expired backup;

RMAN> delete expired archivelog all;

 

–the below script will restore and recover the entire container.

RUN {

  ALLOCATE CHANNEL c1 DEVICE TYPE DISK;

  ALLOCATE CHANNEL c2 DEVICE TYPE DISK;

  ALLOCATE CHANNEL c3 DEVICE TYPE DISK;

  ALLOCATE CHANNEL c4 DEVICE TYPE DISK;

 

  RESTORE DATABASE;

  RECOVER DATABASE;

 

  RELEASE CHANNEL c1;

  RELEASE CHANNEL c2;

  RELEASE CHANNEL c3;

  RELEASE CHANNEL c4;

}

 

–once done with restore and recover open with reset logs and bounce

SQL> ALTER DATABASE OPEN RESETLOGS;

SQL> shutdown immediate;

SQL> startup;

–issue some log switches

SQL> ALTER SYSTEM SWITCH LOGFILE;

SQL> ALTER SYSTEM SWITCH LOGFILE;

 

 

 

About Dost Muhammad Khalil

As an Oracle Database Administrator, I bring a wealth of technical expertise and problem-solving skills to ensure the smooth operation and high performance of mission-critical databases. With a strong foundation in database administration, performance tuning, backup and recovery, and security, I have a proven track record of delivering reliable and scalable database solutions that meet business needs. My ability to communicate effectively with stakeholders, project managers, and technical teams enables me to collaborate seamlessly and deliver projects on time and within budget. Additionally, my passion for staying up-to-date with emerging technologies and best practices in database administration allows me to stay ahead of the curve and continuously improve the performance and reliability of database environments. With a commitment to excellence and a strong work ethic, I am confident in my ability to deliver outstanding results as an Oracle Database Administrator. I look forward to connecting with like-minded professionals and exploring opportunities to make a positive impact in the field of database administration.

Leave a Reply