There is nothing fancy in this blog post, it’s only about something that coud be handy when using oracle multitenant.
Suppose that we have a CBD with multiple PDBs and we want to backup all of them and only exclude one which don’t need to be backed up (No matter what is the reason) . So how to do that the simplest way.
So of course the first problem in this case is that if CDB is in archivelog mode than it will be the same for all the PDBs (After all they are sharing the same redo threads). To reduce the redo generation of the PDBS to exclude we can at least use the “FORCE NOLOGGING” clause.
ALTER PLUGGABLE DATABASE pdb3 ENABLE FORCE NOLOGGING; NOTE : In SQL server we can just change the recovery mode to simple for our target database as every database (PDB) has it's own transaction log.
The Usual way to proceed is by specifying every PDB to backup on the command line such as
BACKUP PLUGGABLE DATABASE “CDB$ROOT”,”PDB$SEED”,PDB1,PDB2;
But frankly in some case this not very handy, it will be easier to exclude the target PDB (such as we do in data guard environment to disable replication for a specific PDB) . But there is no such way , the closest method is to exclude every tablespace of our target pdbs.
But even in this case it’s not perfect as we can not exclude the system tablespace of the target PDBS even if we don’t need it.
So i think it will be a good feature request to have an exclude PDB clause and why not (but it’s a less likely) to have every PDB with it’s own redo threads for more flexibility (It already have it’s own undo/temp) .
The possibility to put the PDBs in NOBACKUP mode is already there and is used for example for “Refreshable PDB ” it have just to be extended for other use cases.
That’s it 🙂
3 thoughts on “Partial CDB backup : Excluding a specific PDB”
thank you for the post. I learned about alter pluggable database force nologging; which can be suitable for some projects.
There is a trick how to exclude SYSTEM tablespace.
Use the undocumented procedure SYS.DBMS_BACKUP_RESTORE.SETTABLESPACEEXCLUDE for that.
SYS.DBMS_BACKUP_RESTORE.SETTABLESPACEEXCLUDE(, , );
first parameter is ts$ from v$tablespace which should be 0.
second parameter is 1 for exclusion, 0 for reset (basically inclusion again)
third parameter is con_id
Thanks for the info , i was not aware of if. I will give it a try 🙂