The Complete Guide To Getting Up And Running With Autonomous Database In The Cloud

July 2, 2019 | 4 minute read
Text Size 100%:

In our last post, we configured Kubernetes and Docker to get ready to deploy microservices. In this post, we'll look at another critical piece of the microservices puzzle - the place where our data will be stored. In this series we will focus on using Autonomous Database, specifically Autonomous Transaction Processing to persist and retrieve data to and from our microservices. That might lead you to believe that we're limiting ourselves to traditional 'table' based data, but as you'll see later on there are several options available for more non-traditional storage with ATP. Let's get started with our ATP instance creation. Like the last post, I'll show you how to do things with both the dashboard UI as well as the OCI CLI.

Creating An Autonomous Database Instance

We'll use an Autonomous Database for our microservices, so we'll need to create an Autonomous Transaction Processing (ATP) instance.

Creating An ATP Instance Via Dashboard

To create an ATP instance, select 'Autonomous Transaction Processing' from the sidebar menu:

Click on 'Create Autonomous Database', then populate the compartment, display name and database name. Make sure that 'Transaction Processing' is selected.

Make sure that 'serverless' is selected (note, this really just means "managed" as opposed to dedicated and has nothing to do with traditional "serverless") and enter the desired CPU and Storage (the defaults are good for now). If you want the CPU to auto scale then choose 'auto scaling'.

Finally, enter an administrator password and make a license choice and click on 'Create Autonomous Database':

When the database instance has been created, go to the instance details page and click on 'DB Connection':

In the DB connection dialog, click on 'Download' to download your ATP wallet. This contains the necessary client credentials to connect to the instance from our running application later on. Store it in a safe place.

Creating An ATP Instance Via The CLI

To create an ATP instance via the CLI, run:

Which returns a result like so:

After a few minutes, check the status of the install with the following command. Pass the ID that was returned from the create statement as the --autonomous-database-id attribute:

In the JSON returned from the get statement, check for the key lifecycle-state and make sure its value is "AVAILABLE" before moving on. Once the ATP instance is available, download the wallet with:

Bonus: SQL Developer Web

To quickly run queries on your new ATP instance you can use the SQL Developer Web tool. To access, click on the instance details and click 'Service Console':

On the Service Console page, select 'Administration' in the left sidebar and scroll down and click 'SQL Developer Web':

Enter the admin username and the password that you supplied for the admin user when the instance was created and click 'Sign In':

After logging in, you can select a schema to work within (#1), choose an object to inspect (#2), enter a query to run (#3) and view results (#4) among other things. 

This is a very nice way to run quick queries that we'll take advantage of throughout this blog series.

Todd Sharp

Todd Sharp is a developer advocate for Oracle focusing on Oracle Cloud. He has worked with dynamic JVM languages and various JavaScript frameworks for more than 14 years, originally with ColdFusion and more recently with Java/Groovy/Grails on the server side. He lives in the Appalachian mountains of north Georgia (in the United States) with his wife and two children.


Previous Post

The Complete Guide To Getting Up And Running With Docker And Kubernetes On The Oracle Cloud

Todd Sharp | 9 min read

Next Post


Building And Deploying A Helidon Microservice With Hibernate Part 1

Todd Sharp | 5 min read
Oracle Chatbot
Disconnected