Pages

Thursday, June 21, 2012

ORA- 12154: TNS:could not resolve service name in Oracle Formbuilder or Report builder


Hi Oracle fellas,

                            You will get above problem when you are using oracle form builder or report builder. This can happen because of various kinds of reasons. It can happen because of the error of the TNS name you are trying to connect. May be the port numbers can be wrong or something like that. You cannot connect through form builder means that form builder cannot see or find your TNSNAMES.ora file. Form builder uses the TNSNAMES.ora file and SQLNET.ora file found under the iDS suite folder - under this folder the NETWORK - ADMIN folder. Sometimes there can be syntax errors like unrelated parentheses in your TNS name. Including these kind of error makes TNS file unusable.

To overcome this problem always maintain your TNSNAMES.ora file without any errors. Keep your .ora files in proper directory.

If you are using directory naming, 
Verify that "LDAP" is listed as one of the values of the NAMES.DIRECTORY_PATH parameter in the oracle net profile(SQLNET.ora).
Verify that the LDAP directory server is up and that it is accessible.
Verify that the net service name or database name used  as the connect identifier is configured in the directory.
Verify that the default context being used is correct by specifying a fully qualified net service name or a full LDAP Dn as the connect identifier.

If you are using easy connect naming,
Verify that "EZconnect" is listed as one of the values of the NAMES.DIRECTORY_PATH parameter in the oracle net profile(SQLNET.ora).
Make sure the host,port and service name specified are correct.
Try enclosing the connect identifier in quote marks.

Sometimes this happen when your are using particular oracle version in the first time. Reason for this kind of scenario is the problem with SQLNET.ora file. You can see few lines of statements in that .ora file. In the very first moment only first two lines were commented. Therefore you wont be able to connect to needed database via form builder or report builder. Only you have to do is comment all the lines in that file and try to connect to the database you want.

There may be different oracle products installed in your computer. Each of these products contains it's own NETWORK/ADMIN directory which is the location of .ora files. Therefore we can maintain only one TNSNAMES file for all the products in your computer. TNS_ADMIN environmental variable will allow you to do that. Take any of the TNSNAMES.ora file and put it in to a directory (like "D:\0_library") which is easily accessible and let the TNS_ADMIN environment variable point to its directory. Then do as follows,

c:\ temp>set tns_admin 
tns_admin = D:\0_library
c:\ temp

Simply log in to your database.....:)

No comments:

Post a Comment