Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to validate SQL*PLUS login in Unix shell script

user637544Jul 11 2014 — edited Jul 14 2014

I have written the following function in unix shell script to validate SQL*PLUS login and throw a user-defined message.

function check_db_conn

{

exit| sqlplus -s -L $User/$Password@$SID > /dev/null

if [[ $? -ne 0 ]]; then

  echo "Incorrect DB credentials"

fi

}

However, I want to modify this function so that in case user has entered correct login but there is some issue with TNS listener it should display appropriate message.

This post has been answered by RajenB on Jul 11 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 11 2014
Added on Jul 11 2014
5 comments
4,266 views