Clone or Unplug operations for PDBs
/database/pdbs/{pdb_name}/
Request
-
pdb_name:
Name of the Pluggable Database to clone from or unplug.
Response
200 Response
Examples
The following example shows how to clone a pluggable database or unplug a pluggable database 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/_/db-api/stable/database/pdbs/devpdb1/
Example of Request Body
Note:
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 version of ORDS Database API to use, the path for this operation and the PDB identifier
devpdb1
. The pdb_name path parameter in this example is devpdb1. The PDB Lifecycle Management service requires the credentials ofdb.cdb.adminUser
to be set in the pool configuration and in this example the default pool is configured for the container database.
The following is an example request body to create a new pluggable database by cloning the pluggable database specified by the pdb_name
parameter in the URL. In this example, fileNameConversions
parameter is also provided that results in a FILE_NAME_CONVERT
clause included in the CREATE PLUGGABLE DATABASE
statement executed in the container database.
{
"method": "CLONE",
"clonePDBName": "pdb_new",
"fileNameConversions": "('/disk1/oracle/dbs/devpdb1/','/disk1/oracle/dbs/pdb_new/')",
"unlimitedStorage": true,
"reuseTempFile": true,
"totalSize": "UNLIMITED",
"tempSize": "UNLIMITED"
}
The following is an example request body to unplug the database specified by the pdb_name
parameter in the URL. The pluggable database devpdb1
, is disassociated from the container database and so will not be usable. An XML file, sales_pdb.xml
in this example is generated with metadata about the pluggable database after it is unplugged. This metadata contains the required information to enable a CREATE PLUGGABLE DATABASE
statement on a target container database to plug in the pluggable database.
{
"method": "UNPLUG",
"xmlFileName": "/disk1/oracle/dbs/sales_pdb.xml"
}
Example of Response Header
The following example shows the response header:
HTTP/1.1 200 OK
Date: Thu, 05 Sep 2019 12:21:01 PDT
Content-Type: application/json
X-Frame-Options: SAMEORIGIN
Transfer-Encoding: chunked
Example of Response Body
The following example shows the response body with 200 returned in JSON format:
{
"env":{"defaultTimeZone":"PST8PDT"},
"items":[
{
"statementId":1,
"response":["\nPL\/SQL procedure successfully completed.\n\n"],
"result":0
}
]
}