Databases
cancel
Showing results for 
Search instead for 
Did you mean: 

oracle jdbc No listner error12541

SOLVED
Go to solution
far
Occasional Advisor

oracle jdbc No listner error12541

this is the first time i try to connect oracle with java (jdbc) i have the correct url in my java code but still i can;t get connected, i checked the lsnrctl status:

tns-12541:tns:no listner
also protocol adaptor error
no listner
windows :61:unknow error

plz can anyone help me

15 REPLIES
Kenneth_19
Trusted Contributor
Solution

Re: oracle jdbc No listner error12541

Try checking the status of the listener on your database server:

$ORACLE_HOME/bin/lsnrctl status

If it is not running, start the listener:

$ORACLE_HOME/bin/lsnrctl start

If your instance is not yet configured in the listener file:

edit the $ORACLE_HOME/network/admin/listener.ora

Kenneth
Always take care of your dearest before it is too late
far
Occasional Advisor

Re: oracle jdbc No listner error12541

hi kenneth, i am glade u answered me so soon, can plz help me configure my lisnter file, by the way i am runing client and server on one machine, i am a student ,i have a project, java and database, i just need them get conected.
far
Occasional Advisor

Re: oracle jdbc No listner error12541

maybe this file can help
Sanjay Kumar Suri
Honored Contributor

Re: oracle jdbc No listner error12541

A sample file is listed below:

# LISTENER.ORA Network Configuration File: E:\oracle\ora90\network\admin\listener.ora
# Generated by Oracle configuration tools.

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = HOST_NAME)(PORT = 1521))
)
)
)

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = E:\oracle\ora90)
(SID_NAME = orcl)
)
)

Change the values on the RHS of = and start the listener by command given in previous post.

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
far
Occasional Advisor

Re: oracle jdbc No listner error12541

thanks sks,this is my file what should be changed?..waiting for ur reply..thanks again


# LISTENER.ORA Network Configuration File: D:\oracle\ora90\network\admin\listener.ora
# Generated by Oracle configuration tools.

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = farlau)(PORT = 1521))
)
)
)

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D:\oracle\ora90)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = data)
(ORACLE_HOME = D:\oracle\ora90)
(SID_NAME = data)
)
)

Sanjay Kumar Suri
Honored Contributor

Re: oracle jdbc No listner error12541

You listener.ora file seems to be ok. Can you check

Start --> Settings --> Control Panel --> Administrative tools --> Services

And look for the Oracle Service like OracleOraHome90TNSLinstener and start/stop/start the same.

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
far
Occasional Advisor

Re: oracle jdbc No listner error12541

i realy appreaciate that u are helping me.. i did what u told me, but windowsxp gave me an error, do u think i should reinstall oracle.. here is a snapshot of the error
Sanjay Kumar Suri
Honored Contributor

Re: oracle jdbc No listner error12541

Can you stop OracleServiceDATA before acting on my previous post?

Once Listener started, OracleServiceDATA can be started.

Check the status of Listener with

lsnrctl status

If all works:
set oracle_sid=DATA
(DATA seems to be the database name)

and then try to start the database.

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
far
Occasional Advisor

Re: oracle jdbc No listner error12541

hi sks, it gave me the same error even though i stoped the OracleServiceDATA,so do u think if i reinstalled oracle it might work????
note:host=falau
and sid=data
i am workin on one machine,trying to make forte4j to work with oracle sql,i got the driver and the correct url but still can't get connected. it just seems that i cant get the OracleServiceDATA started..should i reinstall oracle???
Sanjay Kumar Suri
Honored Contributor

Re: oracle jdbc No listner error12541

Before you do that, can you check the entry in the file tnsnames.ora (location same as listener.ora)

ORCL=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = host_name)(PORT = 1521))
)
(CONNECT_DATA = (SID = ORCL)(SERVER = DEDICATED))
)

Also check the entry sqlnet.ora

NAMES.DIRECTORY_PATH=(TNSNAMES, ONAMES, HOSTNAME)

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
far
Occasional Advisor

Re: oracle jdbc No listner error12541

this is the tsn file:

# TNSNAMES.ORA Network Configuration File: D:\oracle\ora90\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = farlau)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = data)
)
)

INST1_HTTP =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = farlau)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = SHARED)
(SERVICE_NAME = MODOSE)
(PRESENTATION = http://HRService)
)
)

EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)

and this is the sql file:

# SQLNET.ORA Network Configuration File: D:\oracle\ora90\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)

Sanjay Kumar Suri
Honored Contributor

Re: oracle jdbc No listner error12541

Can you match last two lines

(CONNECT_DATA =
(SERVICE_NAME = data)

on the lines of what I have listed.

Also commant the following line (with #):

#SQLNET.AUTHENTICATION_SERVICES= (NTS)

And give it all a fresh try. I am now logging out.

All the best.

sks

A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Yogeeraj_1
Honored Contributor

Re: oracle jdbc No listner error12541

hi,

can you post the output of the following command (run from command prompt on the server):

lsnrctl serv

regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
R. Allan Hicks
Trusted Contributor

Re: oracle jdbc No listner error12541

Haven't done anything with JDBC but...

Can you ping the server from the client?

Open a command window and at the prompt type

ping farlau

If it works, then I'm on the wrong track, however if you get 100% packet loss, try

Look at the hosts file under C:\WINNT\system32\drivers\etc (it may be in a different place on XP). Find the farlau entry and verify the IP address.

If it is there and correct, try pinging the IP instead of the hostname. It could also be that you don't have a route to the server.

If you don't have a network path to the server you can get a TNS-12541 too.

-Good Luck
"Only he who attempts the absurd is capable of achieving the impossible
Yogeeraj_1
Honored Contributor

Re: oracle jdbc No listner error12541

hi,
on the client, can you also try to do a tnsping?

e.g. tnsping

also, can you try to connect using sqlplus using the following:
sqlplus /nolog
then:
sql> Connect /@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=myserver.mu)(PORT=1521))(CONNECT_DATA=(SID=dev10g)))

just to check if you can connect from the client...

regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)