Shell script to connect to Oracle from shell

I decided to add this forum to keep track of solutions for DB related problems.
I have worked with some brilliant people in my life and the solutions to issues that are usually beyond something you can get at Jack in Box Jackson. They deserve historical marker. This is the historical marked on my map.
Pouzivej data base
Post Reply
hudatolah
Site Admin
Posts: 152
Joined: Thu Apr 04, 2013 8:10 pm
Are You a Headhunter?: Affirmative
Surfer?: Yes

Shell script to connect to Oracle from shell

Post by hudatolah » Fri Nov 06, 2020 3:32 pm

Code: Select all

ORACLE_SID=ora111db ; export ORACLE_SID
ORACLE_HOME=/usr/oracle/11.1.0; export ORACLE_HOME
ORACLE_BIN="/usr/oracle/11.1.0/bin";export ORACLE_BIN
#TWO_TASK=ORCL;export TWO_TASK
PATH=$PATH:$ORACLE_HOME;export PATH
PATH=$PATH:$ORACLE_BIN;export PATH
oraname=ora111db
orapwd=AR#Admin#
orasid=ora111db
oradefaultuser=AERADMIN
oralogin="${oradefaultuser}@${oraname}/${orapwd}"
#oralogin="${oradefaultuser}/${orapwd}"
echo "Connecting as $oralogin"
sqlplus -S $oralogin
The Blackholesurfer. My surfboard has teeth.