Export the Database Objects

Follow these steps sequentially to export the database objects. Each includes rationale, commands, and verification.

Step 1: Create the Export Metadata Table

Create a temporary table to store module names (such as schemas or table groups) and their priorities.

  1. Connect to the source database.

    sqlplus <username>/<password>@<DB_SERVICE>
  2. Create the export metadata table.

    sql CREATE TABLE A1_MO_TO_EXPORT ( MO_NAME VARCHAR2(100), PRIORITY NUMBER );

Step 2: Load Priority Configuration

Populate the table with data from the system-specific CSV.

  1. Select the priority configuration file for the source application.

    Source Application Configuration File

    CCS or C2M

    priority_config_ccs.csv

    WACS or WAM

    priority_config_wacs.csv

    DACS or DAM

    priority_config_dacs.csv

  2. Import the configuration data into the A1_MO_TO_EXPORT table by using one of the following methods:

    • SQL Developer (GUI)

      1. Connect to the source database.

      2. From the database navigator, select the A1_MO_TO_EXPORT table.

      3. Import the selected CSV file.

      4. Map the CSV columns as follows:

        CSV Column Database Column

        Column 1

        MO_NAME

        Column 2

        PRIORITY

    • SQL*Loader

      1. Create a control file named load.ctl.

        LOAD DATA
        INFILE 'priority_config_ccs.csv'
        INTO TABLE A1_MO_TO_EXPORT
        FIELDS TERMINATED BY ','
        OPTIONALLY ENCLOSED BY '"'
        (
            MO_NAME CHAR(100),
            PRIORITY INTEGER
        )
      2. Run the SQL*Loader command.

        sqlldr <username>/<password>@<DB_SERVICE> control=load.ctl log=load.log

Step 3: Generate the Detailed Export Table List

Use the provided script to expand priorities into a detailed table list.

  1. Download the EXPORT_TABLE_LIST_GENERATION.sql script.

  2. Run the script in SQL*Plus.

    sql -- Paste script content here

    The script queries the A1_MO_TO_EXPORT table and populates the A1_TABLES_TO_EXPORT table.

Step 4: Execute Export for a Single Priority Group

Run the Data Pump export for one priority group (for example, Priority 100).

  1. Download EXADATA_PDB_EXPORT_SCRIPT.sql.

  2. Update the sample parameters for your schema, export directory, priority, parallel degree, and file name.

       l_schema_name        VARCHAR2(500) := 'CISADM';                                    -- Target schema
       l_dir_name           VARCHAR2(500) := 'DATA_PUMP_DIR';                           -- Export directory
       l_priority           NUMBER := 100;                                            -- Group priority
       l_parallel_degree    NUMBER := 16;                                             -- Parallel workers (adjust based on CPU)
       l_file_name           VARCHAR2(500) := 'A1_CCS1_DATA_DUMP_20250509';             -- Prefix with date
  3. Run the script in SQL*Plus.

Step 5: Monitor the Data Pump Job

Monitor the Data Pump job to verify that the export completes successfully by running the following SQL query:

SELECT *
FROM DBA_DATAPUMP_JOBS
WHERE JOB_NAME LIKE '%_EXPORT_SAAS_%'
ORDER BY STATE;

Review the STATE column to determine the job status. Possible values include:

  • DEFINING

  • EXECUTING

  • COMPLETING

  • COMPLETED

The export completes successfully when the job state is COMPLETED.

Step 6: Generate the Manifest File

Generate a manifest file after the export completes. The manifest file records metadata about the exported objects and supports downstream import processing.

  1. Download MANIFEST_FILE_GENERATION.sql.

  2. Update the script parameters. Example:

    Sample parameters

       l_schema_name        VARCHAR2(500) := 'CISADM';                                    -- Target schema 
       l_priority            NUMBER := 100;                                           -- Group priority 
    .....
       l_source_context       VARCHAR2(20) := 'CCS1';                                 -- Source for exporting
  3. Run the script.

The script generates a JSON manifest file for the selected priority group.

Example JSON output:

{
  "export": {
    "schema": "CISADM",
    "priority": 100,
    "tables": [
      {
        "name": "TABLE1",
        "rows": 10000,
        "size_mb": 50
      }
    ],
    "checksum": "SHA256:abc123..."
  }
}

Step 7: Upload Artifacts to Object Storage

Upload the exported files to object storage in the following order after the export and manifest generation processes complete.

  1. Upload the dump files. Example:

    Bash

    oci os object put \
      --bucket-name <bucket> \
      --file <local_dmp_path> \
      --name <remote_dmp_name>
  2. Upload the log files. Example:

    Bash

    oci os object put \
      --bucket-name <bucket> \
      --file <local_log_path> \
      --name <remote_log_name>
  3. Upload the manifest file. Example:

    Bash

    oci os object put \
      --bucket-name <bucket> \
      --file <local_json_path> \
      --name <remote_manifest.json>

Upload the manifest file last so that downstream processes access the manifest only after all associated export files are available.

Step 8: Repeat for Remaining Groups

Repeat steps 4 through 7 for each remaining priority group (for example, 100, 90, 80, and so on).

  1. Update the l_priority parameter in the export script.

  2. Use a unique value for the l_file_name parameter (for example, append priority).

  3. Run the export process, generate the manifest file, and upload the export files and manifest file to object storage.

Monitor object storage capacity throughout the export process.

Step 9: Remove Temporary Export Objects

Remove temporary objects after all exports have been uploaded successfully. This frees up space and maintains security.

  1. Remove the temporary export tables.

    DROP TABLE A1_MO_TO_EXPORT PURGE;
    
    DROP TABLE A1_TABLES_TO_EXPORT PURGE;

  2. Identify any remaining Data Pump jobs.

    SELECT JOB_NAME
    FROM DBA_DATAPUMP_JOBS
    WHERE JOB_NAME LIKE '%_EXPORT_SAAS_%';

    If completed Data Pump jobs remain, detach from the jobs and remove any associated job tables according to your organization's Data Pump cleanup procedures. Example:

    -- For each job returned by the query:
    
    DBMS_DATAPUMP.DETACH(job_name);
    
    DROP TABLE <job_table>;
  3. (Optional) Remove the temporary Data Pump directory if you created one for the export process.

    BEGIN
       DBMS_DATAPUMP.DROP_DIRECTORY('DATA_PUMP_DIR);
    END;
    /