Connecting+Firing plsql to Oracle DB in one go


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Connecting+Firing plsql to Oracle DB in one go
# 1  
Old 04-18-2013
Oracle Connecting+Firing plsql to Oracle DB in one go

Hi,

I am using the below command to connect to a remote Oracle DB from my unix shell script.

Code:
sqlplus -s user1/password1@remotedbhost:1252/demo @/tmp/PROC_MS.prc

But I get the below error.

Quote:
ORA-12154: TNS:could not resolve the connect identifier specified
1. Can you confirm if my code is correct ?

2. Can you help me overcome the error ?
# 2  
Old 04-18-2013
Firstly, I would say that this is a bad plan. If you connection opens, then until you close it a simple ps will reveal the user1/password1 clearly on the command line.

Anyway, this looks like a TNS definition error. What do you have for remotedbhost in your tnsnames.ora file?

Additionally, can you confirm that the other end is listening on that port too? Normally, the Oracle TNS port is 1521 and you wouldn't normally specify it.




Robin
Liverpool/Blackburn
UK
# 3  
Old 04-18-2013
Host port number is correct for sure.

See ...

Quote:
telnet remotedbhost 1252
Trying 101.133.22.183...
Connected to remotedbhost .
Escape character is '^]'.
Anyway, this looks like a TNS definition error. What do you have for remotedbhost in your tnsnames.ora file?

Its a Huge file, what's exactly that i need to check in there ??
# 4  
Old 04-18-2013
On the server side, do you have lsof installed? If so, can you share the output of:-
Code:
netstat -na | grep 1252
lsof -i tcp:1252

For the tnsmanes.ora file, if you can edit it are search for the remotedbhost strings and paste the whole logical record that would be good. You don't say what Oracle version, but there would need to be a listener process too that you should be able to query on the remotedbhost, hopefully with lsnrctl status and the output from that would be useful too.




Robin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Please help me how to administrate Oracle/plsql server

I previously worked for the L1 support on DNS/Apache servers in solaris10...... Now our team lead wants me to work on Oracle/plsql server for our new client.... I've to work without training... How can we know that Oracle/plsql server running in our machine ?? How to Administrate... (1 Reply)
Discussion started by: vamshigvk475
1 Replies

2. Solaris

Connecting to Oracle database

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)
Discussion started by: solaris_user
2 Replies

3. Shell Programming and Scripting

scope of oracle plsql development /unix shell scripting

I am working in production support in an leading bank and more of my job is more in oracle/plsql. I am learning unix shell scripting and have started development in the same.I would like to know regarding the scope of these two in the industry.Also would like to know about other scripting... (2 Replies)
Discussion started by: jesthomas
2 Replies

4. Shell Programming and Scripting

Help need Connecting to Oracle DB from Unix

I have a table called CLARIFICATION in one of my schema in Oracle Data Base. I have to connect to oracle Data Base from Unix and compare the one of the column(Exec_Date) in CLARIFICATION table with Sysdate.If Exec_Date = Sysdate go head and run rest of the script otherwise exit out with out... (2 Replies)
Discussion started by: veeru
2 Replies

5. Shell Programming and Scripting

Connecting to Oracle DB using sqlplus

Hi, I am very new to shell scripting and trying to write a simple shell script in which i am trying to achieve the following: 1. Connect to oracle database hosted on a different server 2. fire a query on the oracle db 3. store the output in a variable 4. use this variable for further logic... (26 Replies)
Discussion started by: shrutihardas
26 Replies

6. UNIX for Dummies Questions & Answers

Connecting to Oracle DB using sqlplus

Hi, I am very new to shell scripting and trying to write a simple shell script in which i am trying to achieve the following: 1. Connect to oracle database hosted on a different server 2. fire a query on the oracle db 3. store the output in a variable 4. use this variable for further logic... (1 Reply)
Discussion started by: shrutihardas
1 Replies

7. Shell Programming and Scripting

Connecting to ORACLE through SHELL

Hi, I am trying to connect to oracle database (9.2.0.7.0) through Sun solaris. But I am unable to do so. The content of my script is as follows: Shell Sript: RESULT=`$ORACLE_HOME/bin/sqlplus schema/'pwd'@db << EOF set echo on; set feedback on; @/home/count/qry.sql` echo... (10 Replies)
Discussion started by: fidelis
10 Replies

8. Shell Programming and Scripting

Help me Connecting CA::Autosys to oracle DB

Hi :), Am new to work with Autosys. I have Oracle installed in my computer. Please guide me how to configure and connect autosys with oracle database. thank you..!:) (0 Replies)
Discussion started by: bhuvaneshlal
0 Replies

9. Shell Programming and Scripting

Connecting CA::Autosys to oracle DB

Hi :), I have installed CA Autosys in my Unix system. It contains 3 ( .pm ) files namely AutoSys.pm, Job.pm, Status.pm ....... in a directory CA. Am trying to work with autosys for first time. Please guide in how do i connect autosys to oracle DB in my system. My oracle db name is XE.. Thank... (0 Replies)
Discussion started by: bhuvaneshlal
0 Replies

10. Shell Programming and Scripting

To get value from Oracle Anonymous PLSQL block

Hi All, i need you help while accessing the value from anonymous PL/SQL block. Initially our requirement was to get the value from SQL statement. I was doing like... But now i need to use dbms_application_info.set_module in it. So i have planned to use anonymous block instead of SQL... (2 Replies)
Discussion started by: Amit.Sagpariya
2 Replies
Login or Register to Ask a Question