Lesson 4 of 4 · OCI Database Administration

Managing Databases on OCI

The OCI DBA's core responsibilities across every service: provisioning, performance tuning, high availability and disaster recovery, security and compliance, and monitoring and cost control.

Beginner 7 sections 8 min read

The OCI DBA's job

Whichever OCI database service you use, the DBA's five core responsibilities are the same as on Azure and AWS: designing the right setup, keeping it fast, making sure it survives failures, locking it down, and keeping an eye on what it costs. On OCI, you also get Oracle's own tools for Oracle Database, built by the people who make it.

This lesson covers those responsibilities across Autonomous Database, Base Database Service, Exadata, and MySQL HeatWave, and compares them with the Azure and AWS tools you've already seen.

Provisioning and architecture

Every new database starts with a set of design decisions, usually made with the application team:

  • Service: Autonomous, Base Database, Exadata, or a non-Oracle service, as covered in OCI Database Services.
  • Size and edition: ECPUs or OCPUs and storage, and for Base Database and Exadata, the edition and license model.
  • Where it lives: which compartment and region, with tags that follow the company's standards.
  • Network: a private subnet in a VCN, with network security groups that let in only the application.
  • Protection: backup destination and retention, and whether to add Data Guard or Autonomous Data Guard.

Most teams build databases with Terraform, either on their own machines or through OCI Resource Manager, OCI's managed Terraform service, so every environment is built the same way. Scaling an Autonomous Database is one command, with no downtime:

# give salesatp 4 base ECPUs
$ oci db autonomous-database update --autonomous-database-id ocid1.autonomousdatabase.oc1..cccc \
    --compute-count 4

Performance tuning and optimization

Oracle's own performance tools, such as AWR, ASH, ADDM, and SQL Tuning Advisor, all work on OCI's Oracle services, and they're included in Autonomous Database and in High Performance and Extreme Performance editions. OCI adds console tools on top:

ToolWhat it does
Performance HubA console view of one database's activity: ASH analytics by wait, SQL, and session, real-time SQL monitoring, and AWR and ADDM reports.
Database ManagementMonitors and manages a whole fleet of Oracle databases, in OCI or on-premises, with dashboards, alerts, and tuning advisors.
Ops InsightsLong-term trends and forecasts for capacity planning, and SQL performance across many databases.
MySQL HeatWave and PostgreSQLEach engine's own tools, such as MySQL's Performance Schema and slow query log, and PostgreSQL's pg_stat_statements, plus OCI metrics.

For example, finding what an Oracle database has been waiting on most in the last 30 minutes, from Active Session History:

SELECT NVL(event, 'ON CPU') AS activity, COUNT(*) AS samples
FROM   v$active_session_history
WHERE  sample_time > SYSDATE - 30/1440
GROUP  BY NVL(event, 'ON CPU')
ORDER  BY samples DESC
FETCH FIRST 5 ROWS ONLY;

On Autonomous Database, much of the routine tuning, such as statistics and indexing, is automatic. The DBA focuses on SQL and application design, choosing the right service for each connection, and right-sizing ECPUs.

High availability and disaster recovery

OCI's Oracle services use the same Maximum Availability Architecture (MAA) building blocks Oracle recommends on-premises: RAC, Data Guard, and RMAN backups. The DBA decides how much of it each database needs:

ServiceWithin a regionAcross regionsBackups
Autonomous DatabaseBuilt in on Exadata with RAC, plus a local Autonomous Data Guard standbyCross-region Autonomous Data Guard, or backup-based disaster recoveryAutomatic, 60 days by default, plus long-term backups for up to 10 years
Base Database ServiceData Guard standby in another availability domain or fault domain, or two-node RACData Guard standby in another regionAutonomous Recovery Service or Object Storage
Exadata Database ServiceRAC across database servers, plus a Data Guard standbyData Guard standby in another regionAutonomous Recovery Service or Object Storage
MySQL HeatWaveHigh availability with three instances in different availability domains or fault domainsReplication to a DB system in another regionAutomatic, with point-in-time recovery

The DBA's job is to match these options to each database's RPO and RTO, from the Backup, Recovery, and High Availability lesson, and to rehearse switchovers and restores regularly. With Data Guard, a planned switchover is a good way to test, and to patch with little downtime.

Security and compliance

Under the shared responsibility model, Oracle secures the cloud, and the DBA secures what's in it. On co-managed services, that includes the operating system. OCI database security works in layers:

NETWORKVCN, private subnets, network security groups IDENTITYIAM policies, IAM or Entra ID database sign-in DATATDE by default, keys in OCI Vault, masking Your data MONITORING Data Safe,OCI Audit,andCloud Guard
Network: VCNs and network security groups
Put DB systems in private subnets, and give Autonomous Databases a private endpoint in your VCN. Use network security groups to allow only the listener port, usually 1521 or 1522, from the application's servers. Reach on-premises networks through a VPN or FastConnect, OCI's private connection service.
Identity: IAM policies and database sign-in
IAM policies control who can manage databases, per compartment, in readable statements. Inside the database, users can sign in with their OCI IAM or Microsoft Entra ID identities instead of separate database passwords. On co-managed services, also control who has SSH keys to the servers.
Data: encryption
Every Oracle database in OCI is encrypted with Transparent Data Encryption (TDE), and it can't be switched off. Keys are managed by Oracle, or by your company in OCI Vault. Backups and connections are encrypted too. Oracle Database Vault can stop even privileged users, such as DBAs, from reading application data.
Monitoring: Data Safe, Audit, and Cloud Guard
Oracle Data Safe is a security center for Oracle databases: it assesses configuration and users for risks, finds sensitive data, masks it in test copies, collects audit records, and can enforce a SQL Firewall. OCI Audit records every action taken through OCI, and Cloud Guard flags risky settings, such as a database with a public endpoint.

For example, IAM policies that let Kofi's DBA team manage databases in production, while developers can only view them:

Allow group SalesDBAs to manage database-family in compartment sales-prod
Allow group SalesDBAs to manage autonomous-database-family in compartment sales-prod
Allow group SalesDevs to read database-family in compartment sales-prod

Monitoring and cost control

Everything in the Cloud Cost Optimization lesson applies on OCI, using these tools:

OCI Monitoring and Notifications
Collect metrics such as CPU, storage, and sessions for every database, with alarms that send emails, chat messages, or trigger automation when a threshold is crossed.
Cost Analysis and Budgets
Show what each compartment, service, and tagged resource costs, with budgets and alerts when spending heads over. Because budgets can be set per compartment, each team can see its own spending.
Cloud Advisor
Recommends savings, such as idle or oversized databases.

The biggest savings, and which services they apply to:

SavingApplies toHow it works
Bring your own licenseAutonomous, Base Database, ExadataUse Oracle licenses the company already owns, for a much lower hourly price. BYOL customers can also earn Oracle Support Rewards, credits against their Oracle support bill for what they spend on OCI.
The right editionBase Database, ExadataChoose the lowest edition that includes the features you actually use.
Auto scalingAutonomous DatabaseSet a modest base and let auto scaling handle peaks, paying only for what's used.
Scaling down and stoppingEvery Oracle serviceStop development databases outside working hours, and scale Exadata CPUs down when they aren't needed. Storage is still billed while stopped.
ExascaleExadata Database ServiceGet Exadata for small and medium databases without renting a whole system.
Backup retentionEvery serviceKeep backups only as long as the RPO and compliance require, rather than the default.
CommitmentsEvery serviceAn annual commitment to OCI spending gives a discount on the hourly prices.
Right-sizingEvery serviceUse Ops Insights and Monitoring history to scale down where capacity sits unused.

Key takeaways

  • The five core responsibilities are the same on OCI as on Azure and AWS; OCI adds Oracle's own tools for Oracle Database.
  • Build databases with Terraform or Resource Manager, in the right compartment and private subnet, with tags.
  • Use AWR, ASH, and ADDM through Performance Hub, Database Management, and Ops Insights. Tune before you scale up.
  • Build availability from Oracle's MAA blocks: RAC, Data Guard, Autonomous Data Guard, and automatic backups, matched to each database's RPO and RTO.
  • Secure in layers: private networks, compartment-based IAM policies, TDE that's always on, OCI Vault, and Oracle Data Safe.
  • Save with BYOL and Support Rewards, the right edition, auto scaling, stopping idle databases, and right-sizing.