1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

REP-0501: Unable to connect to the specified database ORA-12154: TNS: could not resol

Discussion in 'Oracle Forms and Reports' started by jagadekara, Sep 22, 2014.

  1. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Hi All,

    When I am connecting report builder getting the following error.

    REP-0501: Unable to connect to the specified database
    ORA-12154: TNS: could not resolve service name

    I already added TNS entry.

    Help me on this....
     
  2. DTSIGuy

    DTSIGuy Forum Advisor

    Messages:
    402
    Likes Received:
    58
    Trophy Points:
    410
    Location:
    Texas
    Re: REP-0501: Unable to connect to the specified database ORA-12154: TNS: could not r

    I know this is stating the obvious but :
    - Does the connection work via SQL?
    - Are there multiple Oracle_Homes present?
    - Are there multiple TNS files present?
    - Are you using a TNSAdmin parameter?
    - Is it pointing where you think its pointing?
    - Is the database up? The listener?

    :cool:
     
  3. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Re: REP-0501: Unable to connect to the specified database ORA-12154: TNS: could not r

    Hi,

    I connected toad via direct connection with host and port number.
    Yes there are multiple oracle homes.
    Yes multiple TNS Files present.
    What is TNSAdmin Parameter?
    Database is up bcoz, I am running queries in toad.
     
  4. DTSIGuy

    DTSIGuy Forum Advisor

    Messages:
    402
    Likes Received:
    58
    Trophy Points:
    410
    Location:
    Texas
    Re: REP-0501: Unable to connect to the specified database ORA-12154: TNS: could not r

    Well...I suspect that since there are multiple Oracle Homes and have multiple TNS files the TNS entry for the database is not in the TNS file that Oracle Reports is looking at.

    If you're in Windows, the TNSAdmin parameter is a system environment variable directing ALL of the Homes to look HERE for the TNS file...it simplifies things.

    HTH

    CJ
     
  5. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Re: REP-0501: Unable to connect to the specified database ORA-12154: TNS: could not r

    Hi,

    Mine is also windows. So What can I do now?
     
  6. DTSIGuy

    DTSIGuy Forum Advisor

    Messages:
    402
    Likes Received:
    58
    Trophy Points:
    410
    Location:
    Texas
    Re: REP-0501: Unable to connect to the specified database ORA-12154: TNS: could not r

    TNS_ADMIN can be set up in Windows via :

    Start-> RIGHT CLICK Computer -> Select Properties -> Advanced System Settings

    Click Environment Variables. Select NEW under the System Variables and type in TNS_ADMIN as the variable name. The value should be the path to where your master TNSfile AND the SQLNet file can be found.

    Then grab your masters and put them there. If that doesn't work, you may have larger issues.

    Don't forget to rename ALL of the TNSNames files on your system to something else (in the event you need one later) to include the one in your c:\temp directory.

    HTH

    CJ
     
  7. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Re: REP-0501: Unable to connect to the specified database ORA-12154: TNS: could not r

    Thanks CJ,

    What is master TNSfile AND the SQLNet file?

    Then grab your masters and put them there.... i didn't get this?
     
  8. ilhabibi

    ilhabibi Guest

    Re: REP-0501: Unable to connect to the specified database ORA-12154: TNS: could not r

    Dear jagadekara,

    master TNSfile and SQLNet file mean the file that oracle use to connect to database. Usualy you will find them at ORACLE_HOME/Network/Admin. You should find file that file (sqlnet.ora and tnsnames.ora). Make sure that file at correct oracle home location

    Regards,
    Ilhabibi
     
  9. DTSIGuy

    DTSIGuy Forum Advisor

    Messages:
    402
    Likes Received:
    58
    Trophy Points:
    410
    Location:
    Texas
    Re: REP-0501: Unable to connect to the specified database ORA-12154: TNS: could not r

    Actually...the master refers to the single TNSNames.ora and the SQLNet.ora file on a system that has multiple Oracle Homes. If you client systems that have an Oracle runtime client, and Discoverer, and the Oracle Developer suite for instance...you will find that you have 3 TNSNames files...minimum. That means you often have to ensure all 3 have the same connection info for the databases for all of your tools. But, if you use the TNS_ADMIN environment variable...then you can have just one...the master file...and you put that wherever the new variable is pointing. Voila! End of problem...for those that have that particular problem.

    CJ
     
  10. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Re: REP-0501: Unable to connect to the specified database ORA-12154: TNS: could not r

    Thanks All,

    My It guy uninstall devoloper suite and the download from oracle site and install 10g.
    Earlier it was 6i. We thought 6i will not support oracle apps r12.
    Eventhough new builder got same eerror.

    Then remove all entries from tns and used only current tns. Then it's working.

    Still I have doubt regarding Report Builder 6i will support for R12 or not?
     
  11. DTSIGuy

    DTSIGuy Forum Advisor

    Messages:
    402
    Likes Received:
    58
    Trophy Points:
    410
    Location:
    Texas
    Re: REP-0501: Unable to connect to the specified database ORA-12154: TNS: could not r

    It is my understanding you should be using Oracle Reports Builder 10g at a minimum. Have you checked the Cert Matrix?
     
  12. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Re: REP-0501: Unable to connect to the specified database ORA-12154: TNS: could not r

    No.

    I am not aware of Cert Matrix.
     
  13. DTSIGuy

    DTSIGuy Forum Advisor

    Messages:
    402
    Likes Received:
    58
    Trophy Points:
    410
    Location:
    Texas
    Re: REP-0501: Unable to connect to the specified database ORA-12154: TNS: could not r

    That would be the Certification Matrix for the R12 Product w/ respect to the supported O/S, Browsers and Development tools. It's accessible via Oracle's MOS site.
     
  14. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Re: REP-0501: Unable to connect to the specified database ORA-12154: TNS: could not r

    Ok. Thanks for the info...
     
  15. linlasj

    linlasj Active Member

    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    55
    Location:
    Linköping
    Re: REP-0501: Unable to connect to the specified database ORA-12154: TNS: could not r

    If you open a terminal window and do tnsping on the database. Is there an answer? If not, you are in TNSNAMES.ORA-trouble land...So put the TNSNAMES.ORA in every ORACLE_HOME/Network/Admin-directory there is to find.
     
  16. linlasj

    linlasj Active Member

    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    55
    Location:
    Linköping
    Re: REP-0501: Unable to connect to the specified database ORA-12154: TNS: could not r

    And even in the Reports Builder TNSNAMES.ORA-land. Somewhere in forms-tree maybe.
     
  17. DTSIGuy

    DTSIGuy Forum Advisor

    Messages:
    402
    Likes Received:
    58
    Trophy Points:
    410
    Location:
    Texas
    Re: REP-0501: Unable to connect to the specified database ORA-12154: TNS: could not r

    This is a bad idea...now you have multiple TNS files to maintain. It's far better to create the TNS_ADMIN environment variable and point it to a single location and put your file there.

    CJ