Import the PDB from DBCS into the Oracle Cloud Infrastructure Database System

To import the PDB:
  1. ssh to one of the nodes in the Oracle Cloud Infrastructure Database System and list the contents.
  2. Become the oracle user and access sqlplus.
    sudo su - oracle
    sqlplus
    <At the prompt enter>:
    sys as sysdba
    <enter password when prompted>
  3. Switch to the PDB on the Oracle Cloud Infrastructure Database System.
    alter session set container = pdb_name_for_OCI_DB;

    For example:

    alter session set container = PDB1;
  4. Create an alias to the path where the dump file will be placed.
    create or replace directory dump_file_alias as 'path_to_place_dump_file';
    For example:
    create or replace directory dbcs_pdb1_dump as '/home/oracle';
  5. Grant the right to a user to write to this path alias.
    grant read, write on directory dump_file_alias to db_user;
    exit;
    For example:
    grant read, write on directory dbcs_pdb1_dump to system;
    exit;
  6. Run the import command from outside the sqlplus prompt as the oracle user. Provide the password for the database user when prompted.
    impdp db_user@tns_alias directory=dbcs_pdb1_dump dumpfile=dbcs_pdb1_dump.dmp logfile=log_file_name full=y
    For example:
    impdp system@PDB1 directory=dbcs_pdb1_dump dumpfile=dbcs_pdb1_dump.dmp logfile=dbcs_pdb1_dump.log full=y

    The command should complete with few errors because certain object types such as tablespace temp and tablespace users already exist. This is an expected behavior.

  7. Search for ORA- in the log file to examine the errors.
    For example:
    cat /home/oracle/dbcs_pdb1_dump.log | grep ORA-

    Check that the errors end with already exists or are some other expected errors such as "USER:"SYS" failed due to insufficient privileges. The main errors to look for are with the JRF schemas. For example, an error that includes _OPSS in it.

  8. Before exiting, construct the connect string that will be used by examining the tnsnames.ora entries.
    cat /u01/app/oracle/product/db_version/db_home/network/admin/tnsnames.ora
    For example:
    cat /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/tnsnames.ora
  9. Locate the listener alias.
    For example:
    cat /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/tnsnames.ora
    PDB1 =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = my.dbhost.vcnfqdn)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = pdb1.sometext.vcnfqdn)
        )
      )
  10. Record the HOST:PORT/SERVICE_NAME as the connect string. You will need this when you are migrating your Oracle Java Cloud Service domain contents to Oracle WebLogic Server for Oracle Cloud Infrastructure.

    Using this example, the connect string will be:

    my.dbhost.vcnfqdn:1521/pdb1.sometext.vcnfqdn