Error Ora 12154

I recently hosted a single web application on one of my development servers. I am using oracle, asp.net and c #. When I run the application on the server, everything works fine, but when I try to run the application outside the server (for example, using my computer), I get this error:

ORA-12154: TNS:could not resolve the connect identifier specified

If I run the application on my computer with visual studio, it works fine.

Oracle is installed on server "A", and the application is located on server "B". Server "A" is in one domain, and server "B" is in another domain. My computer is in the same domain with server "A".

On my computer I can find the tnsname.ora file in C: \ oracle \ product \ 10.2.0 \ client_1 \ NETWORK \ ADMIN, but on server "B" I can not find it anywhere

any idea? Thanks for the help.

+3
source share
9 answers

Guess: Oracle client is not installed on server B.

If you have the oracle client installed, you can still put the tnsnames file anywhere (for example, a directory on a network share). To do this, set the TNS_ADMIN system variable (System Properties-> Advanced-> Environment Variables on XP) to the directory containing your tnsnames files.

For me, for example, I have a system variable: TNS_ADMIN - C: \ oracle \ ora92 \ network \ ADMIN

0
source

Have you tried it yet? (from http://ora-12154.ora-code.com/ )

ORA-12154: TNS: ,
. , . , , - .
: - ( TNSNAMES.ORA):

  • , "TNSNAMES" NAMES.DIRECTORY_PATH Oracle Net (SQLNET.ORA)

  • , TNSNAMES.ORA .

  • , TNSNAMES.ORA , .

  • , TNSNAMES.ORA . . TNSNAMES.ORA .

  • :

  • , "LDAP" NAMES.DIRETORY_PATH Oracle Net (SQLNET.ORA).

  • , LDAP .

  • , , , .

  • , , LDAP DN

  • :

  • , "EZCONNECT" NAMES.DIRETORY_PATH Oracle Net (SQLNET.ORA).

  • , , .

  • . . Oracle Net Services Oracle.

+3

TNS . , .

(, visual studio) TNS TNSNAMES.ora. , , TNSNAMES.ora, . , B.

oracle ( ), tnsping, , TNSNAMES.ora.

TNSNAMES.ora / . , "ODB_A" "ODB_A.WORLD" , SQLNET. Oracle 10 SQLNET . ping, "", , "SERVERA" "SERVERA.DOMIN.COM" IP-.

+3

ORACLE_HOME B?

0

, Oracle Client " B" ( ) TNSNAMES.ORA. , , , (, web.config ). - Oracle () Oracle Client.

0

. , TNSNAMES.ORA ADDRESS_NAME SID/SERVICE_NAME, SID, .

ADDRESS_NAME, SID

0

-

, TNSNAMES.ORA .

, TNSNAMES.ORA .

, .

, - DNS.

PL SQL- client.try SQL Program Files (x86)

0

:

Variable Name: TNS_ADMIN

Variable Value: (YourDrive):\app\(UserName)\product\11.2.0\dbhome_1\NETWORK\ADMIN
0

. , , tns tnsnames.ora.

con = new OracleConnection();
con.ConnectionString = "User Id=username;Password=password;Data Source=uit45";
con.Open(); // throws error here

. tns tns- , . .

con = new OracleConnection("Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=db-uit45.xxx)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SID=uit45)));User Id=username;Password=password");
con.Open();

Please note that you need to specify appropriate values, especially for HOST,PORT,SID,User Idand Password.

0
source

Source: https://habr.com/ru/post/1697819/


All Articles