ORA-12154: TNS:could not resolve service name
The database you are trying to connect to, is not known by your Oracle client.
Typically, every Oracle Home installed on your pc wil have a subdirectory called network\admin or net80\admin (Oracle 8.0 client).
This subdirectory should contain a file sqlnet.ora which contains following line:
NAMES.DIRECTORY_PATH= (TNSNAMES, HOSTNAME)Possible other values are ONAMES, OID, ...
In case of Oracle Instant client or if someone has changed the default location where sqlnet.ora and tnsnames.ora resides, you will have to look for the alternative path which is identified by the TNS_ADMIN variable.
This can either be a registry variable (set on HKEY_LOCAL_MACHINE\software\oracle), an environment variable (see your .profile on Unix or choose Properties, Advanced, Environment Variables of My Computer on Windows) or stored in some batch script.
Default installations will use a TNSNAMES.ora file to resolve database names.
See if the tnsnames.ora file exists in your sub directory.
If it doesn't exist and NAMES.DIRECTORY_PATH only contains TNSNAMES (and optionally HOSTNAME), there will be no name resolving.
You will need to create a tnsnames.ora file which will contain all databases you want to connect to.
A typical entry looks like this:
ORA102.WORLD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID = databasename)
)
)
Replace hostname and databasename and possible the portnumber to reflect your Oracle databases.If you think both sqlnet.ora and tnsnames.ora are correct, you might be using multiple Oracle Homes.
Typically this is the case if you install Oracle Developer suite after you install a database on your pc.
With Oracle Locator Express you can easily switch between multiple Oracle Homes.
If you are using other resolving technologies such as Oracle names or Oracle Internet Directory, you can add the service to it (ONAMES, OID). Make sure the servers are accessible.
Also check for following value in sqlnet.ora:
NAMES.DEFAULT_DOMAIN = eu.dbmotive.comWhen this value is present in you sqlnet.ora file, it will automatically be appended to the entries in your tnsnames.ora file when searching for an entry.
In following example we are going to search for the example1 entry.
Our NAMES.DEFAULT_DOMAIN is set to eu.dbmotive.com, and following is the entry in tnsnames.ora:
EXAMPLE1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = EXAMPLE1)
)
)
Now, we are going to tnsping it:
C:\>tnsping example1 TNS-03505: Failed to resolve nameThe entry is not found, but it is in our tnsnames.ora
This is because the default domain .eu.dbmotive.com is appended to the tnsnames entries.
You have 2 options. Either add the .eu.dbmotive.com domain to the tnsnames entry, or add an extra dot (.) to the tnsping command:
C:\>tnsping example1.If you are using Oracle Easy Connect, for example within you php application, and your Oracle connection fails with this ORA-12154 error, you might need to change the value of NAMES.DIRECTORY_PATH in you sqlnet.ora file:
sqlplus system/password@//localhost:1521/DBM001 ERROR: ORA-12154: TNS:could not resolve the connect identifier specifiedvi sqlnet.ora
NAMES.DIRECTORY_PATH= (TNSNAMES)Add the entry for Oracle Easy Connect and retry.
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)Also pay attention to the TWO_TASK variable.
Welcome to our forum for Oracle error: ORA-12154 Add your own message
Driver's SQLSetConnectAttr failed State:IM006,Native:0,Origin:[Microsoft][ODBC Driver Manager]
ORA-12154: TNS:could not resolve service name State:08004,Native:12154,Origin:[Oracle][ODBC][Ora]
But using a simple program that i created using VC++ also, i can connect to the oracle.. i also tnsping.. so whats the problem?.. Can anyone help me to solve this problem?
Thanx!
and why the value is truncated?
can't u explain more about this..
this problem still occurred... i don't know what to do to solve this problem...
to upgrade this software from primavera 5 to primavera 5 service pack 3 we also require to
change the database schema or upgrade the database. while upgrading database i got the error
mentioned in the title. I checked out tnsname.ora file but it didnot work.
plz give me any solution to solve this problem.
ihave problem
1setuped orcale10g and devolper6i in my device
but the database not connection my form please ihope to your slove my problem
my form gived (( can not reslove server tns))
thank
You have to make sure the tnsnames entry is know to this Oracle home.
Search for all the tnsnames.ora in your Operating system and check if the service name is available to all the tnsnames.ora
ORA-12154: TNS:could not resolve service name
and
ORA-06413 with manager console
but sqlplus is ok on the connection with my db
There are a number of problems reported, like a different path for the "Programs Files" subdirectory.
What you can do is to enable client side sqlnet tracing in order to determine the error code returned by the SQLNET network stack.
Have a look at your sqlnet.ora to enable sqlnet client tracing
I guess I have the same problem. My client is uses SO VISTA, running a PowerBuilder application and the TNSNAMES.ORA and SQLNET.ORA are in a shared network disk (W:\oracle). I have the key TNS_ADMIN set to W:\oracle. When using sqlplus its ok, but Powerbuilder issues me 'ORA-12154: TNS:could not resolve service name'. Can someone help me?
sqlplus scott/tiger@orcl (my service name).However it is connecting fine from sqldevelper using both basic & tnsname login.It is successfully connecting from oracle 9i net configuration assistant
and net manager.
This is my tnsnames.ora entry:
DB.SKYTECHSOLUTIONS.INTRA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.20.1.100)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
If the latter, what is the value of SQLNET.DEFAULT_DOMAIN in your sqlnet.ora file?
I have installed the Oracle 9i Enterprise Edition in windows 2003 server PC(192.168.0.1)and its working. Then I have installed Developer 2000 in another client machine(192.168.0.3). NOw I want to connect databse from the client. For this I have changed the tnsnames.ora file in client as follows.
file.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = TCP)
(Host = 192.168.0.1)
(Port = 1521)
)
)
(CONNECT_DATA = (SID = ORCL)
)
and saved . However I am unable to connect with database. I need help to solve this problem Desperately waiting for solution.
You are probably changing the tnsnames.ora in the Oracle home of your database software.
Either change the tnsnames.ora in your developer home, or change the default home using our free tool "Oracle Locator Express"
Can you please give me the steps to install Oracle client 9i2 on window 2003. I', following otn doc http://www.oracle.com/technology/software/products/oracle9i/index.html, but I guess it is not working .
I will greatly appreciate your help
Thanks much
Puja
thx and regards.
luis salgado
mexico
Please help me for resolving this issue....
You have to contact your local helpdesk or Oracle team in order to obtain this information
I think my TNSNAMES.ora file is a correct one. Any suggession regarding this ?
after possible ways to resolve this by restarting d db manually i also ran into this problem ORA-27102 OUT OF memory. i increase the large pool portion of the SGA and d PGA. check the server mode which was on shared mode with 5 user maximum connection.checked d RAM %used which was about 4gb for the whole server including d OS. though some other users are configured n dedicated mode
pls how can i put an end to manually restating the database every 4-6 times daily.
and hw do i solve the memory issues.
solutions to these problems will highly be appreciated
the is really frustrating.
I run oracle database 10gr1 on 2003server, could it be an OS compatibility issues?
We had installed the CLIENT several times in Win XP Prof & Win 2003 Server with no problem.
This is teh first time we try it with Vista and we have the above error.
I cannot even make TEST CONNECTION over ODBC Data Source Administrator.
Does anybody tried a similar thing this before?
Thanks in advance...
thanx
error number 4
DMS-E-CONNECTION REJECT ,a connection has been rejected by remote interface during operation 'attach database'.
I'm trying to connect locally by using the command:
sqlplus system/my_password@dbmain
but I'm getting the ORA-12154 error.
I have a network interface which address is statically set to 192.168.1.10.
The content of my TNSNAMES.ora if as follows:
INST1_HTTP =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.10)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = SHARED)
(SERVICE_NAME = MODOSE)
(PRESENTATION = http://HRService)
)
)
DBMAIN =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.10)(PORT = 1521))
)
(CONNECT_DATA =
(SID = dbmain)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
The sqlnet.ora is as follows:
TRACE_DIRECTORY_CLIENT = D:\Logs
LOG_FILE_CLIENT = Logfile.log
SQLNET.AUTHENTICATION_SERVICES= (None)
LOG_DIRECTORY_CLIENT = D:\Logs
TRACE_FILE_CLIENT = TraceFile.log
TRACE_LEVEL_CLIENT = ADMIN
LOG_DIRECTORY_SERVER = D:\Logs
#SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (HOSTNAME, TNSNAMES, ONAMES)
and the listener.ora:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.10)(PORT = 1521))
)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D:\oracle\ora92)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = dbmain.aimsoft)
(ORACLE_HOME = D:\oracle\ora92)
(SID_NAME = dbmain)
)
)
Please tell me what I'm doing wrong there...
Kindly get back to us as soon as possible regarding this issue.
Microsoft OLE DB Provider for Oracle error '80004005'
ORA-12154: TNS:could not resolve service name
however it works fine at other times. not sure whats causing the problem and why its happening.
Use Oracle locator express to switch to you database home if necessary
Hi,
I was login as sys user in oracle9i and create a ordnery new user, Then shutdown the database and going to sql+ promt, and try to login created user name and password,connection not esstablished. It shows TNS: protocol adepter error, then I was try to login as scott user agian it throws same error. so I was think, My database services not start,then I had restart my database, again shows same error.
plz give solution for my problem. I as waiting for ur reply. Try to reply me soon..
Regards,
K.saravanakumar.
i am using oracle 9i r1 on windows server 2003 r2 x64. i get error ora-12154 could not resolve service name...
Any solution plz.
thx
jah
Make sure the Oracle client is not installed in a directory containing ().
By default on 64-bit, it is installed in c:\program files (X86)
The round brackets can not be handled by the Oracle client, and it will result in the ORA-12154 error.
Either use the latest Oracle client (11.2) or install in a different directory.
There is no patch for your version, if you are on 9i r2 you can download Patch 4928723 (9.2.0.7.0 Patch 6)
You can check Oracle Support note 334528.1: "ORA-12154 or ORA-6413 Running 32-bit Oracle Software on 64-bit Windows OS" for more information
Hello
I'm using Oracle 11g client on windows 7 64 bit (Oracle 9i client is not working on this OS).
The server is still Oracle 9i DB.
The win application I'm developing is unable to connect to the DB and indeed when I try to perform tnsping I recieve the error: TNS-03505 Failed to resolve name (However I can connect to the DB on the server using the SQL Developer).
This is my sqlnet.ora:
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
This is my tnsnames.ora:
OPER =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 14.1.0.89)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = DB2OD)
)
)
Does anybody knows what should I do in order to enable connecting to DB on the server, Is it possible at all to connect from oracle 11g client to an Oracle 9i server?
Do you have an environment variable TNS_ADMIN set which point to a different location?
Are you able to tnsping oper. ? So with an extra dot at the end?
Hi
I don't have an environment variable TNS_ADMIN (I searched the registery without any results, if it could be somewhere else let me know).
However, when I reached the folder where the tnsnames.ora file actually exists (C:\app\Administrator\product\11.2.0\client_1\network\admin in my case which I assume is the default) the TNSPING did work.
Despite that my application still could not connect to the DB giving me the following error:
ora-12154 tns could not resolve the connect identifier specified.
I must make it clear that from an XP OS with Oracle 9i client installed the application did connect to the DB without any problems so the problem is probably not in the application itself.
Any ideas?
You can also define TNS_ADMIN as an (SYSTEM) environment variable. If tnsping does work when you are in the correct folder, but not when you are somewhere else, it might indicate that it is set. Did you check if you find more than 1 sqlnet.ora or tnsnames.ora on your filesystem? Also, is your application running under the same privileges as the dos box where you do the tnsping?
Press Windows-key + Break (Which opens System Properties), goto Advanced tab page and click environment variables (Check both User and System variables).
Thanks for your reply, it helped me find what the problem was: when I searched for other sqlnet.ora or tnsnames.ora files in my system I found out that the tnsnames.ora existed only in the administrator user (The Oracle 11g client was firstly installed by our sysadmin in the administrator user) and didn't exist for my user, after I copied the file to my user the TNSPING worked properly from all the folders and my application was able to connect to DB without any problems.
i have oracle 0i in my system.during installing oracle 9i i have cancelled the net configuration setup.Now i cannot connect to oracle through scott.
Please send me the solution and also see to it that the solution should provide the requirement of .ora files in my system.
You need to start network configuration assistance and create the appropriate listener.
Iam using 10g db in AIX. My application is OFSA.
We recently change IPaddress in the AIX server from 10.20.3.1 network to 10.20.5.10.
So we try to change the ipadd in the tns,sqlnet,listner files in the server itself. But all the files hold host as Name rather than ip address. So there is no need to key in the files.
But i have changed the required files in the client from the old ipaddress to new ipaddress. Now i am able to login to OFSA modules. But i am not able to run any process which throws internal error. I have a lookup of all log files which shows error ORA:12154
pls help us to resolve the situation.
thanks
robin
Did you restart the listener and database after you have changed the ip address?
MOMcnn.Open "Provider=oraOLEDB.Oracle;Data Source=isshp01_work5;User Id=AMIUSER;Password=PASSWORD;"
Hi,
I am having two applications one is using 9iclient and another is using 10g express edition if 10g is installed 10g is working not 9i i want both the applications to work.
Plzzzzzzzzzzz help me
Thebest option would be to set the TNS_ADMIN variable and point to the correct tnsnames.ora file
Hello!
I would like some help.
I use an ODBC connection for an oracle 10 DB.
When I do a test connection with ODBC manager, the connection is successful.
I use a software whitch use this same DB and a ODCB manager connection (intergrate at this soft) but in this soft the test connection result is "[ODBC Driver Manager] Only SQL_DRIVER_NOPROMPT is allowed when connection pooling is enabled".
Do you have some idea?
thanks a lot for your help.
PS: i have done a TNSPING and the result is :
TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 03-SEP-2010 14:12:26
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
D:\oracle\product\10.2.0\client_1\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = srv21dtc.dtc.actaris.com)(PORT = 1521))) (
CONNECT_DATA = (SERVICE_NAME = TEAMSBM)))
OK (50 msec)
This is a known issue (i.e. a bug) in some drivers, you will need to upgrade the Oracle client (to 10.2.0.4 or 11g)
I can't the oracle client is integarte at the software.
I have not an acces at the source
I have found the problem, my oracle server is in 64 bit an my client is in 32 bit.
So for working correctly the both will be in 32 bit
Thanks for ypour help ! :)
Add your message
If you need more information about this particular error message, you can leave a forum message.
We are replying to this message whenever we have some spare time, so please do not consider this as a private 'solve my critical issue asap' service.
Should you need professional Oracle Assistance to make your project a success, please have a look at our consultancy services.
In order to prevent automatic generation of messages, we are asking for a validation code. This code is unique and is generated every time a new message is asked.
If you do not enter the validation correctly, your message will not be recorded.
