Export the Pluggable Database from the DBCS System

To export the PDB:
  1. ssh to one of the nodes in the DBCS 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.
    alter session set container = pdb_name_for_DBCS;

    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;
    For example:
    grant read, write on directory dbcs_pdb1_dump to system;
  6. Grant full right to a user to export the database and exit.
    grant exp_full_database to db_user;
    exit;
    For example:
    grant exp_full_database to system;
    exit;
  7. Run the export command from outside the sqlplus prompt as the oracle user. Provide the password for the database user when prompted.
    expdp db_user@pdb_name_for_DBCS directory=dump_file_alias dumpfile=dump_file_name logfile=log_file_name full=y
    For example:
    expdp system@PDB1 directory=dbcs_pdb1_dump dumpfile=dbcs_pdb1_dump.dmp logfile=dbcs_pdb1_dump.log full=y

    The dump process will take time. If the job completes successfully, the last line of the output will include the text successfully completed.

  8. Record the size of the dump file to ensure that the Oracle Cloud Infrastructure Database System will have enough space to accept the file.
    du -sh path_to_place_dump_file/dump_file_name
    For example:
    du -sh /home/oracle/dbcs_pdb1_dump.dmp
  9. Save the file size for use in the next step. See Step 2 of Move the Dump File to the Oracle Cloud Infrastructure Database System.