Wednesday, June 2, 2021

How to connect to an autonomous database

Connections can be established to autonomous database(OCI) using various tools. We will see how to establish connections using sql client and Sql developer 

Connecting to DB using Sqlplus:


Download sql clinet or sqlplus (.zip) files from oracle website and unzip into a folder Then go to autonomous database Home page in OCI and click on the database name to download the wallet files step 

1) Go to OCI homepage and select autonomous database
step 2) In autonomous database home click on dbname to download the wallet files
step 3) click on Db connection button
step 4) Select wallet type as instance wallet and hit download :
In the end it asks for a password before the download starts. Wallet_dbname.zip will be downloaded once the above steps are done. 


Let us consider sqlplus/oracle client is unzipped in /u01/app/oracle/product/19.8.0/db_1 and wallets are downloaded& unzipped into /u01/wallet/ folder We need to do couple of changes to sqlnet.ora file present in oracle client home

 goto --> /u01/app/oracle/product/19.8.0/db_1/network/admin open sqlnet.ora and edit the existing entries 

WALLET_LOCATION = (SOURCE = (METHOD = file) (METHOD_DATA = (DIRECTORY="?/network/admin"))) 
SSL_SERVER_DN_MATCH=yes 

to 


WALLET_LOCATION = (SOURCE = (METHOD = file) (METHOD_DATA = (DIRECTORY="/u01/wallet/"))) 
SSL_SERVER_DN_MATCH=yes 

We have changed the directory parameter to the location of DB wallets. 

export PATH=/u01/app/oracle/product/19.8.0/db_1:$PATH 
export TNS_ADMIN=/u01/app/oracle/product/19.8.0/db_1/network/admin 

sqlplus admin/password@myfirstdb_low --> you can find connection string in tnsnames.ora under wallet files

  

  Connecting to database using Sql developer:

Note : To connect to OCI we need the downloaded wallet zip file. Hence do not delete the zip file after unzipping the contents

Friday, May 28, 2021

Autonomous DB creation

Creating an Autonomous Transaction Processing Database in OCI his DB creation is carried out in free tier where the options are minimal step 1) Login in OCI console
step 2) In the home page choose Option oracle database from the left pane and select Autonomous Database from cascading menu
Step 3) Click on Create database from the autonomous database Page
Step 4) Provide the basic details under create Autonomous database page such as compartment, Display name ,Database name And choose a work load type : Transaction Processing or Data wareshouse Choose a deployemnt type : Shared infrastructure or dedicated infrastructure
step 5) Under configure database options choose the DB version and check the box if you are planning for a scale up
Step 6)Create Adinistration credentials username : Admin (Default) Password : Confirm Password : Choose Network Access Type : Secure access from everywhere or Private end point access only
Step 7) Choose a license type : Bring your own license or License Included
step 8) Under advanced options choose a tag and click on create autonomous database
We have succesfully created an autonomous transactional processing database. Once the creation is done home page of your database looks as below