SQLoader & SQLplus error ?


 
Thread Tools Search this Thread
Operating Systems AIX SQLoader & SQLplus error ?
# 8  
Old 11-23-2017
I am neither a DBA or sys admin...... SmilieSmilie
# 9  
Old 11-23-2017
With it being TNS, can I presume you are trying to connect from your desktop to a central server that runs the databases? If so, your desktop needs to know where the target is. I assume that you are doing something like sqlplus username/password@database and your desktop needs to interpret the database part and know where to send the IP connection.

This reads a file that should have been installed or created on your desktop (or network drive) to point you to a host (and various other things) that it will then use to look up the IP address and try to open the connection to that on the port given. On the server, there needs to be a TNS listener on the port that responds to your desktop and connects you to the correct database instance. All this happens before the database tries to authenticate your credentials.

Can you show us (in CODE tags) the output from a tnsping database putting in the name you are trying to connect to.

Can you tell us what Operating System you are trying to connect from and if you are using GUI tools or the command line.




Thanks, in advance,
Robin
# 10  
Old 11-24-2017
I tried to tnsping the database and it return the following :

Code:
ksh: tnsping:  not found.

However, if I ping the database and it returns the following :

Code:
ping DATABASENAME
PING DATABASENAME: (10.xxx.xx.xxx): 56 data bytes
64 bytes from 10.xxx.xx.xxx: icmp_seq=0 ttl=254 time=0 ms
64 bytes from 10.xxx.xx.xxx: icmp_seq=1 ttl=254 time=0 ms
64 bytes from 10.xxx.xx.xxx: icmp_seq=2 ttl=254 time=0 ms
64 bytes from 10.xxx.xx.xxx: icmp_seq=3 ttl=254 time=0 ms

---------- Post updated at 10:27 AM ---------- Previous update was at 10:20 AM ----------

Anyone knows if running sqlplus or sqlldr inside a ksh script,
should I enter the full path of where sqlplus and sqlldr are located like the below inside the script :

Code:
/u01/app/oracle/product/11.2.0/client_1/bin/sqlplus

Code:
/u01/app/oracle/product/11.2.0/client_1/bin/sqlldr

Why i am asking this because I got the following errors if I just
put in
Code:
sqlplus username/password@database

OR
Code:
sqlldr username/password@database


Code:
./targetTodosomething1.sh[41]: sqlplus:  not found.
./targetTodosomething1.sh[49]: sqlldr:  not found.

---------- Post updated at 06:06 PM ---------- Previous update was at 10:27 AM ----------

Can you give me any comment on the following ?
Code:
"/u01/app/oracle/product/11.2.0/client_1/bin/"

is where sqlldr located in.

Code:
/u01/app/oracle/product/11.2.0/client_1/bin/sqlldr loginName/password@jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = XYZ)(PORT =15203)) (CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = DBNAME))) log=$JOBLOG control=$SQLLDR_CTL data=$INFILE errors=10000 direct=true rows=10000

---------- Post updated at 06:14 PM ---------- Previous update was at 06:06 PM ----------

Or should I use this command ?

Code:
/u01/app/oracle/product/11.2.0/client_1/bin/sqlldr loginName/password@//10.X.X.X:1521/ABC log=$JOBLOG control=$SQLLDR_CTL data=$INFILE errors=10000 direct=true rows=10000


Last edited by Neo; 11-27-2017 at 08:50 AM..
# 11  
Old 11-24-2017
The commands ping and tnsping do different tasks. The ping will target an IP address, be that a server, desktop, switch, security camera, fridge or whatever networked device. tnsping on the other hand will take the name and try to make a connection to the running Oracle SID. It will first have to determine which host the database is on and get the IP address, so in at least needs to be able to ping the server. It will then use the name you give it and try to open a conversation with the listener (typically on port 1521 or the server) and check if the SID is valid.

The contents of tnsnames.ora provides the translation between the name you use and the server & name that the listener will respond to. The name you use could be changed to another by tnsnames.ora and/or another by the listener on the target server to get to the actual Oracle instance. If you are unable to validate the connection with tnsping, you will not be able to connect, however in your case you can't even get tnsping to start.

These errors suggest that you have not set up the environment correctly on your desktop or client, and that would explain why it cannot connect too, because it will not know where to find the tnsnames.ora file.

You should (at the least) have entries in your $PATH that included where executables are. Do you have a colleague that this works for that we can compare?

It would be good to see the output for both you & your colleague for:-
Code:
uname -a
ps
echo $PATH
echo $ORACLE_HOME
echo $ORACLE_SID
find / -name tnsnames.ora -o -name oraenv 2>/dev/null

You might also try
Code:
/u01/app/oracle/product/11.2.0/client_1/bin/tnsping database-name

to see the tool start, but I would not expect it to find tnsnames.ora so it will probably not connect. You might like to post the output in the thread too.


Please post all output/errors in CODE tags to make it easier to read and to preserve the spacing/indenting.



Thanks, in advance,
Robin
# 12  
Old 11-26-2017
Now I changed the code to the following :

Code:
sqlldr loginName/password@//10.x.x.x:1521/ABC log=$JOBLOG control=$SQLLDR_CTL data=$INFILE errors=10000 direct=true rows=10000

It returns the following error :
Anyone has solution ???


Code:
ERROR:
ORA-12541: TNS:no listener


SP2-0306: Invalid option.
Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM}] [edition=value]]
where <logon> ::= <username>[/<password>][@<connect_identifier>]
      <proxy> ::= <proxyuser>[<username>][/<password>][@<connect_identifier>]
SP2-0306: Invalid option.
Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM}] [edition=value]]
where <logon> ::= <username>[/<password>][@<connect_identifier>]
      <proxy> ::= <proxyuser>[<username>][/<password>][@<connect_identifier>]
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

SQL*Loader: Release 11.2.0.4.0 - Production on Fri Nov 24 18:12:19 2017

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

SQL*Loader-704: Internal error: ulconnect: OCIServerAttach [0]
ORA-12541: TNS:no listener

# 13  
Old 11-27-2017
There is usually information on the Oracle error with the oerr command. Try oerr ORA-12541 Failing that, have a look here

Basically the server is not listening for you or there is a network issue preventing you connecting, e.g. firewall, routing, IP tables (local firewall on the server itself) Firstly, check you have the right server. You would be far better using a tnsnames.ora file rather than coding IP addresses in your connection string.

Your updates are quite a leap. Do you have any output from the requests above? That way we will know where we're starting from and be better placed to help.



Robin
# 14  
Old 11-27-2017
Finally, I got the problem solved. Thanks to all kindly suggestions and advice.
Cheers.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need Script to ZIP/SAVE & then DELETE Log file & send a mail conformation for any error

ENVIROMENT Linux: RHEL 6.4 Log Path: /usr/iplanet/servers/https-company/logs Log Format: user.log.03-15-2015 I have log4j log rotation enabled rotating files on a daily basis. The rotated logs are NOT compressed & are taking up too much space. I need a script that will run daily that... (1 Reply)
Discussion started by: admin_job_admin
1 Replies

2. Shell Programming and Scripting

Sqlplus error - sqlplus -s <login/password@dbname> : No such file or directory

i am using bash shell Whenever i declare an array, and then using sqlplus, i am getting sqlplus error and return code 127. IFS="," declare -a Arr=($Variable1); SQLPLUS=sqlplus -s "${DBUSER}"/"${DBPASS}"@"${DBASE} echo "set head off ; " > ${SQLCMD} echo "set PAGESIZE 0 ;" >> ${SQLCMD}... (6 Replies)
Discussion started by: arghadeep adity
6 Replies

3. Shell Programming and Scripting

SQLPLUS Error Capturing

This is my .sh file sqlplus -s my_user/my_pswd@mydb @my_sql.sql ret_code=$? if then echo "return code is $ret_code " echo "Failed" else echo "return code is $ret_code " echo "Success" fi ===================================================== and my_sql.sql is whenever... (4 Replies)
Discussion started by: emailsafath2011
4 Replies

4. Shell Programming and Scripting

sqlplus error output to different error log file

HELLO, I am using such a command to write oracle sqlplus query result to text file: sqlplus -S xxx/xxx@xxxxxxx @\tmp\2.sql>\tmp\123.txt Is it possible to script that: If command succesfull write in \tmp\log.txt: timestamp and "succeded" and create 123.txt with results else If error... (2 Replies)
Discussion started by: tomasba
2 Replies

5. Linux

Kernal panic error& setuproot:error mounting /proc&/sys

Hi all, I am new to redhat/fedora linux. In fedora linux 6,we created one file system(hda3 - /fs). in this mount poing we were installed mounta vista os. while booting we are getting below error messages. 1) Booting 'mountaVisat(2.6.18_pro 500_pc_target-x86_586 smp)' root(hd0,1)... (2 Replies)
Discussion started by: arjunreddy3
2 Replies

6. Shell Programming and Scripting

error running sqlplus from shell file

I am running a shell file following script on bash shell in solaris 10 ( echo abc@orcl echo abc echo "set feedback off" echo "truncate table SIndexDataTypeHst1_changes;" ) | sqlplus -s but getting the following error ERROR: ORA-01005: null password given; logon denied ... (3 Replies)
Discussion started by: mmunir
3 Replies

7. Shell Programming and Scripting

SQLPLUS error

I am running a script that invokes SQLPLUS. During the execution I get the following: SQL*Plus: Release 9.2.0.8.0 - Production on Mon Jun 11 16:12:50 2007 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. Connected to: Oracle9i Enterprise Edition Release 9.2.0.8.0 -... (3 Replies)
Discussion started by: ssmith001
3 Replies

8. Shell Programming and Scripting

shell script & sqlplus "plzz help"

hi friends, i m tryin to load data from one set of table to other i have sql procedure al ready for it..! i m going to load the procedure only if data in one of my table for example table "landing " have 10 records each attribute of this table is file_name status date ... (2 Replies)
Discussion started by: kulbir
2 Replies

9. UNIX for Dummies Questions & Answers

error connecting to sqlplus

Hi, I wrote a shell script to call oracle procedure. But when i am trying to connet sqlplus with the fallowing statement It is giving me error " callproce.sh : sqlplus: not found". What could be the problem. sqlplus -s $CONNECT_STRING >$LOGFILE <<!! thank u all papachi (2 Replies)
Discussion started by: papachi
2 Replies

10. Shell Programming and Scripting

sqlplus -s error capture

Hi folks a wee problem that requires some help. I am writing a script that allows me to automate the changing of a password in sqlplus the problem i encounter is that the code contains a case statement that allows the helpdesk to select whether to allow or deny access by switching the... (1 Reply)
Discussion started by: w33man
1 Replies
Login or Register to Ask a Question