Steps to manage Autonomous Database from OCI Cloud Shell
By: Date: 21/05/2022 Categories: OracleCloud Tags:

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.

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:Copy code snippetCopied to ClipboardError: Could not CopyCopied to ClipboardError: Could not Copyoci 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:Copy code snippetCopied to ClipboardError: Could not CopyCopied to ClipboardError: Could not Copyexport 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:Copy code snippetCopied to ClipboardError: Could not CopyCopied to ClipboardError: Could not Copy$ sqlplus [email protected]_lowA screenshot of the resulting code prompts in Cloud Shell.

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