Multitenant : Hot Clone a Remote PDB or Non-CDB in Oracle Database 12c Release 2 (12.2)
Multitenant : Clone a Remote PDB or Non-CDB in Oracle Database 12c (12.1.0.2)
on remote source CDB:
SQL> alter session set container=CRMDB;
Session altered.
SQL> create user dblk identified by welcome123;
User created.
SQL> grant create session,create pluggable database to dblk;
Grant succeeded.
SQL> alter pluggable database CRMDB close;
Pluggable database altered.
SQL> alter pluggable database CRMDB open read only;
Pluggable database altered.
on local destination CDB:
REMTPDB=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.22.140)(PORT=1523))
(CONNECT_DATA=
(SERVICE_NAME=crmdb.test.com)
)
)
SQL> create database link clone_link connect to dblk identified by welcome123 using 'REMTPDB';
Database link created.
SQL> desc SIEBEL.user_tables@clone_link;
...
SQL> create pluggable database CRMIP from CRMDB@clone_link; ---- CRMDB is the name of destination PDB
Pluggable database created.
SQL> select name,open_mode from v$pdbs where name='CRMIP';
NAME OPEN_MODE
------------------------------ ----------
CRMIP MOUNTED
SQL> alter pluggable database CRMIP open;
Pluggable database altered.
SQL> select name,open_mode from v$pdbs where name='CRMIP';
NAME OPEN_MODE
------------------------------ ----------
CRMIP READ WRITE
check whether role and privs are cloned to PDB:
SQL> select * from user_role_privs where username='SIEBEL';
USERNAME GRANTED_ROLE ADM DEL DEF OS_ COM
--------------------------------------------------------------------------------
SIEBEL DBA NO NONO NONO
SIEBEL SSE_ROLE NO NOYES NONO
SIEBEL TBLO_ROLE NO NOYES NONO
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29135257/viewspace-2132796/,如需转载,请注明出处,否则将追究法律责任。