Media Failure CDB Temporary File Recovery
• Automatic re-creation of temporary files at CDB opening
• Manual re-creation also possible
The CDB instance can start up with a missing temporary file. If any of the temporary files do not exist when the CDB instance is started, they are created automatically and the CDB opens normally. When this happens, a message like the following appears in the alert log during startup:
Re-creating the temp file /u01/app/oracle/oradata/CDB1/temp01.dbf
You can decide a manual recreation instead, while connected to root:
SQL> ALTER TABLESPACE temp ADD TEMPFILE '/u01/app/oracle/oradata/CDB1/temp02.dbf' SIZE 20M; SQL> ALTER TABLESPACE temp DROP TEMPFILE '/u01/app/oracle/oradata/CDB1/temp01.dbf‘;
Media Failure: PDB Temporary File Recovery
• Automatic re-creation of temporary files at PDB opening
• Manual re-creation also possible
You can perform a manual re-creation instead, while connected to the PDB:
SQL> ALTER TABLESPACE temp ADD TEMPFILE '/u01/app/oracle/oradata/CDB1/HR_PDB/temp2_02.dbf' SIZE 20M; SQL> ALTER TABLESPACE temp DROP TEMPFILE '/u01/app/oracle/oradata/CDB1/HR_PDB/temp2_01.dbf';
Media Failure: Control File Loss
Similar to non-CDBs: CDB mounted
RMAN>CONNECT TARGET / RMAN>STARTUP NOMOUNT; RMAN> RESTORE CONTROLFILE FROM AUTOBACKUP; RMAN>ALTER DATABASE MOUNT; RMAN>RECOVER DATABASE; RMAN>ALTER DATABASE OPEN RESETLOGS; RMAN> ALTER PLUGGABLE DATABASE ALL OPEN;
Media Failure: Redo Log File Loss
Missing or corrupted current redo log files, because there is only one redo stream for the CDB instance (or one redo stream for each instance of a RAC CDB), require a whole CDB media recovery .
Depending on whether a whole redo log group or only a redo log member is missing, follow the same procedures as those for non-CDBs.
Media Failure: Root SYSTEM or UNDO Data File
Similar to non-CDBs: CDB mounted
RMAN>STARTUP MOUNT; RMAN> RESTORE TABLESPACE undo1; RMAN> RECOVER TABLESPACE undo1; RMAN>ALTER DATABASE OPEN; RMAN> ALTER PLUGGABLE DATABASE ALL OPEN;
Media Failure: Root SYSAUX Data File
Similar to non-CDBs: tablespace OFFLINE
RMAN> ALTER TABLESPACE sysaux OFFLINE IMMEDIATE; RMAN> RESTORE TABLESPACE sysaux; RMAN> RECOVER TABLESPACE sysaux; RMAN> ALTER TABLESPACE sysaux ONLINE;
Media Failure: PDB Data File
Similar to non-CDBs: Perform the recovery within the PDB
• Connect to the PDB.
• Put the tablespace OFFLINE.
• Other PDBs are not impacted.
SQL> CONNECT system@sales_pdb SQL> ALTER TABLESPACE tbs2 OFFLINE IMMEDIATE; RMAN> CONNECT TARGET / RMAN> RESTORE TABLESPACE sales_pdb:tbs2; RMAN> RECOVER TABLESPACE sales_pdb:tbs2; SQL> ALTER TABLESPACE tbs2 ONLINE;
Media Failure: PITR
• PDB PITR
RMAN> ALTER PLUGGABLE DATABASE PDB1 CLOSE; RMAN> RUN { SET UNTIL SCN = 1851648 ; RESTORE pluggable DATABASE pdb1; RECOVER pluggable DATABASE pdb1 AUXILIARY DESTINATION='/u01/app/oracle/oradata'; ALTER PLUGGABLE DATABASE pdb1 OPEN RESETLOGS; }
• PDB Tablespace PITR
RMAN> RECOVER TABLESPACE PDB1:TEST_TBS UNTIL SCN 832972 AUXILIARY DESTINATION '/tmp/CDB1/reco'; RMAN> ALTER TABLESPACE PDB1:TEST_TBS ONLINE;