Home » Infrastructure » Unix » SP2-0310: unable to open file
SP2-0310: unable to open file [message #435358] Tue, 15 December 2009 14:43 Go to next message
californiagirl
Messages: 79
Registered: May 2007
Member
I keep getting the sp2-0310 error message when running my shell script, which is calling a .sql file. Not sure what is going on I checked to make sure the directory was right and permissions. See shell script below:


#
EXT=rp_`date +%d%m%y`			# extension used for timestamping of files 
OS_user=`whoami`				# os username; used in directory references
LOG=/home/silitst/LIST/Logs
# Create the log file
LOG_FILE=$LOG/edi_`date +%m%d%y`.log; export LOG_FILE
#
#!/bin/sh
# must pass id passwd db
# set var for date
# Test for correct number of args
echo "checking args" >> $LOG_FILE
if test $# -ne 1
then						# verify user has entered correct
   echo "wrong number of args"		# number of parameters
   exit					#
fi						#
#
#
#ID=$1						# oracle user to run processes
#PASS=$2					# password
#DB=$3
T_CODE=$1					# application term code parameter
#
# run sql script
sqlplus siscvz@list/ban550chg @/home/silitst/LIST/testfile.sql $T_CODE




Error message:

SP2-0310: unable to open file "/home/silitst/LIST/testfile.sql"
new: showmode BOTH
14:15:51 SQL> prompt end of LOGIN.SQL
end of LOGIN.SQL






Permissions are set properly chmod 755


/home/silitst/LIST, [linv]>pwd
/home/silitst/LIST



-rwxr-xr-x  1 silitst ludevelopers 6265 Dec 15 13:17 testfile.sql
-rwxr-xr-x  1 silitst ludevelopers 1239 Dec 15 13:10 testfile_script.shl





Also the log file was created in the logs directory, so it's not clear as to why I am getting that error message???

Any advice? of something I am not looking at.
Re: SP2-0310: unable to open file [message #435361 is a reply to message #435358] Tue, 15 December 2009 17:14 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>sqlplus siscvz@list/ban550chg
What is above supposed to do?
I am used to seeing as below
sqlplus username/password@remote

which leads me to as why do you need to use SQL*Net to access DB?

On which host does the DB reside?
Re: SP2-0310: unable to open file [message #435384 is a reply to message #435358] Tue, 15 December 2009 23:45 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
"/home/silitst/LIST/testfile.sql" must be on the client side and the user executing sqlplus must have read access to it.

Regards
Michel

[Updated on: Wed, 16 December 2009 07:59]

Report message to a moderator

Re: SP2-0310: unable to open file [message #435479 is a reply to message #435361] Wed, 16 December 2009 07:31 Go to previous messageGo to next message
californiagirl
Messages: 79
Registered: May 2007
Member
siscvz@list/ban550chg this is how we login and this is the standard for running all our shell scripts.

siscvz is username and list is server and ban550chg is pw.

Re: SP2-0310: unable to open file [message #435497 is a reply to message #435479] Wed, 16 December 2009 08:03 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It does not matter for SQL*Plus the connection string is usr/psw@svc or usr@svc/psw but it does not work with exp/imp which require usr/psw@svc.

Regards
Michel

[Updated on: Wed, 16 December 2009 08:04]

Report message to a moderator

Re: SP2-0310: unable to open file [message #435510 is a reply to message #435497] Wed, 16 December 2009 08:36 Go to previous messageGo to next message
californiagirl
Messages: 79
Registered: May 2007
Member
Correction siscvz is the schema name.
Re: SP2-0310: unable to open file [message #435512 is a reply to message #435510] Wed, 16 December 2009 08:47 Go to previous message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
There is no difference between schema name and user name in Oracle (if you don't use some advanced features).

Regards
Michel
Previous Topic: Shell script calling sql*plus file
Next Topic: Command to search for a table name in Unix
Goto Forum:
  


Current Time: Thu Mar 28 04:52:36 CDT 2024