Create a new database in the default Oracle Home
/environment/databases/
Request
There are no request parameters for this operation.
- application/json
object
-
container_configuration: object
container_configuration
This object specifies that a Container Database is to be created with the PDB settings provided.
-
global_database_name: string
Global Database Name.
-
response_file: string
The name of the response file for DBCA to use.
-
sys_user_password: string
The password for the sys user in the new database.
-
system_user_password: string
The password for the system user in the new database.
-
template_name: string
The name of the template file for DBCA to use.
-
total_memory: integer
Total amount of physical memory, in megabytes, that can be used by the new database.
object
object
-
number_of_pdbs(required): integer
The number of Pluggable Databases to create.
-
pdb_administrator_password(required): string
The password for the PDBADMIN user created in each Pluggable Database.
-
pdb_name(required): string
The name prefix to use for each Pluggable Database created.
Response
202 Response
-
Location(required):
Location header will provide URI of DBCA job so that processing of the request can be tracked.
Examples
The following example shows how to create a new database in the default Oracle Home 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/environment/databases/
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, and the path for this operation.
The following is an example request body to create a container database with two pluggable databases in the default Oracle Home. The General_Purpose.dbc
template file from the Oracle Home dbca templates directory is used. container_configuration
property is provided in the request to indicate that a container database is to be created. The container database name devcdb1
and the pluggable database names are pdbtest1 and pdbtest2 in this scenario. The response to this request will be the location of the DBCA job that has been created to process the request.
{
"global_database_name": "devcdb1",
"template_name": "General_Purpose.dbc",
"sys_user_password": "W3lc0m31",
"system_user_password": "W3lc0m31",
"container_configuration": {
"number_of_pdbs": 2,
"pdb_name": "pdbtest",
"pdb_administrator_password": "W3lc0m31"
}
}
Example of Response Header
The following example shows the response header. The Location
header returns the URI that can be used to view the DBCA job status:
HTTP/1.1 202 Accepted
Date: Fri, 06 Sep 2019 18:17:26 GMT
X-Frame-Options: SAMEORIGIN
Location: https://rest_server_url/ords/_/db-api/stable/environment/dbca/jobs/Cuq5Mm190gZgvXlwJITEIw/
Transfer-Encoding: chunked
Example of Response Body
When a create database request is valid and accepted, the response body is empty. The response header contains the necessary information for the DBCA job.