Search This Blog

Sunday, July 3, 2011

Connecting Oracle 10g Developers Suite Forms to Oracle 10G Express

Hi, today I was trying to do a hands-on on Oracle Forms builder. I found a very nice tutorial at 

You can download the Oracle 10g Developers Suite for Free at the Oracle Site (http://www.oracle.com/technetwork/developer-tools/developer-suite/downloads/index.html) and also Oracle 10g Express at http://www.oracle.com/technetwork/database/express-edition/downloads/index.html . The installations are pretty straight forward and its not where you will see a road block, but its when you try to connect from Form's Developer or SQL plus to the Express Instance you will have some weird issues if unknowingly your machine has some old versions of Oracle tnsnames.ora apart from the places where you have installed the new express editions and believe me its a real pain in the butt.

So you will get an error like "ORA-12154 TNS:Could not resolve the connect identifier specified" and here the things that you need to check first

1. Do a global search on your local machine for the file names "tnsnames.ora" and if you see multiple occurrences, you can be sure that is the problem. In my case, I was sure that I will not need the other tnasnames.ora files apart from the one in the location of the 10g express so I simply renamed those tnsnames.ora files to tnsnames.ora1 and sqlnet.ora (if there was one in those locations) to sqlnet.ora1.

2. In the drive where you have installed your express database ( In my case its D:\oraclexe\app\oracle\product\10.2.0\server\NETWORK\ADMIN ), you will find that by default your tnsnames.ora will have an entry like below

XE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = CHIRES35510)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)
    )
  )

Now, please change the SERVICE_NAME = XE to SID = XE like below

XE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = CHIRES35510)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SID = XE)
    )
  )
** In the first case for people who need to keep their old tnsnames.ora, please create an environment variable "TNS_ADMIN" and in my case it points to "D:\oraclexe\app\oracle\product\10.2.0\server\NETWORK\ADMIN".

Once done, please save and restart the following 2 services on windows.
1.OracleServiceXE
2.OracleXETNSListener

PS: This blog helped me as it had similar problems discussed and I consolidated it for future references
http://dbaspot.com/oracle-server/71759-tns-listener-could-not-resolve-service_name-given-connect-descriptor-3.html

No comments:

Post a Comment