by Joel Pérez and Skant Gupta
This article shows how to use the "full transportable" mode of the Data Pump feature of Oracle Database to copy an entire database from your on-premises host to an Oracle Database Cloud Service database deployment.
Note: You can use this method only if the source database release version is Oracle Database 11.2.0.3 or later and the database character sets of your on-premises database and the Oracle Database Cloud Service database are compatible.
To migrate an Oracle Database 11g on-premises database to an Oracle Database Cloud Service instance of Oracle Database 12c using the Data Pump full transportable method, you perform these tasks:
expdp
) to perform the full transportable export.impdp
) and import the data into the database.The following sections show an example of the entire process. In this example, the source database is on a Linux host.
Cloud-Mig
.Figure1. Creating a new service (Cloud-Mig)
MIGORCL
.25
.rsa-key-20170111.pub
.Figure 2. Specifying the service details
Figure 3. Creating the cloud database instance
After a few minutes, the cloud database instance has been created successfully.
Figure 4. The cloud database has been created
Figure 5. Main page of the cloud database
Figure 6. Selecting the Access Rules item
b. For the ora_p2_dblistener rule, select Enable from the Actions menu.Figure 7. Enabling the ora_p2_dblistener rule
Open two different instances of the PuTTY executable and connect to both the machines using an SSH public key.
Figure 8. Connecting to both machines using PuTTY
[oracle@cloud ~]$ mkdir -p /u01/app/dpump
[oracle@cloud ~]$ sqlplus SYSTEM SQL*Plus: Release 11.2.0.4.0 Production on Thu Jun 1 01:49:18 2017 Copyright (c) 1982, 2013, Oracle. All rights reserved. Enter password: Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> CREATE DIRECTORY prem_to_cloud AS '/u01/app/dpump'; Directory created.
SQL> SELECT tablespace_name, file_name FROM dba_data_files; TABLESPACE_NAME FILE_NAME ------------------------------ -------------------------------------------------- USERS /u01/app/oracle/oradata/ORA11G/users01.dbf UNDOTBS1 /u01/app/oracle/oradata/ORA11G/undotbs01.dbf SYSAUX /u01/app/oracle/oradata/ORA11G/sysaux01.dbf SYSTEM /u01/app/oracle/oradata/ORA11G/system01.dbf EXAMPLE /u01/app/oracle/oradata/ORA11G/example01.dbf
SQL> ALTER TABLESPACE example READ ONLY; Tablespace altered. SQL> ALTER TABLESPACE users READ ONLY; Tablespace altered.
FULL=y
and TRANSPORTABLE=always
. Because this is an Oracle Database 11g database and full transportable is an Oracle Database 12c feature, specify VERSION=12
. Provide the password for the SYSTEM user when prompted.[oracle@cloud ~]$ expdp system FULL=y TRANSPORTABLE=always VERSION=12 DUMPFILE=expdat.dmp DIRECTORY=prem_to_cloud Export: Release 11.2.0.4.0 - Production on Thu Jun 1 01:56:24 2017 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. Password: Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Starting "SYSTEM"."SYS_EXPORT_FULL_01": system/******** FULL=y TRANSPORTABLE=always VERSION=12 DUMPFILE=expdat.dmp DIRECTORY=prem_to_cloud
/u01
directory. Choose the appropriate location based on the size of the files that will be transferred.[oracle@Cloud-Mig ~]$ mkdir -p /u01/app/on_premise
scp
utility to copy files, make sure the SSH private key that provides access to the Oracle Database Cloud Service compute node is available on your source host.scp
utility to transfer the dump file and all datafiles of the transportable set to the Oracle Database Cloud Service compute node.[oracle@cloud ~]$ scp -i rsa-key-20170111.ssh /u01/app/dpump/expdat.dmp oracle@129.144.152.30:/u01/app/on_premise Enter passphrase for key 'rsa-key-20170111.ssh': expdat.dmp 100% 97MB 121.3KB/s 13:42 [oracle@cloud ~]$ scp -i rsa-key-20170111.ssh /u01/app/oracle/oradata/ORA11G/users01.dbf oracle@129.144.152.30:/u02/app/oracle/oradata/MIGORCL/pdb3 Enter passphrase for key 'rsa-key-20170111.ssh': users01.dbf 100% 5128KB 125.1KB/s 00:41 [oracle@cloud ~]$ scp -i rsa-key-20170111.ssh /u01/app/oracle/oradata/ORA11G/example01.dbf oracle@129.144.152.30:/u02/app/oracle/oradata/MIGORCL/pdb3 Enter passphrase for key 'rsa-key-20170111.ssh': example01.dbf 100% 141MB 183.7KB/s 16:00
SQL> ALTER TABLESPACE example READ WRITE; Tablespace altered. SQL> ALTER TABLESPACE users READ WRITE; Tablespace altered.
SQL> CREATE DIRECTORY on_cloud AS '/u01/app/on_premise'; Directory created.
[oracle@Cloud-Mig pdb3]$ impdp system@PDB3 FULL=y DIRECTORY=on_cloud \ > TRANSPORT_DATAFILES='/u02/app/oracle/oradata/MIGORCL/pdb3/example01.dbf', \ > '/u02/app/oracle/oradata/MIGORCL/pdb3/users01.dbf' Import: Release 12.1.0.2.0 - Production on Wed May 31 21:18:45 2017 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. Password: Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
expdat.dmp
dump file. With this step, the entire process has been completed.We hope this article will be useful and we invite you to continue reading our next publications focused on Oracle Cloud.
Joel Pérez is an expert DBA and Oracle ACE Director and an Oracle Certified Master in Oracle Maximum Availability Architecture, Oracle Database cloud administration, and Oracle Database 11g and12c. He has over 17 years of real-world experience with Oracle technology and specializes in the design and implementation of solutions for the cloud, high availability (HA), disaster recovery, upgrades, replication, and most areas related to Oracle Database. Currently, he works as chief technologist and architect for cloud technologies, Oracle Maximum Availability Architecture, and HA at Yunhe Enmo (Beijing) Technology Co., Ltd. in Beijing, China.
Skant Gupta is an Oracle Certified Cloud Professional in Oracle Database 12c, an Oracle Certified Expert in Oracle Real Application Clusters (Oracle RAC) in Oracle Database 11g, and an Oracle Certified Professional in Oracle Database 10g, 11g, and 12c. He works at Vodafone Technology in the UK and formerly worked as a senior DBA at Etisalat in Dubai. He has six years of experience with various Oracle technologies, focusing mainly on cloud, database, and high availability solutions, Oracle WebLogic Suite, and Oracle GoldenGate. He has presented at several Oracle user groups worldwide, most recently in the US, the United Arab Emirates, and India.