Create an import data pump job

post

/database/datapump/import

Create a Data Pump import 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 role to invoke this service.

Request

Supported Media Types
Body ()
Root Schema : schema
Type: object
Show Source
Nested Schema : name_expressions
Type: array
Used to define Metadata Filter parameters for a Data Pump job.
Show Source
Nested Schema : remap_schemas
Type: array
Used to define Remap Schema parameters for an import job.
Show Source
Nested Schema : schema_expressions
Type: array
Used to define Metadata Filter parameters for a Data Pump job.
Show Source
Nested Schema : tablespace_expressions
Type: array
Used to define Metadata Filter parameters for a Data Pump job.
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
Back to Top

Response

Supported Media Types

201 Response

Description of the Data Pump import job that has been 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 Data Pump import job by submitting a POST request on the REST resource using cURL.

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/import

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 import objects from the USERS tablespace and remap SCOTT schema objects to HR schema. In this example, the default DATA_PUMP_DIR database directory is used and it is expected that there are dump files matching the EXPDAT%U-13_12_45.DMP file name pattern.

{
  "job_mode": "SCHEMA",
  "file_name": "EXPDAT%U-13_12_45.DMP",
  "tablespace_expressions": [
    {"expression": "= 'USERS'"}
  ],
  "remap_schemas": [
    {"source": "SCOTT","target": "HR"}
  ]
}

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_IMPORT_20190906154258/
ETag: "onyB9moowJVhrJQrJ80tk3VyP3HZ9QqXHvwsmKrvnhNk/mOZF9CRFKJXIXWkKAnLtmJHssYdJ83KBCJUgqBtbQ=="
Location: https://rest_server_url/ords/orcl/pdbadmin/_/db-api/stable/database/datapump/jobs/PDBADMIN,DATAPUMP_REST_IMPORT_20190906154258/
Transfer-Encoding: chunked

Example of Response Body

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


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