Simple steps to manage Autonomous Database from OCI Cloud Shell

Simple steps to manage Autonomous Database from OCI Cloud Shell

Simple steps to manage Autonomous Database from OCI Cloud Shell

Oracle Cloud Infrastructure (OCI) Cloud Shell is a web browser-based terminal available from the Oracle Cloud Console. OCI Cloud Shell provides access to a Linux shell with a preauthenticated OCI CLI and several useful development tools and utilities preinstalled. Cloud Shell is a feature available to all OCI users, accessible from the Console. Cloud Shell includes 5 GB of backing storage for your home directory. Any changes that you make in your home directory persist to a volume stored in the home region of your tenancy and encrypted at rest.

This blog gives an overview of Cloud Shell and how to use connect SQL*Plus in Cloud Shell to an Autonomous Database instance.

A graphic depicting Oracle Cloud Shell's logo and other connectable software logos.

Cloud Shell to SQL*Plus

  1. Click the Cloud Shell icon in the upper-right corner of the Oracle Cloud Console:

    A screenshot of the Autonomous Databases page in the Oracle Cloud Console with an arrow pointing to the Cloud Shell icon.

  2. Generate the wallet for the autonomous database to connect and run the following command:
    Copied to Clipboard
    Error: Could not Copy
    Copied to Clipboard
    Error: Could not Copy
    oci db autonomous-database generate-wallet --autonomous-database-id <autonomous database="" oci="" id="">  --file wallet.zip --password 'xxxxxxx'</autonomous>

    A screenshot of the previous screen with the Cloud Shell window overlaid.

  3.  Create a directory and unzip the wallet.

    A screenshot of the commands to unzip the wallet in Cloud Shell.

  4. Set TNS_ADMIN environment variable to the directory where the wallet unzipped the files:
    Copied to Clipboard
    Error: Could not Copy
    Copied to Clipboard
    Error: Could not Copy
    export TNS_ADMIN=/home/dan_yadav/wallet
    echo $TNS_ADMIN

  5. Edit the sqlnet.ora and set the path of the wallet to the directory that has credentials files:

    A screenshot of the wallet location code in Cloud Shell.

  6. Find the service name from tnsnames.ora and connect Autonomous Database using SQL*Plus. Then input the password defined when creating the autonomous database:
    Copied to Clipboard
    Error: Could not Copy
    Copied to Clipboard
    Error: Could not Copy
    $ sqlplus admin@testadw_low

    A screenshot of the resulting code prompts in Cloud Shell.

The connection is made successfully to Autonomous Database from Cloud Shell!

Conclusion

The best way to find out if OCI is right for your use cases is to try it. Sign up for our Oracle Cloud Free Tier, which includes over 20 cloud services free forever and US$300 in credit of extra services for a 30-day trial.

I hope that this blog helps you to connect Autonomous Database instance using Cloud Shell in Oracle Cloud Infrastructure. If you have any questions about Cloud Shell, post them in the comments. For more information, see the following resources:

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *