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;
- Recovery and Restore of Oracle Muti
Recovery and Restore of Oracle Muti
Oracle Solutions We believe in delivering tangible results for our customers in a cost-effective manner