Autonomous Database
OCI Autonomous Database (Serverless) on the Database service, API version 20160918 (SDK package
database, client DatabaseClient, CLI oci db autonomous-database). Real OCI serves the API on
database.{region}.{domain}; floci-oci serves it on port 4599 under the /20160918 root it shares
with Identity and Networking.
Two modes:
- Real (the default). Each Autonomous Database runs in its own
Autonomous Database Free container
(
container-registry.oracle.com/database/adb-free:26.11.3.1-26ai). Clients connect over mTLS with the walletGenerateAutonomousDatabaseWalletreturns, as they would to OCI. - Mock (
FLOCI_OCI_SERVICES_DATABASE_MOCK=true). No container starts: a database is a record that becomesAVAILABLEat once, with connection strings and a wallet that nothing listens behind. Use it for management-plane tests, or wherever the requirements below cannot be met.
Real mode requirements
A large image and about 4 GB of memory per database
- Image: about 12 GB, linux/amd64. The first create pulls it, which can take several
minutes; the default 5 minute pull limit is often too short. Raise
FLOCI_OCI_DOCKER_IMAGE_PULL_TIMEOUT_SECONDS(for example to1800), or pull the image beforehand withdocker pull container-registry.oracle.com/database/adb-free:26.11.3.1-26ai. - Memory: each database peaks at about 4 GB. Oracle recommends 4 CPUs and 8 GB for the container.
- Start time: about 3 minutes from a first start to
AVAILABLE, about 20 seconds after a stop and start (measured on a 6 vCPU amd64 host). - Docker: the container needs
--cap-add SYS_ADMINand--device /dev/fuse, which floci-oci adds; it does not run privileged. The Docker host must have/dev/fuse. The container needs a network interface but no internet access: the database ships in the image.
floci-oci publishes only the container's mTLS listener (container port 1522) on a host port from
FLOCI_OCI_SERVICES_DATABASE_BASE_PORT to FLOCI_OCI_SERVICES_DATABASE_MAX_PORT (11522 to 11621).
Supported operations
| Area | Operations |
|---|---|
| Databases | CreateAutonomousDatabase, GetAutonomousDatabase, ListAutonomousDatabases, UpdateAutonomousDatabase, DeleteAutonomousDatabase |
| Runtime | StartAutonomousDatabase, StopAutonomousDatabase, RestartAutonomousDatabase |
| Wallet | GenerateAutonomousDatabaseWallet |
| Work requests | GetWorkRequest on the core work-request client (/20160918/workRequests/{id}) |
Behaviour
- Create takes
sourceNONE(or nosource). Clones, backups, refreshable clones and Data Guard sources answer400 InvalidParameter.compartmentIdmust be an active compartment, andsubnetIdandnsgIds, when sent, must exist in Networking.adminPasswordis required unlesssecretIdis sent; it must be 12 to 30 characters with an upper-case letter, a lower-case letter and a number, and no double quote or the wordadmin(Oracle's documented ADMIN rule). It is never stored and never returned. In real mode it reaches only the container's environment, andsecretIdwithoutadminPasswordanswers501 MethodNotImplemented, since floci-oci does not read the password from Vault yet. - dbName must start with a letter and hold only letters and digits, at most 30, and must be
unique in the tenancy (the CLI documents both rules). Names compare case-insensitively, and a
terminated database frees its name (inferred). A clash answers
400 InvalidParameter. - Echoed fields. Every create and update field that the AutonomousDatabase model also has comes
back exactly as sent:
dbVersion,characterSet,ncharacterSet,computeModel,computeCount,whitelistedIps, tags and the rest, so Terraform plans no diff. Sizes stay consistent:dataStorageSizeInGBssetsdataStorageSizeInTBs(rounded up) and the reverse.systemTagsis always present, empty, for the same reason: Terraform reads a missing one as a value still to be computed and plans an update. - Defaults for what a request leaves out are inferred from Oracle's Serverless documentation,
not pinned by the SDK:
dbNameDB<yyyyMMddHHmmss>,displayNamethedbName,characterSetAL32UTF8,ncharacterSetAL16UTF16,computeModelECPUwithcomputeCount2,dataStorageSizeInTBs1,dbWorkloadOLTP,dbVersion19c,licenseModelLICENSE_INCLUDED,isMtlsConnectionRequiredtrue,backupRetentionPeriodInDays60. - Lifecycle in mock mode. A database is
AVAILABLEon create.StopAutonomousDatabaseneeds itAVAILABLEand leaves itSTOPPED;StartAutonomousDatabaseneeds itSTOPPED;RestartAutonomousDatabaseneeds itAVAILABLE. Any other state answers409 Conflict(inferred): nothing changes a mock database's state on its own, so the condition never clears and the SDKs should not retry it, as they wouldIncorrectState. -
Lifecycle in real mode. Every mutation answers at once with the transient state and an
IN_PROGRESSwork request; the Docker work runs in the background, and the work request endsSUCCEEDEDorFAILED.Operation Answers Then Container Create PROVISIONINGAVAILABLEpulled, created and started Stop STOPPINGSTOPPEDdocker stopStart STARTINGAVAILABLEdocker startof the same containerRestart RESTARTINGAVAILABLEdocker restartDelete TERMINATINGTERMINATEDremoved A database is
AVAILABLEonce Docker reports the containerhealthy(the image's ownHEALTHCHECK: the instance runs and the listener serves every service). A request while an operation is under way answers409 IncorrectState, which SDKs retry; in a settled state that does not allow it,409 Conflict. - Failures in real mode (inferred). The Autonomous Database API has noFAILEDstate, so a failed operation leaves the databaseUNAVAILABLEwith the reason inlifecycleDetails, and fails its work request. That covers a container that exits, one that is not healthy withinFLOCI_OCI_SERVICES_DATABASE_READY_TIMEOUT_SECONDS(600), and a failed image pull. A first start that fails removes its container, since it holds no data;lifecycleDetailsthen carries the end of the container's log.StartAutonomousDatabasealso accepts anUNAVAILABLEdatabase, to try again. - A container is never recreated. The database lives in the container's own filesystem, and a new container would start an empty database with an admin password floci-oci never keeps. So stop and start keep the container and its data, and its host port stays reserved while it is stopped. When floci-oci stops, it stops every container (with in-memory storage, where the databases are forgotten, it removes them); when it starts again it takes each container over, found by name and itsio.floci.resource-idlabel, reserves the host port the container publishes (which replaces the stored one if they differ), and starts the ones whose database was running. An operation the restart interrupted carries on under its own work request. A database whose container is gone isUNAVAILABLEwith alifecycleDetailssaying so (inferred): delete it and create a new one.POST /_floci/state/resetremoves every container. - Update in real mode changes the management-plane fields only. A newdbNameoradminPasswordanswers501 MethodNotImplemented: the container was created with them. - Delete answers204withopc-work-request-idand keeps the database readable asTERMINATED, which Terraform and--wait-for-statepoll. Every other operation on a terminated database answers404 NotAuthorizedOrNotFound. In real mode a container that is already gone counts as removed; when Docker cannot remove it, the database isUNAVAILABLEwith the error inlifecycleDetails, its work requestFAILED, and it keeps its container and host port, so the delete can be sent again (inferred). - Work requests. Every mutation records a work request on the core work-request client with one resource ofentityTypeautonomousDatabase(actionCREATED,UPDATEDorDELETED); Terraform finds the new database's id there after a create. In mock mode it isSUCCEEDEDat once. Operation types (CREATE_AUTONOMOUS_DATABASEand so on) are inferred. - Connection strings follow the Autonomous Database Free container: the five mTLS aliases<db>_high,_medium,_low,_tpand_tpurgentover TCPS, service names<db>_<level>.adb.oraclecloud.com. In mock mode they namelocalhost:1522, change withdbName, and nothing listens on them. In real mode they are read from the container's owntnsnames.oraonce it is healthy, with each address rewritten to the published host port (localhost:<hostPort>when floci-oci runs on the host, the container's name and 1522 when it runs in a container, followingFLOCI_OCI_DOCKER_ENDPOINT_MODE). They keep the service names and the match on the server certificate's DN (CN=localhost), which is why any host name works. The container's_tlsaliases are left out: they address its 1521 listener, which is not published. The container is given the database'sdbNameasDATABASE_NAMEandWORKLOAD_TYPEADWfordbWorkloadDW,ATPotherwise. - Wallet.GenerateAutonomousDatabaseWalletreturns a zip (application/octet-stream, withetag,content-lengthandlast-modified).passwordmust be at least 8 characters with a letter and a number or special character. - In mock mode it holdstnsnames.ora,sqlnet.ora,ojdbc.propertiesand aREADME, and no keystore. - In real mode it is the container's owntls_walletdirectory, once the database has beenAVAILABLE(before that,409 IncorrectState).tnsnames.orais rewritten as the connection strings are.ewallet.p12,ewallet.pem,keystore.jksandtruststore.jksare re-encrypted from the container's own wallet password, which floci-oci generates per database and keeps only in the container's environment, to the request'spassword.ewallet.p12keeps every bag, including the Oracle secret bag a JDK keystore would drop.cwallet.sso, the auto-login wallet, needs no password and is passed through, so a JDBC URL such asjdbc:oracle:thin:@<db>_high?TNS_ADMIN=/path/to/walletconnects asADMINwith the admin password.generateTypemakes no difference. The container's lock and state files (*.lck,.runstate) are left out. - Connect withcwallet.ssopresent. Without it, the JDBC thin driver opensewallet.p12through the JDK's PKCS12 keystore, which cannot read the Oracle secret entry the Autonomous Database Free wallet carries and fails withORA-17957: Unable to initialize the key store. The container's ownewallet.p12fails the same way, so this is not a floci-oci re-encryption difference.
Wire notes
ListAutonomousDatabasesreturns a bare JSON array ofAutonomousDatabaseSummary, paged withopc-next-page, and requirescompartmentId. It filters onlifecycleState,lifecycleStateNotEqualTo,displayName,dbWorkload,dbVersion,isFreeTier,isDataGuardEnabled,infrastructureTypeandautonomousContainerDatabaseId, sorts byTIMECREATED(newest first) orDISPLAYNAME(ascending), and lists terminated databases.- Create, get, update, start, stop and restart return the AutonomousDatabase body with its
etag; the mutations also returnopc-work-request-id. Update, delete, start, stop and restart honourif-match(412 NoEtagMatch).
Clients
- OCI SDKs and CLI work end to end:
oci db autonomous-database create,get,list,update,start,stop,restart,generate-walletanddelete, with work requests read throughoci work-requests work-request get. - Terraform and OpenTofu apply, plan and destroy
oci_database_autonomous_databaseandoci_database_autonomous_database_walletwithoci_database.DatabaseClientinCLIENT_HOST_OVERRIDES, with one catch: after a create or update the provider waits on theopc-work-request-idthrough its coreWorkRequestClient, which it builds outsideCLIENT_HOST_OVERRIDES, so the wait always goes tohttps://iaas.<region>.oraclecloud.com. That host has to reach floci-oci over TLS the provider trusts: a hosts entry for it, a TLS endpoint on 443 that forwards to floci-oci, and the provider'scustom_cert_locationsetting (TF_VAR_custom_cert_location) pointed at that endpoint's certificate. floci-oci's own endpoint (FLOCI_OCI_TLS_ENABLED=true, which also binds 443) can serve it with a certificate for that host inFLOCI_OCI_TLS_CERT_PATHand its matching private key inFLOCI_OCI_TLS_KEY_PATH(floci-oci uses a supplied certificate only when both are set); the generated one does not name it. The compat suites answer the host inside their own container; seecompatibility-tests/README.md.
Not supported yet
Clones and backups, scaling, ListAutonomousDbVersions, regional wallets, private endpoints, Data
Guard, and ChangeAutonomousDatabaseCompartment. In real mode: walletless TLS
(isMtlsConnectionRequired false is echoed, but connections still need the wallet), the ORDS,
APEX and Database Actions URLs (the container's port 8443 is not published), the MongoDB API,
changing dbName or adminPassword, and an admin password from a Vault secretId.