Oracle Cloud Infra (OCI) – Configuring & connecting SQL plus with Oracle Linux VM and Autonomous DB



Oracle Cloud Infra (OCI) – Configuring & connecting SQL plus with Oracle Linux VM and Autonomous DB

Oracle Cloud Infra (OCI) - Configuring & connecting SQL plus with Oracle Linux VM and  Autonomous DB

Oracle Cloud Infrastructure (OCI) – Configuring & connecting SQL plus client & tool with Oracle Linux VM and Oracle Autonomous Database
********************************
Note : Refer to other presenstations as how to create a Linux Virtual machine and Autonoumous DB in Oracle Cloud if you are not aware

**********Provisioning a linux VM on always free – Oracle Cloud Infrastructure******************

https://www.youtube.com/watch?v=evE_3WZ_T48

*****Provisioning Oracle Autonomous DB on always free tier – Oracle cloud Infrastructure *******

https://www.youtube.com/watch?v=vNDJYE8K0ts
*************************

Notes: as in the presentation
_____________________________

1. Make directory mkdir oracle
**********************************
$ mkdir oracle
$ cd oracle
$ pwd

/hom/opc/oracle

2. Download 3 files.
*********************

$ wget -P /home/opc/oracle/ http://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient18.5-basic-18.5.0.0.0-3.x86_64.rpm

$ wget -P /home/opc/oracle/ http://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient18.5-tools-18.5.0.0.0-3.x86_64.rpm

$ wget -P /home/opc/oracle/ http://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient18.5-sqlplus-18.5.0.0.0-3.x86_64.rpm

3. Install all three using rpm command
**************************************

$ sudo rpm -ivh oracle-instantclient18.5-basic-18.5.0.0.0-3.x86_64.rpm

$ sudo rpm -ivh oracle-instantclient18.5-tools-18.5.0.0.0-3.x86_64.rpm

$ sudo rpm -ivh oracle-instantclient18.5-sqlplus-18.5.0.0.0-3.x86_64.rpm

4. Export the path entry.
********************************
nano /etc/profile.d/oracle.sh

ORACLE_HOME=/usr/lib/oracle/18.5/client64
PATH=$ORACLE_HOME/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
TNS_ADMIN=$ORACLE_HOME/lib/network/admin
export ORACLE_HOME
export LD_LIBRARY_PATH
export TNS_ADMIN
export PATH

**** RUN AT ROOT (SUDO BASH) **************************************
5. Download wallet file for the DB and move it to
**************************************************
/usr/lib/oracle/18.5/client64/lib/network/admin

cp Wallet_*DB*.zip /usr/lib/oracle/18.5/client64/lib/network/admin
cp Wallet_Workshop1.zip /usr/lib/oracle/18.5/client64/lib/network/admin

$ unzip *wallet.zip* file

Check the connection string name from tnsnames.ora file

Note : Connection string would be DBNAME_high which we could use

6. correct the entry in sqlnet.ora file provide the full directory path
/usr/lib/oracle/18.5/client64/lib/network/admin

**** EXIT the Root ( re-log into putty)***********************

7. Test the sqlplus client
********************************

echo $LD_LIBRARY_PATH
sqlplus64 -version

8.nano .bashrc
******************

alias sqlplus=’sqlplus64′
alias srf=’source /home/opc/.bashrc’

9. Try connecting as sqlclient and enter command sqlldr & expdp as whether commands are recognized.
***************************************************************************************************
a. sqlplus ADMIN/*DBpasswd*@*DBNAME_high*

b. sqlldr

c. expdp

10. After .ctl file, data file is put on the Linux folder and table is created
*********************************************************************************************
create table students(roll_no number(2), name varchar2(20));

sqlplus ADMIN/*DBpasswd*@DBNAME_high

sqlldr userid=ADMIN/*DBpasswd*@DBNAME_high control=control.ctl log=track.log