Create a data pump job

post

/database/datapump/jobs/

Create a Data Pump job with the specified parameters and start it. Refer to Oracle Data Pump documentation for a more detailed explanation of parameters. A client requires SQL Administrator or SQL Developer role to invoke this service.

Request

There are no request parameters for this operation.

Supported Media Types
Request Body - application/json ()
Root Schema : schema
Type: object
Show Source
  • Specify the name of the credential, owned by the database user, to be used to import from object storage or export to object storage.
  • Default Value: DATA_PUMP_DIR
    Specify the database directory to use.
  • The file name pattern to use for Data Pump import. Required when operation is IMPORT or when credential_name is specified. For EXPORT the file_name will default to a pattern with a timestamp in the name. When credential_name is specified the file_name must be a URI format for an Oracle Object Store location.
  • The filter to apply to identify database objects for export. This an export convenience for simple lists in metadata filter parameters, carried over from 19.1 implementation.
  • Default Value: SCHEMA
    Allowed Values: [ "FULL", "SCHEMA", "TABLE", "TABLESPACE" ]
    Specify the Data Pump job mode.
  • name_expressions
    Used to define Metadata Filter parameters for a Data Pump job. Applicable for both EXPORT and IMPORT.
  • Allowed Values: [ "EXPORT", "IMPORT" ]
    Specify the Data Pump job operation.
  • remap_schemas
    Used to define Remap Schema parameters for an import job. Only applicable for IMPORT.
  • schema_expressions
    Used to define Metadata Filter parameters for a Data Pump job. Applicable for both EXPORT and IMPORT.
  • tablespace_expressions
    Used to define Metadata Filter parameters for a Data Pump job. Applicable for both EXPORT and IMPORT.
  • The maximum number of worker processes that can be used for the job. Set this parameter to adjust the amount of resources used for a job.
Nested Schema : name_expressions
Type: array
Used to define Metadata Filter parameters for a Data Pump job. Applicable for both EXPORT and IMPORT.
Show Source
Nested Schema : remap_schemas
Type: array
Used to define Remap Schema parameters for an import job. Only applicable for IMPORT.
Show Source
Nested Schema : schema_expressions
Type: array
Used to define Metadata Filter parameters for a Data Pump job. Applicable for both EXPORT and IMPORT.
Show Source
Nested Schema : tablespace_expressions
Type: array
Used to define Metadata Filter parameters for a Data Pump job. Applicable for both EXPORT and IMPORT.
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : items
Type: object
Show Source
Examples

Back to Top

Response

Supported Media Types

201 Response

Details of the Data Pump job that has been successfully created.
Body ()
Root Schema : DataPumpJobsItem
Type: object
This object represents a specified Data Pump job in the database.
Show Source
Nested Schema : LinkRelation
Type: object
Show Source
Back to Top

Examples

The following example shows how to create a Data Pump job by submitting a POST request on the REST resource using cURL. Depending on the operation specified in the request body, the Data Pump job can be an import or an export job.

curl -i -X POST -u username:password 
-d @request_body.json 
-H "Content-Type:application/json" https://rest_server_url/ords/orcl/pdbadmin/_/db-api/stable/database/datapump/jobs/

Example of Request Body

Note:

The URL structure https://rest_server_url/resource-path, used in the preceding command has the following components:
  • rest_server_url is the REST server where Oracle Rest Data Server is running
  • The remainder of the URL includes the ORDS context root, the database identifier, the schema identifier, the version of ORDS Database API to use, and the path for this operation.

The following is an example of a request body for submitting a Data Pump request to export the HR schema.

{
  "operation": "EXPORT",
  "schema_expressions": [
    {
      "expression": "IN ( 'HR' )"
    }
  ]
}

The following is an example of a request body for submitting a Data Pump request to import the HR schema and map it to the BLAKE schema.

{
  "operation": "IMPORT",
  "job_mode": "FULL",
  "file_name": "EXPDAT%U2019-03-25-12_55_03.DMP",
  "remap_schemas": [
    {
      "source": "HR",
      "target": "BLAKE"
    }
  ]
}

Example of Response Header

The following example shows the response header. The Location header returns the URI that can be used to view the status of the job.

HTTP/1.1 201 Created
Content-Type: application/json
Content-Location: https://rest_server_url/ords/orcl/pdbadmin/_/db-api/stable/database/datapump/jobs/PDBADMIN,DATAPUMP_REST_EXPORT_20190906155736/
ETag: "vdgVbEWipm96TpCidc5nFeC3BHMZd7adx8m4liaYSTEb7IwPVRykFAld4YP4Yh/PBuJ2Kv3fywyTvJykxERaEw=="
Location: http://rest_server_url/ords/orcl/pdbadmin/_/db-api/stable/database/datapump/jobs/PDBADMIN,DATAPUMP_REST_EXPORT_20190906155736/
Transfer-Encoding: chunked

Example of Response Body

The following example shows the response body with 201 returned in JSON format:


{
    "job_name": "DATAPUMP_REST_EXPORT_20190906155736",
    "owner_name": "PDBADMIN",
    "operation": "EXPORT",
    "job_mode": "SCHEMA",
    "state": "EXECUTING",
    "degree": 1,
    "attached_sessions": 0,
    "datapump_sessions": 2,
    "job_state": "EXECUTING",
    "links": [
        {
            "rel": "collection",
            "href": "http://rest_server_url/ords/orcl/pdbadmin/_/db-api/stable/database/datapump/jobs/"
        },
        {
            "rel": "describedby",
            "href": "http://rest_server_url/ords/orcl/pdbadmin/_/db-api/stable/metadata-catalog/"
        },
        {
            "rel": "related",
            "href": "http://rest_server_url/ords/orcl/pdbadmin/_/db-api/stable/database/datapump/jobs/PDBADMIN,DATAPUMP_REST_EXPORT_20190906155736/EXPDAT-2019-09-06-15_57_36.LOG"
        },
        {
            "rel": "self",
            "href": "http://rest_server_url/ords/orcl/pdbadmin/_/db-api/stable/database/datapump/jobs/PDBADMIN,DATAPUMP_REST_EXPORT_20190906155736/"
        }
    ]
}
Back to Top