Hi I am trying to connect my database using shell script and by passing the db credentials from shell. I am getting "ORA-12162: TNS:net service name is incorrectly specified". Please find the script below.
#!/bin/bash
DB_CREDENTIALS=$1
mkdir -p $PWD/logs
sqlplus -silent $DB_CREDENTIALS <<EOFSQL
set echo on
set timing on
set heading on
set feedback on
set linesize 5000
SET PAGESIZE 0
SET TRIMSPOOL ON
@teshscrpt.sql
EOFSQL
And the error is :
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
where <logon> ::= <username>[/<password>][@<connect_identifier>] | /
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
Can somebody help me out kindly.
Thanks, sudhir.