From
Database Name :
mdbpdb3
Container Database name : mdbcdb
Data files directory : “/app/oracle/mdbcdb/mdbpdb3”
To
Database Name :
mdbpdb_new
Container Database name : ORCL
Data files directory : “/app/oracle/mdbpdb_new”
Task: unplug pluggable
database from mdbpdb3 from mdbcdb container database and plug it into another container
database “ORCL” with new name “mdbpdb_new”
Move data files from “/app/oracle/mdbcdb/mdbpdb3” to “/app/oracle/mdbpdb_new”
directory.
Connect
to mdbcdb database
$ export ORACLE_SID=mdbcdb
$ sqlplus
Enter Username: / as sysdba
SQL>
Close
the pluggable database mdbpdb3
SQL> alter
pluggable database mdbpdb3 close;
Pluggable database altered.
Unplug
the database by specifying XML file. This XML file will be used to plug this database into the target CDB
SQL> alter pluggable database mdbpdb3
unplug into '/app/oracle/mdbpdb3.xml';
Pluggable database altered.
Create
target directory
$mkdir /app/oracle/mdbpdb_new
Connect
to Target CDB ‘orcl’
$ export ORACLE_SID=orcl
$ sqlplus
Enter User: / as sysdba
Start
the target CDB
SQL> startup
SQL>CREATE
PLUGGABLE DATABASE mdbpdb_new USING
'/app/oracle/mdbpdb3.xml' MOVE
FILE_NAME_CONVERT= '/app/oracle/mdbcdb/mdbpdb3/','/app/oracle/mdbpdb_new/') STORAGE (MAXSIZE 2G MAX_SHARED_TEMP_SIZE 100M);
Pluggable database created.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
------ ------------------------------ ----------
----------
1 mdbpdb_new MOUNTED
Open
the pluggable database mdbpdb_new
SQL> alter pluggable database
mdbpdb_new open;
Pluggable database altered.
No comments:
Post a Comment