Tuesday, August 5, 2025

Oracle Backup Note in Multitenant Environment

 image.jpeg

Do you take a PDB$SEED backup in Oracle backup scenarios in a multitenant environment? When do you need it?
Do we need this backup to fully restore the database in CDB level?

Short Answer:

Yes — in a full restore scenario (e.g., full data loss), you need a backup of PDB$SEED.
Even with BACKUP OPTIMIZATION ON and even if Flashback Database was previously enabled.

Here's why:

1. Flashback Database ≠ Full Restore

• Flashback only works when datafiles and controlfiles are still physically available.
• It cannot help if files were deleted or the disk crashed.
So if the database is gone or damaged beyond the flashback window — you need a full RMAN RESTORE.

2. BACKUP OPTIMIZATION ON skips unchanged files

• RMAN skips backing up read-only files (like PDB$SEED) if an identical backup already exists.
• That’s fine — but:
• You must have a valid older backup of PDB$SEED retained.
• If it's deleted or aged out (e.g., via retention policy), you can’t restore the full database.

 In other words: backup optimization assumes older backups are available if needed — but won’t warn you if they’re gone.

3. RMAN restore fails if any piece is missing


• In a full restore, CDB$ROOT, PDB$SEED, and all PDBs must be restored.
• If RMAN cannot find a backup of PDB$SEED (either recent or from earlier), the restore will fail.

Best Practice (Smarter DBA Tip):
• Always ensure at least one full backup exists that includes PDB$SEED, even if you rely on BACKUP OPTIMIZATION ON.
• You can force a fresh backup of PDB$SEED like this:
BACKUP AS BACKUPSET PLUGGABLE DATABASE PDB$SEED;
• Consider using a backup tag like 'FULL_WITH_SEED' and keeping it for DR purposes:
BACKUP DATABASE  Format '/backup/%U' TAG 'FULL_WITH_SEED' KEEP FOREVER;

So, to have an accurate backup:
Set rman backup Optimization to OFF;  

or

 Take a separated backup of pdb$seed and ensure that it is  always available.

Also consider a backup of pdbSeed : Root Container Backup

A backup of the root container is a backup of the CDB, excluding any of the PDBs.


No comments:

Post a Comment

Oracle Hot Block Concept, Detection and Resolving scenarios

  1. What is a “Hot Block” in Oracle Database ? How to detect and resolve it in Oracle Database? When your Oracle database slows down, the c...