i want to connect to oracle database from user input and create a view.
Code:
${ECHO} "Debut Creating View"
${ECHO} "Please Enter the User Name:"
read user_name
${ECHO} "Please Enter the Connection String:"
read con_string
${ECHO} "Please Enter the Password:"
read pwd
${ORACLE_HOME}/bin/sqlplus -s ${user_name}/${pwd}@${con_string} CREATE_VIEW.sql
it is not working....
what's wrong ?
Kindly help
S
Last edited by pludi; 05-28-2010 at 04:52 AM..
Reason: code tags, please...
SQL*Plus: Release 10.2.0.4.0 - Production on Fri May 28 09:31:38 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
Enter user-name:
~
Moderator's Comments:
Please use code tags. ty
this error message i found in trace files
but when i run the same user name and passsword pop/pop@schema it works fine
ORA-12154: TNS:could not resolve the connect identifier specified
This error is a known error when tns could not resolve the target.
Code:
${ECHO} "Debut Creating View"
${ECHO} "Please Enter the User Name:"
read user_name
${ECHO} "Please Enter the Connection String:"
read con_string
${ECHO} "Please Enter the Password:"
read pwd
echo "${ORACLE_HOME}/bin/sqlplus -s ${user_name}/${pwd}@${con_string}"
${ORACLE_HOME}/bin/sqlplus -s ${user_name}/${pwd}@${con_string} CREATE_VIEW.sql
I have added a line to check the variables passed to sqlplus. Pls check if its taking the correct varibales.
Also as far as i remember i used bellow syntax to execute a sql script from ksh
Good evening
I nned your help pls, In an unix server i want to connect to a remote oracle databse server by sqlplus.
I tried to find out the user/passwd and service name by env variable and all Ive got is this:
ORACLE_SID_REPCOL=SCL_REPCOL
ORACLE_SID=xmeta
ORACLE_SID_TOL=SCL_PROTOLCOL... (2 Replies)
Hi guys, long time no typing :D
I have problems when I try to connect to Oracle database from SQL Developer which is located on my Windows box.
Server is running Solaris 11/11 and Oracle 11 enterprise. I can log in locally with sys account to database, start it up and shut it down but when I... (2 Replies)
Hi,
I want to write a shell script which connects to a Database, executes a set of SQLs and displays a message for every SQL that was run whether any records have been returned or not?
Can anyone help me in this regard?
Appreciate your help and concern.
Thanks,
Dave (1 Reply)
Hi all,
I am satyakiran , i am new to the forum. i never done shell scripts for connecting to the data base (oracle) and fetching the data from the database( thru sql select statements ) i want to know
1. how to connect to the data base(oracle) using shell script
2. how to retrieve data... (8 Replies)
Hello, I am very new to Scripting. I am having a Kornshell Script below for connecting to Oracle database. But getting an error while executing it.
#!/bin/ksh
ssh -X root@192.168.2.127 <perimuka>
sleep 5
su - oracle
sqlplus <mraghunandanan>/<peri123> <<eof
Can anyone tell what is wrong... (3 Replies)
if;
sql="select username from dba_users where username = '$FromUser';"
check_FromUser=`ExecSql "$sql"`
I want to connect to Oracle database & check the users in the database, store the value in check_FromUser.
First how to connect to Oracle database from the shell script ?
Appreciate your... (4 Replies)