Thursday, September 2, 2010

TNS-03505: Failed to resolve name

I've been trying to build an image of OBIEE 11g recently, with not much success.

The process is as follows:
1. Fire up big-ass (to me anyway) Windows 2003/8 Server on Amazon.
2. Go through all the security hassle of Internet Explorer to download the software (I've since put it on it's own volume, and then attach that to my instance, so I don't have to do this 300 times)
3. Install 11gR2 database, software only.
4. DBCA to build database.
5. Net Manager to build the listener.
6. Create the weblogic metadata for OBIEE.
7. Install OBIEE.
8. Scream and yell when the configuration doesn't work.

Rinse and repeat 12 times.

I've gotten quite good at it.

Then I ran into this lovely error...
TNS-03505: Failed to resolve name
Cause: The service name you provided could not be found in TNSNAMES.ORA, an Oracle Names server, or a native naming service.
Action: Verify that you entered the service name correctly. You may need to ensure that the name was entered correctly into the network configuration.

I went through Net Manager and Net Configuration Manager about 1000 times. You know, instead of actually reading the error.

I thought I needed a Loopback Adapter. I didn't.

I started to go through the files by hand, sqlnet.ora, listener.ora, tnsnames.ora (which I'm much more confident with surprisingly)...it had to be something small.
# tnsnames.ora Network Configuration File:
c:\oracle\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = TESTING)
(SID = TESTING)
)
)

LISTENER=(Address=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))
I name all my sandbox databases "testing." Always have, probably always will. From the command line I issue:
SQLPLUS SYS/TESTING@TESTING AS SYSDBA
(Yes, I know I don't need to specify the user/password@service_name).

Spot it yet?

Could it be that my alias says: ORACLR_CONNECTION_DATA?

Yup, foiled again. ID10T in the house.

4 comments:

  1. Hi

    tnsping -?
    it shows the sqlnet.ora file

    sqlnet.ora should be :
    #--------------------------
    SQLNET.AUTHENTICATION_SERVICES= (NTS)
    NAMES.DIRECTORY_PATH= (TNSNAMES)
    #---------------------------
    ...
    after test your tns:
    tnsping ORACLR_CONNECTION_DATA

    ... have a look on TNS_ADMIN variable
    If TNS_ADMIN set that this would be the tnsnames.ora location.


    Regards
    Gergo

    ReplyDelete
  2. Gergo,

    I tried that one (a bunch) too. Problem was, I was using tnsping testing not tnsping ORACLR_CONNECTION_DATA

    Amusingly, "testing" worked, I'm sure there's a good reason for that (I think I had a "testing" service name defined).

    chet

    ReplyDelete
  3. Great addition. I had those kind of questions so many times I "even" wrote a blog post about it.

    The following might help

    Small introduction to SQL*Net debugging [client side]

    Grz

    Marco

    ReplyDelete
  4. Hi, With OBIEE11g you should put another tnsnames.ora file to Oracle BI Home under {Oracle_BI1}\network\admin directory.

    ReplyDelete