| name | oci-dbm-provision |
| description | Provisions a new Autonomous Database (ADB) with private endpoint and TLS-only access. Skipped automatically by oci-dbm-commission if the ADB already exists. Trigger when a user says "create an ADB for DBM", "provision a new autonomous database", or when oci-dbm-commission directs here for fresh provisioning. |
oci-dbm-provision
This skill is a worker in the oci-dbm-commission chain. It does NOT generate scripts. It uses the OCI Python SDK directly to provision a new Autonomous Database configured for private endpoint access and TLS-only connectivity.
This skill is skipped automatically by oci-dbm-commission when the target ADB already exists. If the ADB is found, this skill confirms its OCID and outputs it without creating anything.
Inputs
These values are passed by oci-dbm-commission (or supplied directly by the user):
| Input | Description | Default |
|---|
compartment_ocid | OCID of the compartment to create the ADB in | required |
db_name | Short alphanumeric database name (no spaces, max 14 chars) | required |
display_name | Human-readable display name for the ADB | required |
admin_password | Password for the ADMIN user — used directly at creation time | required |
subnet_ocid | OCID of the private subnet for the ADB private endpoint | required |
compute_count | Number of ECPUs | 2 |
storage_tbs | Storage in terabytes | 1 |
workload | Workload type: OLTP, DW, AJD, or APEX | OLTP |
What This Skill Executes
Step 1 — Check Whether ADB Already Exists
Call DatabaseClient.list_autonomous_databases(compartment_id=compartment_ocid, display_name=display_name) and filter for results with lifecycle_state not in ['TERMINATED', 'TERMINATING'].
- If a matching ADB is found: print its OCID and lifecycle state, confirm with the user, and skip creation. Output the existing
adb_ocid and proceed to Step 4 to collect connection details.
- If not found, proceed to Step 2.
Step 2 — Create the ADB
Call DatabaseClient.create_autonomous_database() with CreateAutonomousDatabaseDetails containing:
| Field | Value | Reason |
|---|
compartment_id | compartment_ocid | target compartment |
db_name | db_name | short name |
display_name | display_name | human label |
admin_password | admin_password | set at creation — NOT via vault |
subnet_id | subnet_ocid | places ADB in VCN via private endpoint |
compute_model | 'ECPU' | required — OCPU is deprecated |
compute_count | compute_count (min 2) | ECPU count |
data_storage_size_in_tbs | storage_tbs | storage allocation |
db_workload | workload | e.g. 'OLTP' |
is_mtls_connection_required | False | TLS-only; recommended with PE |
license_model | 'LICENSE_INCLUDED' | standard licensing |
Do NOT pass vault_id, secret_id, or any secret-related fields to CreateAutonomousDatabaseDetails — those fields are not used for the admin password and will cause errors.
Step 3 — Poll Until Available
Poll DatabaseClient.get_autonomous_database(adb_id=adb_ocid) every 2.5 minutes (150 seconds).
- Continue until
lifecycle_state == 'AVAILABLE'.
- Fail fast if
lifecycle_state is TERMINATED or FAILED — print the error and stop.
- Print status on each poll:
[HH:MM:SS] lifecycle_state = PROVISIONING ...
Step 4 — Print and Output Connection Details
Once the ADB is AVAILABLE (or was pre-existing), retrieve:
adb.id — the ADB OCID
adb.private_endpoint_ip — private IP within the VCN
adb.private_endpoint — private hostname
adb.connection_strings.medium — the full qualified service name for DBM enablement
Print all four values clearly.
The connection_strings.medium value has the format:
<prefix>_<dbname>_medium.adb.oraclecloud.com
Example: ep8c8t82piuc9mv_dbmdemo_medium.adb.oraclecloud.com
Output the following values for the next skill:
adb_ocid: <ocid>
full_service_name: <connection_strings.medium value>
compartment_ocid: <ocid>
provision_complete: true
Confirmation Before Finishing
Before handing off, verify:
Do not proceed if either check fails.
What This Skill Hands Back
Outputs passed to oci-dbm-commission (and subsequently to oci-dbm-enable):
adb_ocid — OCID of the available ADB
full_service_name — the full qualified service name from connection_strings.medium
compartment_ocid — unchanged, forwarded for downstream skills
provision_complete: true — signal that this step completed successfully
Gotchas
Gotcha 1 — Always use ECPU, never OCPU.
compute_model='OCPU' is deprecated for new ADB creation. Use compute_model='ECPU' with compute_count set to a minimum of 2. Passing OCPU may succeed today but will be rejected in future API versions without warning.
Gotcha 2 — Do NOT pass vault/secret fields for the admin password.
CreateAutonomousDatabaseDetails does have vault-related fields, but they are for a different feature (customer-managed encryption keys), not for the ADMIN password. Pass admin_password directly as a plain string. Mixing these up produces cryptic 400 or 412 errors.
Gotcha 3 — Save connection_strings.medium — you will need it in oci-dbm-enable.
The DBM enablement API requires the full qualified service name, not the short db_name. This value is only reliably obtained from adb.connection_strings.medium after the ADB is provisioned. If it is lost, you must call get_autonomous_database() again to retrieve it before running oci-dbm-enable.