Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2003
    Posts
    4

    Unanswered: Couldn't resolve service name in SQLPLUS

    Hi all,

    When I use sqlplus to connect to remote oracle, it fails with the error message ORA-12154: TNS: Couldn't resolve the service name.

    I'm not sure whether I have a correct tnsnames.ora, but I can really use Oracle Enterprise Manager Console to connect the database. Can I be sure there's no problem with tnsnames.ora ? Does SQLPLUS use the same mechanism with which the Console uses?


    Here's my environement:
    - Windows 2000 Server
    - Oracle 9i Client (Customization installation)
    - Remote database is also Oracle 9i

    Any help will be appreciated.

    Stephen Suen
    Last edited by stephensuen; 11-10-03 at 11:07.

  2. #2
    Join Date
    Nov 2003
    Location
    Bangalore, INDIA
    Posts
    333

    Thumbs up Re: Couldn't resolve service name in SQLPLUS

    Hi,

    The Problem is with Tnsnames.ora only.
    B'cos ORA-12154: TNS: Couldn't resolve the service name is mainly due to this issue only. So beter be sure with Ur tnsnames.
    SATHISH .

  3. #3
    Join Date
    Jul 2003
    Posts
    2,296
    try a tnsping from commandline.

    also, post your tnsnames file for the sid you are trying to connect to.
    post listener file as well.
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  4. #4
    Join Date
    Oct 2003
    Posts
    4

    Re: Couldn't resolve service name in SQLPLUS

    Here's my tnsnames.ora

    PORTAL =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.131.161.104)(PORT = 1522))
    )
    (CONNECT_DATA =
    (SERVICE_NAME = PORTAL.SN.CHINAMOBILE.COM)
    )
    )


    Because I can make a connect throught Manager Console, and I can operate on the database without any problem, so I think tnsnames should be right, isn't it?

    Another problem is, my tnsping fails with OS error message box, application error, memory can't be read, etc.

    Are there any possibility I lost something important during the custmization installation of the client pack?

    Thanks all

    Stephen Suen

  5. #5
    Join Date
    Oct 2003
    Posts
    4

    Resolved!

    Hi, all

    in my sqlnet.ora, there's a default_domain parameter with null value.
    Remove this line, then it works.

    Thanks for all help

    Stephen

  6. #6
    Join Date
    Apr 2002
    Location
    California, USA
    Posts
    482
    You can have value for SQLNET.DEFAULT_DOMAIN if you want, but make sure you add this domain to your TNS aliases in tnsnames.ora. If it's WORLD, then the TNS aliases should be: TNSNAME.WORLD


    Hope that helps,

    clio_usa - OCP DBA 8/8i/9i

  7. #7
    Join Date
    Oct 2003
    Posts
    4
    Originally posted by clio_usa
    You can have value for SQLNET.DEFAULT_DOMAIN if you want, but make sure you add this domain to your TNS aliases in tnsnames.ora. If it's WORLD, then the TNS aliases should be: TNSNAME.WORLD


    Hope that helps,

    clio_usa - OCP DBA 8/8i/9i
    Hi, clio_usa

    Thanks a lot for your instructions, I tried it, and it worked.

    Can you give a brief description why my Manager Console can make a connection without any problem when I have mistake in sqlnet.ora, but that caused SQLPLUS failed to make the connection.

    Stephen
    Last edited by stephensuen; 11-11-03 at 06:14.

Posting Permissions

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