Search code examples
oracleoracleformstnsnames

Oracle forms: TNS: could not resolve the connect identifier specified


I have oracle Enterprise edition and oracle forms installed on my computer, when i connect to my database from sqlplus and sqldevelopper, it connects without errors, but when i try to connect from oracle forms, it gives me this error:

ORA-12154:could not resolve the connect identifier specified

I have looked online and i read somewhere that it might be because i have more than one oracle client installed on my computer, and the sqlplus uses the right file and oracle forms uses the one that is not right, and i think that is my case, because i have two of the tnsnames.ora file : in here:

C:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\tnsnames.ora

and in here:

C:\oracle\product\10.2.0\NETWORK\ADMIN\SAMPLE

here is the content of the first tnsnames.ora file:

# tnsnames.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = BOUHDID.Home)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ORCL)
    )
  )

EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )

if it's the case, how can i fix this?


Solution

  • I solved my problem by doing these steps:

    1. uninstalled Oracle froms and reports.
    2. uninstalled Oracle dababase with universal installer.
    3. Deleted all the registries and services associated with oracle.
    4. Reinstalled Oracle database.
    5. Reinstalled oracle forms & reports.
    6. copied from my tnsnames.ora file located in

    C:\oracle\product\10.2.0\db_1\NETWORK\ADMIN to the tnsnames.ora file located in C:\orant\NET80\ADMIN this part:

    ORCL =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = BOUHDID)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = orcl)
        )
      )
    

    and it worked like a charm.