0

In oracle 12c the ALTER PLUGGABLE DATABASE "PDB1" UNPLUG INTO 'PDB1.XML' statement create the XML manifest. Is it possible to plug a PDB in a new CDB if it isn't correctly unplugged first and the source CDB isn't active?

  • Seems that there is no simple way to achieve this. PDBs doesn't have control files and redo logs, and if not unplugged there isn't no XML manifest. So, AFAIK, you can't do a recover without control files and redologs, and this means that first have to recover the entire CDB. – sgargel Jan 28 '16 at 9:21
1

you can recover the XML file of a not unplugged PDB.

  1. COPY the PDB folder into the CDB folder on the new machine.
  2. Connect as SYSDBA to the new CDB (I use SQLDeveloper)
  3. EXECUTE the package DBMS_PDB.RECOVER

it uses 3 parameters:

  1. /path/to/new/file.xml
  2. NAME_OF_PDB (you can use the same as OLD PDB or a NEW ONE)
  3. /path/to/pdb/folder/

EXAMPLE:

BEGIN
  DBMS_PDB.RECOVER (
  pdb_descr_file => '/path/to/new/file.xml.xml',
  pdb_name => 'NAME_OF_PDB',
  filenames => '/path/to/pdb/folder/'
  );
END;
/

THEN, you can plug the database using:

CREATE PLUGGABLE DATABASE NAME_OF_PDB USING '/path/to/new/file.xml' NOCOPY TEMPFILE REUSE;

THEN open the PDB:

ALTER PLUGGABLE DATABASE NAME_OF_PDB OPEN FORCE;

IF PDB DON'T OPEN, check PDB_VIOLATIONS

SELECT * FROM PDB_PLUG_IN_VIOLATIONS;

SOURCE http://www.oraclebuffer.com/oracle/oracle-12c-lost-your-pdbs-xml-manifest-file-heres-how-you-can-recover-it/

  • I can't try this procedure by now but I found reference also on oracle doc. You can add the link to your answer. :-) – sgargel Mar 23 '17 at 15:18
0

If you want to keep the PDB in the source CDB, you do not need to unplug the PDB, you can just simply clone the PDB to another CDB:

  • Have a user in the source PDB or CDB with the CREATE PLUGGABLE DATABASE privilege
  • Open the source PDB in read-only mode
  • In the target CDB, create a database link to the source PDB with the above user
  • In the target CDB: CREATE PLUGGABLE DATABASE pdbclone FROM pdbsource@dblink;

More details at:

Cloning a Remote PDB or Non-CDB

  • Sorry, i was not clear, is there a way to do this without the source CDB active? – sgargel Jan 27 '16 at 15:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.