Monday, July 20, 2026

Beyond the OCI Console: 25 OCI CLI Commands Every Oracle DBA Should Master

Introduction

Most Oracle DBAs spend their day inside the OCI Console.

But when managing multiple DB Systems, Autonomous Databases, backups, compartments, and monitoring tasks, repeatedly navigating the console becomes inefficient.

That's where the Oracle Cloud Infrastructure Command Line Interface (OCI CLI) becomes invaluable.

In this article, I'll share 25 OCI CLI commands that I frequently use as an Oracle DBA, along with practical scenarios where they save time.

This isn't another command reference—it's a field guide based on day-to-day database administration.

Why Every DBA Should Learn OCI CLI

Explain briefly:

  • Faster than Console
  • Script automation
  • Health checks
  • Disaster Recovery
  • Patch verification
  • Backup validation
  • Daily monitoring
  • Cron job integration
  • CI/CD friendly

Category 1 — Environment Verification

1. Verify OCI CLI Version

oci --version

Why?

Ensure you're using the latest CLI before automation.

2. Verify Current Region

oci iam region list

Useful while working with multiple regions.

3. Validate Configuration

oci setup config

Perfect after creating API keys.

4. Display Current User

oci iam user get

Useful for verifying identity.

Category 2 — Database Administration

5. List DB Systems

oci db system list

Quick inventory.

6. Database Details

oci db database get

Shows

  • Version
  • Lifecycle
  • Shape
  • Storage

7. List Backups

oci db backup list

Daily backup verification.

8. Start Database

oci db system start

Useful after maintenance.

9. Stop Database

oci db system stop

Cost optimization.

10. List DB Homes

oci db db-home list

Patch planning.

Category 3 — Autonomous Database

Commands for:

  • List ADBs
  • Start ADB
  • Stop ADB
  • Clone ADB
  • Restore Backup

Explain practical scenarios rather than just syntax.

Category 4 — Compute Administration

Examples:

  • List compute instances
  • Start instance
  • Stop instance
  • Reboot instance
  • Check VNIC

Category 5 — Storage

Examples:

  • List Block Volumes
  • List Boot Volumes
  • List Object Storage Buckets
  • Upload Backup Files
  • Download RMAN Backups

Category 6 — Monitoring

Commands covering:

  • List alarms
  • View metrics
  • Retrieve events
  • Inspect work requests
  • Check notifications

These are especially useful for automating health checks.

Bonus Tips

Use --query

Instead of displaying 200 lines of JSON:

oci db system list \
--query "data[].{Name:\"display-name\",State:\"lifecycle-state\"}"

Cleaner output.

Use Table Output

--output table

Makes terminal output easier to read.

Use jq

Filter JSON efficiently.

Use --all

Retrieve all paginated results.

Automate with Cron

Examples:

  • Daily backup report
  • DB inventory
  • Resource status
  • Storage utilization

Best Practices

  • Never hardcode API keys.
  • Use instance principals where possible.
  • Organize profiles for multiple tenancies.
  • Prefer --query over manual JSON parsing.
  • Test scripts in non-production before scheduling.

Conclusion

The OCI Console is excellent for occasional administration, but OCI CLI truly shines for repeatable operations, automation, and large-scale cloud management. Learning these commands can help Oracle DBAs reduce manual effort, build reliable scripts, and manage OCI environments more efficiently.

No comments:

Post a Comment

Beyond the OCI Console: 25 OCI CLI Commands Every Oracle DBA Should Master

Introduction Most Oracle DBAs spend their day inside the OCI Console. But when managing multiple DB Systems, Autonomous Databases, backups, ...