You are about to plug a multi-terabyte non-CDB into an existing multitenant container database
(CDB) as a pluggable database (PDB).
The characteristics of the non-CDB are as follows:
Version: Oracle Database 12c Releases 1 64-bit
Character set: WE8ISO8859P15
National character set: AL16UTF16
O/S: Oracle Linux 6 64-bit
The characteristics of the CDB are as follows:
Version: Oracle Database 12c Release 1 64-bit
Character set: AL32UTF8
O/S: Oracle Linux 6 64-bit
Which technique should you use to minimize down time while plugging this non-CDB into the
CDB?
A.
Transportable database
B.
Transportable tablespace
C.
Data Pump full export / import
D.
The DBMS_PDB package
E.
RMAN
Explanation:
Note:
* Generating a Pluggable Database Manifest File for the Non-CDB
Execute the dbms_pdb.describe procedure to generate the manifest file.
exec dbms_pdb.describe(pdb_descr_file=>’/u01/app/oracle/oradata/noncdb/noncdb.xml’);Shut down the noncdb instance to prepare to copy the data files in the next section.
shutdown immediate
exit
For me it should be C since characterset of source and target DB are different and CDB can have only one characterset and hence only export/import can work.
D
https://oracle-base.com/articles/12c/multitenant-migrate-non-cdb-to-pdb-12cr1
Using DBMS_PDB
The DBMS_PDB package allows you to generate an XML metadata file from a non-CDB 12c database, effectively allowing it to be describe it the way you do when unplugging a PDB database. This allows the non-CDB to be plugged in as a PDB into an existing CDB.
Typically, any feature used in the PDB must be present in the root container of the destination CDB prior to the migration. The following example assumes this to be the case.
Cleanly shutdown the non-CDB and start it in read-only mode.
export ORACLE_SID=db12c
sqlplus / as sysdba
SHUTDOWN IMMEDIATE;
STARTUP OPEN READ ONLY;
Describe the non-DBC using the DBMS_PDB.DESCRIBE procedure. This procedure creates an XML file in the same way that the unplug operation does for a PDB.
BEGIN
DBMS_PDB.DESCRIBE(
pdb_descr_file => ‘/tmp/db12c.xml’);
END;
/
Shutdown the non-CDB database.
export ORACLE_SID=db12c
sqlplus / as sysdba
SHUTDOWN IMMEDIATE;
Connect to an existing CDB and create a new PDB using the file describing the non-CDB database. Remember to configure the FILE_NAME_CONVERT parameter to convert the existing files to the new location.
export ORACLE_SID=cdb1
sqlplus / as sysdba
CREATE PLUGGABLE DATABASE pdb6 USING ‘/tmp/db12c.xml’
COPY
FILE_NAME_CONVERT = (‘/u01/app/oracle/oradata/db12c/’, ‘/u01/app/oracle/oradata/cdb1/pdb6/’);
Switch to the PDB container and run the “$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql” script to clean up the new PDB, removing any items that should not be present in a PDB. You can see an example of the output produced by this script here.
ALTER SESSION SET CONTAINER=pdb6;
@$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql
Startup the PDB and check the open mode.
ALTER SESSION SET CONTAINER=pdb6;
ALTER PLUGGABLE DATABASE OPEN;
SELECT name, open_mode FROM v$pdbs;
NAME OPEN_MODE
—————————— ———-
PDB6 READ WRITE
1 row selected.
SQL>
The non-CDB has now been converted to a PDB. You should backup the PDB before you start to use it.