LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-16-2005, 08:31 PM   #1
nelnel
Member
 
Registered: May 2005
Posts: 47

Rep: Reputation: 15
Oracle Connection problem


I am doing a school project. Try to make a database application program in linux to connect remote oracle database server(LAN).
Actually, i am the newbie of the oracle database. I have downloaded the oracle 9i release 2 from Oracle.com. And i have installed the Oracle 9i clientto the linux. But how could i connect the remote server??
Do i need to specify the IP and User/PWD of the Oracle Database Server in the Oracle 9i Client Config.?
Also, are there any GUI Management Interface for the Oracle Client to test some SQL statement, like the window one?

I have read the Oracle Admintration Guide and Installation Guide, but still don't have idea of the above questions...

Thx for ur help!!
 
Old 06-17-2005, 03:49 PM   #2
bentz
Member
 
Registered: Mar 2003
Distribution: Fedora, Mac OSX
Posts: 362

Rep: Reputation: 30
You need to configure tnsnames.ora, which is buried somewhere in the oracle installation directory. psql is a command line utility that you can use to query the server, and I don't believe it's hard to use (but it does have it's quirks). Also, if you've installed all the GUI stuff, you can start up the Net9 Assistant and punch in the values you need to connect to the remote server in a GUI interface. This will set up your tnsnames.ora file for you.
 
Old 06-17-2005, 09:12 PM   #3
duliano
Member
 
Registered: Oct 2004
Location: Clayton, NY
Distribution: SuSE Prof 9.1, 9.2, 9.3Pro X86_64 SLES 8 & 9
Posts: 82

Rep: Reputation: 16
Typically though, tnsnames.ora and listener.ora are setup to allow connections to port 1527 by default. Unless you have more than one instance of oracle running on the machine you should not have to adjust those files. Can you connect to oracle via sqlplus? Did you doing a ps -ef |grep lsnctrl ? if the listener is not running you will not be able to connect remotely even though you can connect via sqlplus.

Hope this helps
 
Old 06-20-2005, 03:00 AM   #4
nelnel
Member
 
Registered: May 2005
Posts: 47

Original Poster
Rep: Reputation: 15
first of all, thanks for ur help.

i already get the Remote Oracle Database Name and IP, also the User/pwd. but i don't know where to input the ip.
I know in Window, i can input the info. into the connection dialog box, but in linux i can't find this config.

Now i try to use SQLPLUS to connect the DB, but no place to input the ip and server name.

I follow bentz said, i find the tnsnames.ora and sqlnet.ora in the ORACLE_HOME/ network/admin/samples/ folder. but not in the outside. i don't know it is my setup problem or the other problem....

About the net 9.... i can't find it to run....>_<

Sorry to asking this kind of stupid question. Are there any book can be suggested to me to learn the setting of the ORacle Clients in LINUX???

THX ALOT AGAIN!!!
 
Old 06-22-2005, 02:57 AM   #5
sadun
Member
 
Registered: Mar 2005
Posts: 48

Rep: Reputation: 15
Hi,

It is simple. Just why are you bothering with ip. Oracle uses its internal mechanism to connect. You just need to enter your username your password and database sid to connect. For example you have a database named orcl in the host machine which has a name dbserver and your sys password is oracle then at sqlplus screen u need to write

connect sys as sysdba/oracle@orcl

Or at the sqlplus screen there are three tabs. First tab your name. Second tab your password. Third tab at this example u need to write orcl@hostname

If however you cant login with that way than you need to check your tnsnames.ora, listener.ora and sqlnet.ora to ensure with your network settings. At that point if you get any error then post it here. Your hostname and ip settings are in tnsnames.ora and listener.ora.

If you need deeper technical explanation just ask. For documentation visit Oracle documentation center


Best regards

Last edited by sadun; 06-22-2005 at 03:02 AM.
 
Old 06-27-2005, 03:21 AM   #6
nelnel
Member
 
Registered: May 2005
Posts: 47

Original Poster
Rep: Reputation: 15
thx for ur help

when i type ur mentioned command , it shows

ORA-12154: TNS:could not resolve service name

What problem of it???
 
Old 06-27-2005, 04:17 AM   #7
sadun
Member
 
Registered: Mar 2005
Posts: 48

Rep: Reputation: 15
Hi,

Which operating system do you have? The error message is clear. It says that you dont have orcl service running. Post the contents of your sqlnet.ora listener.ora and tnsnames.ora. Looking inside sqlnet.log and listener.log may show the problem. Also explaining your network architecture may be helpful. So I can point the exact problem. Anyway if you want to do it yourself (As this is school work ). Try these

At command prompt or shell type

lsnrctl status

see if the listener exists and type

lsnrctl stop
and
lsnrctl start

to restart listener if that doesnt help then you can start netmanager utility and create new listener.ora tnsnames.ora and sqlnet.ora. If all fails you need to take sqlnet and listener trace.

You can take it by applying following lines to your sqlnet.ora and listener.ora

TRACE_LEVEL_<CLIENT/LISTENER/SERVER>=16

TRACE_DIRECTORY_<CLIENT/LISTENER/SERVER>=<directory name>

LOG_DIRECTORY_<CLIENT/LISTENER/SERVER>=<directory name>

This will produce a trace which will point the exact problem

Best Regards,
 
Old 06-27-2005, 05:02 AM   #8
nelnel
Member
 
Registered: May 2005
Posts: 47

Original Poster
Rep: Reputation: 15
thx

whe i type lsnrctl status
it shows this message

Connecting to (ADDRESS=(PROTOCOL=tcp)(PORT=1521))
TNS-12541: TNS:no listener
TNS-12560: TNSrotocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused

i have copy the tnsnames.ora ans sqlnet.ora from my partner computer(He is doing the Window Client side program to connect the same oracle database. He is successfully connect to the database)
And put them to my Linux .....still fail, what's problem of it????

my sqlnet.ora:
NAMES.PREFERRED_SERVERS =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = DD5)(PORT = 1575))
(ADDRESS = (PROTOCOL = TCP)(HOST = DD6)(PORT = 1575))
)

SQLNET.EXPIRE_TIME = 0
NAMES.DIRECTORY_PATH= (ONAMES, TNSNAMES)
~

my tnsnames.ora:

SPDCBACK =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dd1)(PORT = 1521))
(CONNECT_DATA = (SID = s01))
)

i try to run this command but fail: sqlplus ouser/12345@SPDCBACK
B.R.
 
Old 06-27-2005, 06:03 AM   #9
sadun
Member
 
Registered: Mar 2005
Posts: 48

Rep: Reputation: 15
You didnt give me the requested information either way...

1-
Quote:
Connecting to (ADDRESS=(PROTOCOL=tcp)(PORT=1521))
TNS-12541: TNS:no listener
TNS-12560: TNSrotocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
Means you have no listener. You said i copied tnsnames.ora and sqlnet.ora. What about listener.ora check if you have it and if properly configured. If possible post your listener.ora here.

2-You can delete all three files and type

netmgr

at shell to create your net setting automatically.


Quote:
NAMES.PREFERRED_SERVERS =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = DD5)(PORT = 1575))
(ADDRESS = (PROTOCOL = TCP)(HOST = DD6)(PORT = 1575))
)
This means you are using oracle name service authentication. It is unusual for testing purposes. Are you sure for that? That is why i asked for your network architecture. It is like you have some other oracle application like OAS or you have multiple servers.

Quote:
SQLNET.EXPIRE_TIME = 0
Just delete that line from your sqlnet.ora as it is tricky for catching errors.

Quote:
SPDCBACK =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dd1)(PORT = 1521))
(CONNECT_DATA = (SID = s01))
)

i try to run this command but fail: sqlplus ouser/12345@SPDCBACK
The correct syntax need to be sqlplus ouser/12345@s01
Listener.ora handles the s01 description (Your database service)
 
Old 06-27-2005, 08:07 PM   #10
nelnel
Member
 
Registered: May 2005
Posts: 47

Original Poster
Rep: Reputation: 15
unlucky, when i try netmgr, it displays another error on the screen:

[oracle@H733-00011 9.2.0]$ netmgr
/opt/oracle/jre/1.1.8/bin/../lib/i686/native_threads/libzip.so: symbol errno, version GLIBC_2.0 not defined in file libc.so.6 with link time reference (libzip.so)
Unable to initialize threads: cannot find class java/lang/Thread
Could not create Java VM

i try to search from google, i find that it may need older version of JVM or the multi-JVM in the same system problem.

But i don't know how to solve it.....

About the Listener...as the Database Admin. has gone to the trip, i can't ask him now......and i see my partner's Window version is working well.... i think the listener is OK...but don't know where is fail .....

BR
 
Old 06-28-2005, 12:43 AM   #11
nelnel
Member
 
Registered: May 2005
Posts: 47

Original Poster
Rep: Reputation: 15
thanks sadun, i have solved the solution...after i reinstall the Oracle Client....may be some error occur during last installations
 
Old 06-28-2005, 02:01 AM   #12
sadun
Member
 
Registered: Mar 2005
Posts: 48

Rep: Reputation: 15
Great!! Sorry couldnt help much.
 
Old 03-28-2006, 06:35 AM   #13
joerifeyen
LQ Newbie
 
Registered: Mar 2006
Posts: 2

Rep: Reputation: 0
Hello, im having the same stupid problem can you guys help me?
I have Linux Suse 10 , im running Oracle 9 (Database on network) and PHP 5.
I have done the connection on a windows machine and it worked but on linux...

When i type ./lsnrctl status:
LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 28-MAR-2006 14:31:52

Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=GM75P0J)(PORT=1521)))
TNS-12545: Connect failed because target host or object does not exist
TNS-12560: TNSrotocol adapter error
TNS-00515: Connect failed because target host or object does not exist

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
TNS-12541: TNS:no listener
TNS-12560: TNSrotocol adapter error
TNS-00511: No listener
Linux Error: 2: No such file or directoryv

When i try to lsnrctl stop:
onnecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=GM75P0J)(PORT=1521)))
TNS-12545: Connect failed because target host or object does not exist
TNS-12560: TNSrotocol adapter error
TNS-00515: Connect failed because target host or object does not exist

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
TNS-12541: TNS:no listener
TNS-12560: TNSrotocol adapter error
TNS-00511: No listener
Linux Error: 2: No such file or directory


When i try to start:


Starting /home/oracle/u01/app/oracle/product/9.2.0//bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 9.2.0.4.0 - Production
NL-00280: error creating log stream /home/oracle/u01/app/oracle/product/9.2.0/network/log/listener.log
NL-00278: cannot open log file
SNL-00016: snlfohd: error opening file
Linux Error: 13: Permission denied

Listener failed to start. See the error message(s) above...

When i type netmgr:
ernie:/home/oracle/u01/app/oracle/product/9.2.0/bin # ./netmgr
/home/oracle/jre/1.1.8/bin/../bin/i686/native_threads/jre: relocation error: /home/oracle/jre/1.1.8/bin/../lib/i686/native_threads/libjava.so: symbol __libc_wait, version GLIBC_2.0 not defined in file libc.so.6 with link time reference

I hope you can help me..

Last edited by joerifeyen; 03-28-2006 at 06:38 AM.
 
Old 03-29-2006, 05:13 AM   #14
sadun
Member
 
Registered: Mar 2005
Posts: 48

Rep: Reputation: 15
Hi there,

It is so clear that you couldnt do oracle installation right. Oracle is not certified on Suse 10. It is certified with SLES9. It is possible installing with SUSE10 but you need to double check pre-installation requirements.

Pls post your installlation log for clarifying the situation.

Best Regards,
 
Old 03-29-2006, 06:12 AM   #15
joerifeyen
LQ Newbie
 
Registered: Mar 2006
Posts: 2

Rep: Reputation: 0
I dont know its done right. Im a stagair and have to make something with php and oracle. Its installed. I can access sqlplus...
My listener is not working, im not having a database local its remote. There is ann oracle account:s. Where is the installation log?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
xhost + as user oracle not working, need to see oracle install GUI enzo250gto Linux - Software 2 02-11-2007 11:27 AM
PHP Oracle 9i Connection Problem (RH9) dhammika Linux - Software 8 03-28-2005 02:18 PM
Oracle EM. emctl start dbconsole fails: connection refused. deanbrown3d Linux - Software 4 01-31-2005 03:01 AM
Oracle 10g Client Connection Issue coolamit78 Linux - Networking 2 09-07-2004 08:05 AM
connection to oracle database through vb code suchi_s Programming 1 07-30-2004 01:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration