Question

Oracle CDB and PDB backups - log retention issue

  • 30 August 2023
  • 10 replies
  • 182 views

Userlevel 2
Badge +11

Hello!

Consider the following scenario:

Oracle CDB DB named CDB01.

Oracle PDB DB named PDB01

Oracle PDB DB named PDB02

Oracle PDB DB named PDB03

 

Customer wants to backup PDB01 only once and keep it for 5 years. So, subclient is created pointing to PDB01 only. Full Backup is made, including logs. Consider January 1st as the backup date.

 

PDB02 and 03 need to be backed up daily. Then, a subclient is created, including PDBs 02, 03, CDB&ROOT and PDB&SEED (excluding PDB01). That sublcient is backed up with daily fulls. With 1 day retentions.

 

I noticed that the backups for CDB01 (excluding PDB01) which are daily made, with 1 day retention are not getting pruned. Day retention and forecast report states that the CDB01 jobs are required (LOG_ RULE) by the PDB01 job (which previously ran only once and will be kept for 5 years).

 

How to work around this situation?

PDB01 needs to be backed up only once in its life and be retained for 5 years.

PDBs 02 and 03, are backed up daily. And retention is only 1 day.

 

Regards,

Pedro


10 replies

Userlevel 3
Badge +8

@PedroRocha 

What needs to happen here is that you need to either set extended retention rules for the 5 year retention Backup copy (so that when the extended retention is triggered it will dis-associate the data jobs from the log jobs) and therefore Log_Rule will not prevent those jobs from aging.  

 

You can also, review this thread 

 

Userlevel 4
Badge +13

Hi @PedroRocha 

 

A container database contains a single control file and archive logs shared across the CDB & all the PDB’s. Meaning you will not be able to just retain logs for a specific PDB but it will retain all the logs as per the oracle Log_Rule. 

 

How big/huge is the entire CDB/all PDB’s ?

You could use a selective copy to retain the entire DB for longer retention which is a self content backup

 

https://documentation.commvault.com/2023e/expert/20227_configuring_oracle_selective_online_full_backups.html

 

Regards,

Gowri Shankar

 

 

Userlevel 2
Badge +11

Hello! Thanks for the answer.

 

So, the first backup from PDB01 (5 year retention, backed up once), is bringing all the logs from the other PDBs to 5 year retention, which is bad because PDB01 is small, and the other PDBs are TBs..

 

So I cannot keep the logs and other PDBs backups for 5 years...

 

Do you have any idea?

 

Hi @PedroRocha 

 

A container database contains a single control file and archive logs shared across the CDB & all the PDB’s. Meaning you will not be able to just retain logs for a specific PDB but it will retain all the logs as per the oracle Log_Rule. 

 

How big/huge is the entire CDB/all PDB’s ?

You could use a selective copy to retain the entire DB for longer retention which is a self content backup

 

https://documentation.commvault.com/2023e/expert/20227_configuring_oracle_selective_online_full_backups.html

 

Regards,

Gowri Shankar

 

 

 

Userlevel 4
Badge +13

Create a separate sub-client for the desired PDB and perform a selective online full and use a selective copy to retain backups for longer duration for this specific PDB 

 

Regards,

Gowri Shankar

Userlevel 2
Badge +11

Create a separate sub-client for the desired PDB and perform a selective online full and use a selective copy to retain backups for longer duration for this specific PDB 

 

Regards,

Gowri Shankar

Create a separate sub-client for the desired PDB and perform a selective online full and use a selective copy to retain backups for longer duration for this specific PDB 

 

Regards,

Gowri Shankar

Hi!

PDB01 already have it's own subclient, we run the backup once as this (where only PDB01 was selected):

 

If I check selective online full it does not allow me to select a specific PDB… any idea?

 

Userlevel 4
Badge +13

Hey, 

Let me check if we allows SOF on PDB’s and get back to you.

Regards,

Gowri Shankar

Userlevel 4
Badge +13

Hi @PedroRocha 

Have checked internally : the best practices is to protect the entire database for a longer retention as the logs are common across the CDB & all the PDB’s. 

 

Regards,

Gowri Shankar 

Userlevel 2
Badge +11

Hi @PedroRocha 

Have checked internally : the best practices is to protect the entire database for a longer retention as the logs are common across the CDB & all the PDB’s. 

 

Regards,

Gowri Shankar 

Hello!

 

Well… in that case if I need PDB01 to be backed up only once and retained for 5 years, I will need to keep all my other PDBs for 5 years? If the other PDBs are big, that is a big issue, don't you think?

Maybe the customer should create different CDBs for cases like that?

 

Regards,

Pedro

Userlevel 2
Badge +11

Hi @PedroRocha 

Have checked internally : the best practices is to protect the entire database for a longer retention as the logs are common across the CDB & all the PDB’s. 

 

Regards,

Gowri Shankar 

Hello!

 

Well… in that case if I need PDB01 to be backed up only once and retained for 5 years, I will need to keep all my other PDBs for 5 years? If the other PDBs are big, that is a big issue, don't you think?

Maybe the customer should create different CDBs for cases like that?

 

Regards,

Pedro

@Gowri Shankar  do you see any way for me to achieve what I was looking for?

PDB01, one backup, 5 year retention

PDB02, daily backup, 2 days retention

But PDB02 cannot be retained for 5 years...

Userlevel 4
Badge +13

@PedroRocha  Due to the way Oracle CDB/PDB manages the archive logs. Oracle do not generate logs for each PDB but the archive logs are shared across all the CDB/PDB’s & we have to consider rman limitations in this case. 

Reply