Results 1 to 11 of 11
  1. #1
    Join Date
    Sep 2003
    Posts
    7

    Unanswered: ORA-12154: TNS:could not resolve service name

    I have tried everything I can do to solve this and have had no luck. I searched the relentlessly and have gotten no where. Please help. I have installed the Oracle 9i Database on Redhat 9. I am trying to connect to the database that was supposed to be created during setup and keep getting a TNS error. I have listed the error message, tnsnames.ora and listener.ora files below along with the results of lsnrctl stat. Any help would be much appreciated.

    [oracle@localhost admin]$ cat tnsnames.ora
    # TNSNAMES.ORA Network Configuration File: /opt/ora9/product/9.2/network/admin/tnsnames.ora
    # Generated by Oracle configuration tools.

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

    HOME.LOCALDOMAIN =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
    )
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = home.edi.com)
    )
    )

    EXTPROC_CONNECTION_DATA.LOCALDOMAIN =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    )
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    )
    )

    [oracle@localhost admin]$
    [oracle@localhost admin]$
    [oracle@localhost admin]$
    [oracle@localhost admin]$
    [oracle@localhost admin]$ cat listener.ora
    # SQLNET.ORA Network Configuration File: /opt/ora9/product/9.2/network/admin/sqlnet.ora
    # Generated by Oracle configuration tools.

    NAMES.DEFAULT_DOMAIN = localdomain

    NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)

    [oracle@localhost admin]$
    [oracle@localhost admin]$
    [oracle@localhost admin]$
    [oracle@localhost admin]$ lsnrctl stat

    LSNRCTL for Linux: Version 9.2.0.1.0 - Production on 01-SEP-2003 01:55:54

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

    Connecting to (ADDRESS=(PROTOCOL=tcp)(PORT=1521))
    STATUS of the LISTENER
    ------------------------
    Alias LISTENER
    Version TNSLSNR for Linux: Version 9.2.0.1.0 - Production
    Start Date 01-SEP-2003 01:44:55
    Uptime 0 days 0 hr. 10 min. 58 sec
    Trace Level off
    Security OFF
    SNMP OFF
    Listener Parameter File /opt/ora9/product/9.2/network/admin/listener.ora
    Listener Log File /opt/ora9/product/9.2/network/log/listener.log
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhos t.localdomain)(PORT=1521)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhos t.localdomain)(PORT=8080))(Presentation=HTTP)(Sess ion=RAW))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhos t.localdomain)(PORT=2100))(Presentation=FTP)(Sessi on=RAW))
    Services Summary...
    Service "estsXDB.edi.com" has 1 instance(s).
    Instance "ests", status READY, has 1 handler(s) for this service...
    Service "home.edi.com" has 1 instance(s).
    Instance "ests", status READY, has 1 handler(s) for this service...
    The command completed successfully

  2. #2
    Join Date
    Aug 2003
    Posts
    123
    Hi,
    I suppose there could be problem with the domain name please check the domain name you have given.
    try
    1. connect using username@sid with domain name
    2. delete the tnsname.ora file and create a new using net configuration assistant.

    else mail me i will help you to resolve this problem...


    --jaggu

  3. #3
    Join Date
    Mar 2002
    Location
    Ireland
    Posts
    181
    Also, could you cat the entry in your sqlnet.ora file?
    Rgs,
    Breen.

  4. #4
    Join Date
    Sep 2003
    Posts
    7
    Here is the sqlnet.ora file. Thanks for taking the time to check things over.

    [oracle@localhost admin]$ cat sqlnet.ora
    # SQLNET.ORA Network Configuration File: /opt/ora9/product/9.2/network/admin/sqlnet.ora
    # Generated by Oracle configuration tools.

    NAMES.DEFAULT_DOMAIN = localdomain

    NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)

  5. #5
    Join Date
    Sep 2003
    Posts
    7
    I ran the net configuration assistant and still had the same problem, however, I was not able to get the Directory Usage Configuratoin portion to complete properly.

    Any suggestions?

  6. #6
    Join Date
    Aug 2003
    Posts
    123
    execute the sqlplus.exe from orahome/bin

    --Jaggu

  7. #7
    Join Date
    Sep 2003
    Posts
    7
    Logged in as Oracle, cd to $ORACLE_HOME/bin, the results are below.

    [oracle@localhost bin]$ pwd
    /opt/ora9/product/9.2/bin
    [oracle@localhost bin]$ sqlplus

    SQL*Plus: Release 9.2.0.1.0 - Production on Mon Sep 1 22:35:44 2003

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

    Enter user-name: system@ests
    Enter password:
    ERROR:
    ORA-12154: TNS:could not resolve service name


    Thanks for in advace for any help.

    Methos

  8. #8
    Join Date
    Aug 2003
    Posts
    123
    Hi,
    Everything seems to be ok.
    How are you connecting to Oracle through sqlplus?. If so give the username as scott@home.localdomain and password.
    If you do not want to give the '.localadmin' remove/mask the entry 'NAMES.DEFAULT_DOMAIN = localdomain' from the sqlnet.ora.

    Also execute the sqlplus.exe from the orahome/bin.

    Hope it should work.

    All the best
    --Jaggu

  9. #9
    Join Date
    Aug 2003
    Posts
    123
    Hi
    What is 'ests' (Enter user-name: system@ests). I could not find any service of that name in your tnsnames.ora

    --Jaggu

  10. #10
    Join Date
    Sep 2003
    Posts
    7
    That worked and I can get into sql if I log in with

    system/password

    but I am not able to get in when I try and specify a database instance such as

    system@ests
    password

    [oracle@localhost bin]$ sqlplus

    SQL*Plus: Release 9.2.0.1.0 - Production on Mon Sep 1 22:41:08 2003

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

    Enter user-name: scott@home.localdomain
    Enter password:

    Connected to:
    Oracle9i Release 9.2.0.1.0 - Production
    JServer Release 9.2.0.1.0 - Production

    SQL>


    Thanks, Methos

  11. #11
    Join Date
    May 2003
    Location
    Dublin, Ireland
    Posts
    44
    You are trying to connect using instance name (ests) instead of your connection string (home.localdomain).
    If you are using NET8 for connection (by specifying @name) you have to use connection string defined in the tnames.ora no the instance name.
    Try

    sqlplus system@home.localdomain

    it will get you to the ests instance.


    Cheers,

    Jacek

    Originally posted by methos
    That worked and I can get into sql if I log in with

    system/password

    but I am not able to get in when I try and specify a database instance such as

    system@ests
    password

    [oracle@localhost bin]$ sqlplus

    SQL*Plus: Release 9.2.0.1.0 - Production on Mon Sep 1 22:41:08 2003

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

    Enter user-name: scott@home.localdomain
    Enter password:

    Connected to:
    Oracle9i Release 9.2.0.1.0 - Production
    JServer Release 9.2.0.1.0 - Production

    SQL>


    Thanks, Methos

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •