oracle 12c使用dblink克隆pdb

kisslfcr發表於2017-01-22
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  NO NO  NO NO
SIEBEL                    SSE_ROLE                 NO  NO YES NO NO
SIEBEL                    TBLO_ROLE               NO  NO YES NO NO

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29135257/viewspace-2132796/,如需轉載,請註明出處,否則將追究法律責任。

相關文章