Lesson 3 of 4 · OCI Database Administration

Autonomous Database

Oracle's self-driving database: deployment options and workload types, what changes for the DBA, scaling with ECPUs, backups, Autonomous Data Guard, and connecting.

Beginner 8 sections 6 min read

What Autonomous Database is

Oracle Autonomous Database is a fully managed Oracle database that runs on Exadata and looks after itself: it provisions, patches, tunes, scales, secures, and backs itself up. The DBA's job shifts from running the database to designing, governing, and getting the most out of it.

Oracle describes it with three words:

ORACLE AUTOMATES Self-drivingSelf-securingSelf-repairing provisioning, patching, tuning, and scalingencryption, security patches, and hardeningbackups, failover, and recovery YOU STILL OWN Schema and data designUsers and privilegesSQL and application tuningSizing and costData protection choicesConnections and network

Behind the scenes, it uses the same Oracle technology a DBA would set up by hand, such as RAC, Data Guard, and Exadata, plus machine learning for tasks such as creating indexes.

Deployment options and workload types

There are two ways to deploy it:

Autonomous Database Serverless
Oracle runs everything on shared Exadata infrastructure. You create a database in minutes, and pay only for the CPU and storage it uses. It's the most common choice, and where most people start.
Autonomous Database on Dedicated Exadata Infrastructure
The same automation on an Exadata reserved for your company, in OCI or on Exadata Cloud@Customer in your own data center. It gives more isolation and more control, such as when updates are applied, for large estates and strict regulations.

When you create one, you pick a workload type, which tunes the database for its job:

Workload typeTuned for
Transaction Processing (ATP)OLTP applications with many short transactions, plus mixed workloads
Data Warehouse (ADW)Analytics and reporting on large data sets, including data in Object Storage, as a lakehouse
JSON DatabaseDocument-style applications that store JSON, with a MongoDB-compatible API
APEXLow-code applications built with Oracle APEX

What's different for the DBA

An Autonomous Database is still Oracle Database, so SQL, PL/SQL, and most features work as usual. But some things are deliberately locked down, because Oracle is responsible for them:

  • No SYSDBA and no operating system access. You sign in as the ADMIN user, which has broad privileges for creating users, granting roles, and managing the database's contents.
  • No physical storage management. Data goes in the DATA tablespace, which grows automatically; you don't create tablespaces or manage files.
  • Most initialization parameters are set by Oracle. Only a small list, such as some optimizer and NLS settings, can be changed.
  • Patching is automatic, in a regular maintenance window, with no downtime for most patches.
  • Statistics and indexes are automated. Optimizer statistics are gathered automatically, and automatic indexing can create, test, and drop indexes based on the real workload.

Instead of setting up Resource Manager yourself, you connect through a predefined database service, which decides the session's priority and parallelism:

ServiceUse for
tpurgentThe most important transactions, with the highest priority (Transaction Processing only)
tpTypical application transactions (Transaction Processing only)
highLarge reports and batch jobs, with parallel queries and high priority, but few at once
mediumReports with some parallelism, and more at once
lowBackground work, with the lowest priority and no parallelism

For example, turning on automatic indexing and seeing what it has done:

EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_MODE', 'IMPLEMENT');

SELECT DBMS_AUTO_INDEX.REPORT_ACTIVITY() FROM dual;

Scaling and cost

ECPUs
Autonomous Database is sized in ECPUs, OCI's unit of processing power, from a minimum of 2, plus storage. Both can be changed at any time, online, without downtime.
Compute auto scaling
When switched on, the database can use up to three times its base ECPUs when busy, and you pay only for what it actually uses, per second.
Storage auto scaling
Lets storage grow beyond the size you set when it fills up, instead of the database running out of space.
Stop and start
A stopped Autonomous Database isn't charged for compute, only for storage. Development databases can be stopped on a schedule.

Backups and disaster recovery

Automatic backups
Taken and kept for you, with point-in-time restore. Retention is 60 days by default, and can be set lower to save money. Long-term backups can be kept for up to 10 years for compliance.
Autonomous Data Guard
Adds a standby database, either local, in another availability domain or fault domain, or in another region. Oracle manages the Data Guard configuration; you choose where the standbys go, and can switch over or fail over from the console. Automatic failover to a local standby can be switched on.
Backup-based disaster recovery
A cheaper option that restores from backups copied to another region. Recovery takes longer and loses more recent data than Autonomous Data Guard, so it suits less critical databases.
Clones and refreshable clones
A full copy of a database, made in minutes, for testing. A refreshable clone can be updated from its source on demand, which is handy for reporting copies.

Creating and connecting

With the OCI CLI, creating an Autonomous Transaction Processing database with auto scaling looks like this:

$ oci db autonomous-database create --compartment-id ocid1.compartment.oc1..aaaa \
    --db-name SALESATP --display-name salesatp --db-workload OLTP \
    --compute-model ECPU --compute-count 2 --data-storage-size-in-tbs 1 \
    --is-auto-scaling-enabled true --admin-password "<strong-password>"

Connections are always encrypted. By default they use mutual TLS (mTLS) with a wallet: a small zip file, downloaded from the console, that holds the certificates and connection details. Many setups now use a private endpoint, which places the database inside your VCN, often with plain TLS and no wallet needed:

# unzip the wallet, point Oracle Net at it, then connect through a service
$ unzip Wallet_SALESATP.zip -d ~/wallets/salesatp
$ export TNS_ADMIN=~/wallets/salesatp
$ sqlplus admin@salesatp_tp

You can also work in the browser with Database Actions, which includes a SQL worksheet, data loading, and monitoring, or with SQL Developer and other familiar tools.

In practice: a vendor script meets Autonomous Database

Kofi installs a vendor's application on Autonomous Database. Its install script was written for a normal Oracle database, and it fails three times:

  • CREATE TABLESPACE is rejected: Autonomous Database manages storage itself. Kofi removes the tablespace clauses, and the tables go to the DATA tablespace.
  • CONNECT / AS SYSDBA isn't possible. Kofi runs the script as ADMIN, which has the privileges it actually needs.
  • An ALTER SYSTEM setting the vendor recommends can't be changed, because Oracle manages it.

The lesson: before choosing Autonomous Database for a packaged application, check that the vendor supports it. Habits built on full control, such as SYSDBA and tablespace design, are exactly the ones Autonomous Database takes away, by design.

Key takeaways

  • Autonomous Database is self-driving, self-securing, and self-repairing Oracle on Exadata, deployed serverless or on dedicated Exadata infrastructure.
  • Pick a workload type, such as Transaction Processing or Data Warehouse, to tune it for its job.
  • There's no SYSDBA or OS access: you work as ADMIN, Oracle handles storage, most parameters, patching, statistics, and optionally indexes.
  • Connect through predefined services, such as tp, high, and low, which set priority and parallelism.
  • Size in ECPUs, with compute auto scaling up to three times the base, and stop idle databases to save compute.
  • Backups are automatic, and Autonomous Data Guard adds local or cross-region standbys.