This article shows how to use the remote cloning method to copy a pluggable database (PDB) from your on-premises Oracle Database 12c database to a PDB in a database-as-a-service (DBaaS) container database (CDB) in an Oracle Database Cloud Service deployment.
Note: You can use this method only if the on-premises platform is little endian; the on-premises release is Oracle Database 188.8.131.52 or higher; and the on-premises database and Oracle Database Cloud Service database have compatible database character sets and national character sets.
To copy an Oracle Database 12c PDB to a PDB in an Oracle Database Cloud Service deployment using the remote cloning method, you perform these tasks:
- On the on-premises database host, prepare the on-premises PDB by invoking SQL*Plus, closing the on-premises PDB, and then reopening the PDB in read-only mode.
- Create a new instance of Oracle Database Cloud Service.
- Connect to the Oracle Database Cloud Service compute node, invoke SQL*Plus, and create a database link that enables a connection to the on-premises database.
- On the Oracle Database Cloud Service compute node, execute the CREATE PLUGGABLE DATABASE command to clone the on-premises PDB.
- On the Oracle Database Cloud Service compute node, open the new PDB by executing the ALTER PLUGGABLE DATABASE OPEN command.
- Optionally, on the on-premises database host, invoke SQL*Plus and set the on-premises PDB back to read-write mode.
The following sections provide a step-by-step demonstration of the tasks required to remotely clone an on-premises Oracle Database PDB into a new PDB in a DBaaS CDB.
In this example, the on-premises database is on a Linux host.
Prepare the On-Premises PDB
- On the on-premises database host, invoke SQL*Plus and log in to the on-premises database as the SYS user.
[oracle@cloud ~]$ sqlplus / as sysdba SQL*Plus: Release 184.108.40.206.0 Production on Sun Jun 4 11:47:11 2017 Copyright (c) 1982, 2014, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 220.127.116.11.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options SQL>
- Close the on-premises PDB_PREM PDB.
SQL> ALTER PLUGGABLE DATABASE pdb_prem CLOSE; Pluggable database altered.
- Open the on-premises PDB_PREM PDB in read-only mode.
SQL> ALTER PLUGGABLE DATABASE pdb_prem OPEN READ ONLY; Pluggable database altered.
For further Reading : Migrate On-Premises Database to Oracle Cloud Database Using Remote Cloning