ORA-12154: TNS:could not resolve the connect identifier specified
I got this error in my development system when I am trying to connect a oracle 10g database via my WCF serivce developed in .NET 4.0 framework.
The wcf service was running in IIS 7.5 and using the DefautAppPool. My suspect was the oracle client installed in my system. I could see that, I had different instances of Oracle 11g client in my system. So, I thaught of identifying the active one.
Inorder to find that, I opened the command prompt and typed tnsping <oracle database name>. Now, I was able to see the active oracle instance in my system as shown below,
In my case, it is client_2. Apart from this, I had client_1 and client_4 installed in my system.
As a next step, I verified the registry and found that, different instances of oracle exists as shown below,
Now, I modified the ‘Oracle Home’ for all instances to point to the correct location (in my case, it is client_2). See below,
I then recycled the application pool.
Tried to connect the oracle database via code and it worked!