Oracle 12C--Clone a remote PDB

Source: Internet
Author: User

Connect to the remote CDB and prepare the remote PDB for cloning.

Select  from V$pdbs;    con_id       DBID NAME                           open_mode------------------------------------------------------------         2  1258043702  pdb$seed READ only 3 3749525766 PDB1                                    READ         only42192587015  P4                             mounted          5   255759235 pdb_test                       READ WRITE

Create a user in the remote database for use with the database link. In this case, we'll use a local user in the remote PDB.

set container=P4; SQL> alter pluggable database P4 open; SQL> Create user Remote_clone_user identified by Remote_clone_user; SQL> Grant Create session,create pluggable database to Remote_clone_user;

Open the remote PDB in read-only mode.

sql> Alter pluggable database P4 close; SQL> Alter pluggable database P4 open read only;

Connect to the local database to initiate the clone.

Select  from V$pdbs;    con_id       DBID NAME                           open_mode------------------------------------------------------------         2  3671494824 pdb$seed                       READ only

Create a database link in the local database, pointing to the remote database.

using ' P4 ';

Create a new PDB in the local database by cloning the remote PDB.

 from [Email protected]_link create_file_dest='/u12/app/oracle/oradata/p4';

The PDB is opened in Read-write mode to complete the process.

Sql>SelectCon_id,dbid,name,open_mode fromV$pdbs; con_id DBID NAME Open_mode---------- ---------- ------------------------------ ----------2 3671494824pdb$seed READ only3 2880590083P4 Mountedsql>Alter pluggable database P4 open; SQL>SelectCon_id,dbid,name,open_mode fromV$pdbs; con_id DBID NAME Open_mode---------- ---------- ------------------------------ ----------2 3671494824pdb$seed READ only3 2880590083P4 READ Writesql>

Oracle 12C--Clone a remote PDB

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.