Database Reference
In-Depth Information
You are given great flexibility as to specifying where a file comes from, and where it should be moved to. Assume
for example that the data files for the production PDB “vipdb1” is described similar to the one that follows below in
the XML document:
...
<path>/u01/oradata/pdbs/vipdb1/system01.dbf</path>
...
You could further assume that the files pertaining to the PDB have been copied via sftp to a staging location on
the UAT database server: /m/transfer/pdbs/vipdb1/ . Both production and UAT server use Linux file systems to store
Oracle data files. Using that information, you'd have to use the following syntax to plug the PDB into the UAT CDB:
SYS@CDB$ROOT> get create_pdb_plugin.sql
1 create pluggable database vipdb1uat as clone
2 using '/home/oracle/vipdb1.xml'
3 source_file_name_convert=(
4 '/u01/oradata/pdbs/vipdb1','/m/transfer/pdbs/vipdb1')
5 file_name_convert=(
6 '/m/transfer/pdbs/vipdb1','/u01/oradata/CDB1/VIPDB1UAT')
7* tempfile reuse
SQL> /
Pluggable database created.
Another interesting use case could be the migration from file system ASM. This has been a simple operation
in the past involving image copies of the data files to which the database was switched over to. With PDBs this has
become a slightly different operation as shown here:
SQL> create plugable database asmpdb2 using '/m/transfer/pdbs/fspdb1.xml'
2 copy source_file_name_convert = ...
3 /
The destination CDB has its db_create_file_dest initialization parameter set to '+DATA, allowing the PDB to be
copied into ASM-disk group '+DATA.
Plugging a non-CDB into a CDB
Plugging in a non-CDB is your opportunity to move databases just migrated to Oracle 12.1, or other databases that
haven't been created as Container Databases into the consolidation platform. For this scenario you can make use of
another package created by Oracle, called DBMS_PDB. The procedure of plugging in a non-CDB into a CDB is very
similar to the one just described in the section “Moving PDBs between different containers”.
To plug the non-CDB into the container as a Pluggable Database a few steps need to be followed. In the first step
you use the DBMS_PDB package's describe() function while connected to the non-CDB to create the XML meta data
file. The file can only be created if the non-CDB is opened read-only. Shut the non-CDB database down after the XML
file has been created successfully in preparation for the next step.
Connect to the CDB you want to use as the non-CDB's container and use the “create pluggable database”
statement to plug the database into the new container. Refrain from opening the new PDB just yet. Connect to the
PDB and execute the noncdb_to_pdb.sql script in $ORACLE_HOME/rdbms/admin to complete the conversion to a PDB.
This section has been kept short deliberately: You can read more about plugging in a non-CDB into a CDB in
Chapter 12, complete with an example.
 
Search WWH ::




Custom Search