Thursday, August 10, 2023

Create Oracle Autonomous Database using OCI CLI

The OCI CLI is a small-footprint tool that you can use on its own or with the Oracle Cloud Console to complete Oracle Cloud Infrastructure tasks. The OCI CLI provides the same core functionality as the Console, plus additional commands. Some of these, such as the ability to run scripts, extend Console functionality.

In this blog, we will use OCI CLI command line tool to create "Always Free" autonomous database. Then, we will use the tool to stop, start, and delete the autonomous database. 

Prerequisites:
An Oracle cloud fee trial or paid account.
- Installed and configured OCI CLI client. I have OCI client installed and configured on Linux virtual machine.

 

Create Always Free Autonomous Database 

To create new autonomous database, we use command "oci db autonomous-database create [options]". There are required and optional parameters to run the command. 

Use command "oci db autonomous-database create --help" to get command's reference.

-- is-free-tier parameter indicates if this is an Always Free resource. The default value is false. Note that Always Free Autonomous Databases have 1 CPU and 20GB of memory. For Always Free databases, memory and CPU cannot be scaled.

The main parameters to define:
--compartment-idThe OCID of the compartment of the Autonomous Database.
--db-nameThe database name. The name must begin with an alphabetic character and can contain a maximum of 14 alphanumeric characters. Special characters are not permitted. The database name must be unique in the tenancy. 
--display-nameThe user-friendly name for the Autonomous Database. The name does not have to be unique. 
--db-workloadThe Autonomous Database workload type. Accepted values are: OLTP, DW, APEX, AJD
--admin-password: Autonomous Database admin password. 









Once you execute the command, go to OCI console and navigate to "Oracle Database > Autonomous",  you can see new always free autonomous database in Processing state as shown below.  


Once create command finishes, state will be Available




Get the details of Autonomous Database

Use command "oci db autonomous-database get [options]" to get the details of the specified autonomous database.

















Stop an Autonomous Database

Use command "oci db autonomous-database stop [options]" to stop a specified autonomous database.


Start an Autonomous Database

Use command "oci db autonomous-database start [options]" to start a specified autonomous database.













Delete an Autonomous Database

Use command "oci db autonomous-database delete [options]" to delete a specified autonomous database.
















No comments:

Post a Comment

OCW 2024: What to Expect Around Oracle 23ai

  I’m so excited to share that I’ll be attending Oracle CloudWorld 2024 this year!. I’m thrilled as It will be my first OCW event to attend ...