This discussion is archived
11 Replies Latest reply: Mar 3, 2013 5:16 AM by EdStevens RSS

Unable to connect DB using DB Tools with proper tnsnames.ora config

800839 Newbie
Currently Being Moderated
Hi,

My oracle version is 11 and I have installed DB Tool for oracle software into my local machine.I am getting the below error while trying to connect through DB Tool

     Code:
     
ora-12154:TNS :could not resolve the connect identifier specified


But when I am connecting through TOAD I am able to connect the user as well as the password.There is no problem connecting the user through toad.
The issue is coming in the client machine.Let me also tell you that the server is located at different location. Can you please help me as to how to resolve the above issue?I checked tnsnames.ora the connection is successful and I am able to connect through TOAD .

How I should connect the user through DB Tools for Oracle?

I also verified that i have single ORACLE_HOME , in DB Tools I have pointed to the same ORACLE HOME, but still the problem persists. I am using DB Tools for Oracle trial version.

I am pretty sure the tnsnames.ora config is fine , hence it is working well with TOAD. But why I have this problem when I connect using DB tools? Please clarify.

Thanks.
  • 1. Re: Unable to connect DB using DB Tools with proper tnsnames.ora config
    yoonas Expert
    Currently Being Moderated
    >
    I am pretty sure the tnsnames.ora config is fine , hence it is working well with TOAD
    >

    What method are you using to connect from toad, direct or TNS?

    It seems to me that you are able to connect from toad when you use direct method


    See if you can connect from sqlplus with service name
    start sqlplus and connect username/password@servicename
    
    
    ex: connect scott/scott@TEST
    connect with ezconnect and see if you can connect
    sqlplus
    connect username/password@hostname/ip:port/service_name
    
    ex: connect scott/scott@vmtest:1521/TEST
    There was a long thread few weeks back similar to this one, please see {thread:id=2496217}

    post your tnsnames and sqlnet if your issue is not resolved yet.

    Regards
    Yoonas

    Edited by: yoonus on Mar 2, 2013 11:52 PM

    Edited by: yoonus on Mar 2, 2013 11:54 PM
  • 2. Re: Unable to connect DB using DB Tools with proper tnsnames.ora config
    800839 Newbie
    Currently Being Moderated
    Thanks Yoonus. You are right I am able to connect TOAD using direct method and not thru TNS. That is fine. But DB Tools does have those options where we can choose TNS or Direct or LDAP? In such case how can i connect DB tools with Direct method?
  • 3. Re: Unable to connect DB using DB Tools with proper tnsnames.ora config
    yoonas Expert
    Currently Being Moderated
    Hi,

    I have never used the tool you are talking about, i think once you are able to connect with sqlplus using service_name(tnsnames) you might be able to connect with the tool also.

    You will have to check the dbtool documentation to see how different connections method work with it.

    Let's try to fix the issue with service_name (check the thread i have given above)

    copy tnsentry from your database server and paste it to your client tnsnames file ( if you have netmgr you can use it to add a new service)

    make sure you can connect with sqlplus using service_name(username/password@service_name) and try with the tool .

    Regards
    Yoonas
  • 4. Re: Unable to connect DB using DB Tools with proper tnsnames.ora config
    Osama_Mustafa Oracle ACE
    Currently Being Moderated
    797836 wrote:
    Thanks Yoonus. You are right I am able to connect TOAD using direct method and not thru TNS. That is fine. But DB Tools does have those options where we can choose TNS or Direct or LDAP? In such case how can i connect DB tools with Direct method?
    Post your Tnsnames.ora
  • 5. Re: Unable to connect DB using DB Tools with proper tnsnames.ora config
    800839 Newbie
    Currently Being Moderated
    This is my tnsnames.ora

    rfs40qa =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 160.110.151.6)(PORT = 1521))
    )
    (CONNECT_DATA =
    (SERVICE_NAME = rfs40qa)
    (SID = rfs40qa)
    )
    )
  • 6. Re: Unable to connect DB using DB Tools with proper tnsnames.ora config
    yoonas Expert
    Currently Being Moderated
    The posted tnsnames is from server or client?

    Do you have database with SID "rfs40qa" ?

    Please post the direct connections string as well
  • 7. Re: Unable to connect DB using DB Tools with proper tnsnames.ora config
    800839 Newbie
    Currently Being Moderated
    Yes I have a DB named rfs40qa.
  • 8. Re: Unable to connect DB using DB Tools with proper tnsnames.ora config
    Osama_Mustafa Oracle ACE
    Currently Being Moderated
    I hope you post tnsnames.ora for client not server side post

    tnsping rfs40qa
  • 9. Re: Unable to connect DB using DB Tools with proper tnsnames.ora config
    yoonas Expert
    Currently Being Moderated
    I copied your entry to my tnsnames and modified according to my environment, it keeps giving same "ORA-12154: TNS:could not resolve the connect identifier specified"


    Can you create a new tnsnames file and add tnsentry(change the host/service_name/sid to match to your environment)
    rfs40qa=
            (DESCRIPTION=
                    (ADDRESS_LIST=
                    (ADDRESS=(PROTOCOL=tcp)(HOST=test.mylearn.com)(PORT=1521))
                    )
                (CONNECT_DATA=
                    (SERVICE_NAME=VMTEST)
                    (SID=VMTEST)
                )
            )
    Do a tnsping rfs40qa and post the output
  • 10. Re: Unable to connect DB using DB Tools with proper tnsnames.ora config
    EdStevens Guru
    Currently Being Moderated
    797836 wrote:
    Hi,

    My oracle version is 11 and I have installed DB Tool for oracle software into my local machine.I am getting the below error while trying to connect through DB Tool

         Code:
         
    ora-12154:TNS :could not resolve the connect identifier specified


    But when I am connecting through TOAD I am able to connect the user as well as the password.There is no problem connecting the user through toad.
    The issue is coming in the client machine.Let me also tell you that the server is located at different location. Can you please help me as to how to resolve the above issue?I checked tnsnames.ora the connection is successful and I am able to connect through TOAD .

    How I should connect the user through DB Tools for Oracle?

    I also verified that i have single ORACLE_HOME , in DB Tools I have pointed to the same ORACLE HOME, but still the problem persists. I am using DB Tools for Oracle trial version.

    I am pretty sure the tnsnames.ora config is fine , hence it is working well with TOAD. But why I have this problem when I connect using DB tools? Please clarify.

    Thanks.
    For background
    read: [url http://edstevensdba.wordpress.com/2011/02/09/sqlnet_overview/] Help! I can’t connect to my database
    read: [url http://edstevensdba.wordpress.com/2011/02/16/sqlnet_client_cfg/] Help! I can’t connect to my database (part duex)

    For your specific error
    read: [url http://edstevensdba.wordpress.com/2011/02/26/ora-12154tns-03505/] ora-12154tns-03505 
  • 11. Re: Unable to connect DB using DB Tools with proper tnsnames.ora config
    orafad Oracle ACE
    Currently Being Moderated
    797836 wrote:
    My oracle version is 11
    Which one, client or server? Also please post full version.
    I have installed DB Tool for oracle software into my local machine.I am getting the below error while trying to connect through DB Tool
    ora-12154:TNS :could not resolve the connect identifier specified
    How I should connect the user through DB Tools for Oracle?
    For the moment, forget about "DB Tools".

    Post full copy paste of command session with following commands, issued on the client machine:
    tnsping tns-alias
    
    tnsping 'host:port/service name'
    
    sqlplus a/b@tns-alias
    
    sqlplus a/b@'host:port/service name'
    Replace tns alias, host, port and service name with specifics from your setup.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points