connect to oracle db computer in a LAN in asp.net

417 Views Asked by At

Im trying to connect to a oracle 11g db on a LAN system in asp.net. But Im getting ORA-12541: TNS:no listener error.

I made following changes in the files .....

sqlnet.ora

SQLNET.AUTHENTICATION_SERVICES= (BEQ, TCPS, NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

tnsnames.ora

TESTDB =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.50)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TESTDB)
    )
  )

LISTENER_TESTDB =
  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))

listener.ora

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.50)(PORT = 1521))
    )
  )

Please let me know how i can solve this issue....

Thanks...

1

There are 1 best solutions below

1
On

Did you start the listener? On the server:

lsnrctl status: should tell you if the listener is up

lsnrctl start: should start up the default listener, assuming there are no passwords

EDIT:

Since the listener is running, what does the lsnrctl status command tell you about the databases it's serving?

  • Can you connect to the database from the command line?
  • Can you run tnsping testdb and contact the listener?
  • When you try to connect, are you on the server, or a different host?