Oracle home key ошибка


First published on MSDN on Jun 30, 2010

This is one of the most common errors while creating linked server to Oracle database. Today I will discuss the reason for this error and possible resolutions.

Full error message:


OLE DB provider «MSDAORA» for linked server «LINKED_ORA» returned message «ORA-12154: TNS:could not resolve the connect identifier specified».


Msg 7303, Level 16, State 1, Line 1


Cannot initialize the data source object of OLE DB provider «MSDAORA» for linked server «LINKED_ORA».

First of all make sure you have reviewed the following Microsoft KB article that has a lot of good information on troubleshooting Oracle linked server issues.

How to set up and troubleshoot a linked server to an Oracle database in SQL Server

http://support.microsoft.com/kb/280106

Also make sure you have installed Oracle Client on the SQL server. If the SQL server is 64 bit then we need to install 64 bit Oracle provider. You can also create linked server using Oracle ODBC driver together with Microsoft OLE DB provider for ODBC. Once again on a 64 bit SQL server you need to install the

64-Bit OLEDB Provider for ODBC (MSDASQL)

and 64 bit Oracle ODBC drivers. However 64-Bit OLEDB Provider for ODBC (MSDASQL) is already there in Windows Vista/Windows Server 2008 and later OS.

This particular error message is a very general error message and can happen for quite a number of reasons. For general understanding of the error, you can review oracle documentation like this

http://ora-12154.ora-code.com/

In SQL Server Linked Server, it could indicate a few things (not limited to)–

1.       SQL Server (and oracle net libraries) is not able to get the TNS alias from tnsnames.ora file.

2.       Something is wrong with the way the alias is created in the tnsnames.ora file (incorrect syntax)

3.       TNS alias could not be resolved into a connect descriptor

Below is a list of things that you can try to resolve this issue.

1. Verify that the tnsnames.ora file has the alias and the service name that the customer is using.

TNS entry for the Oracle database

===========================

OracleDB_Dev =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = server01.mydomain.com)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = OracleDB)

(SERVER = DEDICATED)

)

)

In the above tnsnames.ora file Alias = OracleDB_Dev

Service Name: OracleDB (Actual Oracle service name [instance name in SQL])

2.  Check the sqlnet.ora file under ‘Admin’ folder in Oracle home [Dir:\app\product\11.1.0\client_1\network\admin] and ensure that we have TNSNames in NAMES.DIRECTORY_PATH

NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)

3. Verify if you can connect to Oracle from the SQL server machine using tools installed with Oracle Client [For example «SQL Developer» or “SQL Plus”] with the same user id/password or TNS alias.

5. Check if the environment variable ‘PATH’ has the path for tnsnames.ora file specified.

Sample Value of Environment Variable PATH:


E:\app\product\11.1.0\client_1\bin

;C:\Program Files\Business Objects\Common\3.5\bin\NOTES\;C:\Program Files\Business Objects\Common\3.5\bin\NOTES\DATA\;%Systemroot%\Microsoft.NET\Framework\v1.1.4322;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Dell\SysMgt\oma\bin;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\ADMIN\1033\;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL Server\90\DTS\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\;C:\Program Files\Microsoft Network Monitor 3\


Note: make sure that the path is a valid path and there is no space.

6. Check the value of the key  ”Oracle_Home” in the registry under  HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraClient11g_home1  and verify that it has the right path for the Oracle home.

7.  Check for the registry key “TNS_ADMIN” at HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE. If it exists then make sure it has the right value as “Dir:\app\product\11.1.0\client_1\network\admin”. If you don’t see the key then create the key and set appropriate value as below.

Regedit->HKEY_LOCAL_MACHINE->Software->Oracle->RightClick NEW->StringValue and name

it TNS_ADMIN and give the value  “X:\app\product\11.1.0\client_1\network\admin”


Note: This is not a must but in some cases this is what fixed the issue.

8.   Check if SQL server start up account has permission to the Oracle Home. Also collect Process monitor log and check for “access denied”.  Process monitor log should show if we are able to find the tnsnames.ora file.

9. Make sure you don’t have multiple Oracle homes or multiple Oracle clients installed. Check the «HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ALL_HOMES\HOME_COUNTER» key value.

10. Check if Oracle OLE DB provider is running InProcess. If ‘yes’ then try to run out-of- process and see if that resolves the issue.

Note: You can check and verify if MS OLE DB Provider for Oracle is running InProcess from the registry key at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Providers\MSDAORA

11. You can try collecting simultaneous Network trace from both SQL and Oracle servers and check if there are any communications between the two servers.

12. Try to connect to Oracle from the SQL server using the UDL.  Use the same TNS name. If you get the same error that means the issue is not specific to SSMS or linked server.

Creating and Configuring Universal Data Link (.udl) Files

http://msdn.microsoft.com/en-us/library/e38h511e(VS.71).aspx

13.  Try to specify all the information in the data source instead of using the TNS alias to connect to the Oracle database (this is a way to bypass tnsnames.ora file when connecting to Oracle).

Sample Data Source:

Data Source=(DESCRIPTION=(CID=GTU_APP)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST= server01.mydomain.com)(PORT=1521)))(CONNECT_DATA=(SID=OracleDB)(SERVER=DEDICATED)));

Author : Mohammad(MSFT) SQL Developer Engineer, Microsoft

Reviewed by : Azim(MSFT), SQL Developer Technical Lead , Microsoft

This is an old question but Oracle’s latest installers are no improvement, so I recently found myself back in this swamp, thrashing around for several days …

My scenario was SQL Server 2016 RTM. 32-bit Oracle 12c Open Client + ODAC was eventually working fine for Visual Studio Report Designer and Integration Services designer, and also SSIS packages run through SQL Server Agent (with 32-bit option). 64-bit was working fine for Report Portal when defining and Testing an Data Source, but running the reports always gave the dreaded «ORA-12154» error.

My final solution was to switch to an EZCONNECT connection string — this avoids the TNSNAMES mess altogether. Here’s a link to a detailed description, but it’s basically just: host:port/sid

http://www.oracledistilled.com/oracle-database/oracle-net/using-easy-connect-ezconnect-naming-method-to-connect-to-oracle-databases/

In case it helps anyone in the future (or I get stuck on this again), here are my Oracle install steps (the full horror):

Install Oracle drivers: Oracle Client 12c (32-bit) plus ODAC.

a. Download and unzip the following files from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/database12c-win64-download-2297732.html and http://www.oracle.com/technetwork/database/windows/downloads/utilsoft-087491.html ):

i. winnt_12102_client32.zip

ii. ODAC112040Xcopy_32bit.zip

b. Run winnt_12102_client32\client32\setup.exe. For the Installation Type, choose Admin. For the installation location enter C:\Oracle\Oracle12. Accept other defaults.

c. Start a Command Prompt “As Administrator” and change directory (cd) to your ODAC112040Xcopy_32bit folder.

d. Enter the command: install.bat all C:\Oracle\Oracle12 odac

e. Copy the tnsnames.ora file from another machine to these folders: *

i. C:\Oracle\Oracle12\network\admin *

ii. C:\Oracle\Oracle12\product\12.1.0\client_1\network\admin *

Install Oracle Client 12c (x64) plus ODAC

a. Download and unzip the following files from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/database12c-win64-download-2297732.html and http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html ):

i. winx64_12102_client.zip

ii. ODAC121024Xcopy_x64.zip

b. Run winx64_12102_client\client\setup.exe. For the Installation Type, choose Admin. For the installation location enter C:\Oracle\Oracle12_x64. Accept other defaults.

c. Start a Command Prompt “As Administrator” and change directory (cd) to the C:\Software\Oracle Client\ODAC121024Xcopy_x64 folder.

d. Enter the command: install.bat all C:\Oracle\Oracle12_x64 odac

e. Copy the tnsnames.ora file from another machine to these folders: *

i. C:\Oracle\Oracle12_x64\network\admin *

ii. C:\Oracle\Oracle12_x64\product\12.1.0\client_1\network\admin *

* If you are going with the EZCONNECT method, then these steps are not required.

The ODAC installs are tricky and obscure — thanks to Dan English who gave me the method (detailed above) for that.

This is an old question but Oracle’s latest installers are no improvement, so I recently found myself back in this swamp, thrashing around for several days …

My scenario was SQL Server 2016 RTM. 32-bit Oracle 12c Open Client + ODAC was eventually working fine for Visual Studio Report Designer and Integration Services designer, and also SSIS packages run through SQL Server Agent (with 32-bit option). 64-bit was working fine for Report Portal when defining and Testing an Data Source, but running the reports always gave the dreaded «ORA-12154» error.

My final solution was to switch to an EZCONNECT connection string — this avoids the TNSNAMES mess altogether. Here’s a link to a detailed description, but it’s basically just: host:port/sid

http://www.oracledistilled.com/oracle-database/oracle-net/using-easy-connect-ezconnect-naming-method-to-connect-to-oracle-databases/

In case it helps anyone in the future (or I get stuck on this again), here are my Oracle install steps (the full horror):

Install Oracle drivers: Oracle Client 12c (32-bit) plus ODAC.

a. Download and unzip the following files from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/database12c-win64-download-2297732.html and http://www.oracle.com/technetwork/database/windows/downloads/utilsoft-087491.html ):

i. winnt_12102_client32.zip

ii. ODAC112040Xcopy_32bit.zip

b. Run winnt_12102_client32client32setup.exe. For the Installation Type, choose Admin. For the installation location enter C:OracleOracle12. Accept other defaults.

c. Start a Command Prompt “As Administrator” and change directory (cd) to your ODAC112040Xcopy_32bit folder.

d. Enter the command: install.bat all C:OracleOracle12 odac

e. Copy the tnsnames.ora file from another machine to these folders: *

i. C:OracleOracle12networkadmin *

ii. C:OracleOracle12product12.1.0client_1networkadmin *

Install Oracle Client 12c (x64) plus ODAC

a. Download and unzip the following files from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/database12c-win64-download-2297732.html and http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html ):

i. winx64_12102_client.zip

ii. ODAC121024Xcopy_x64.zip

b. Run winx64_12102_clientclientsetup.exe. For the Installation Type, choose Admin. For the installation location enter C:OracleOracle12_x64. Accept other defaults.

c. Start a Command Prompt “As Administrator” and change directory (cd) to the C:SoftwareOracle ClientODAC121024Xcopy_x64 folder.

d. Enter the command: install.bat all C:OracleOracle12_x64 odac

e. Copy the tnsnames.ora file from another machine to these folders: *

i. C:OracleOracle12_x64networkadmin *

ii. C:OracleOracle12_x64product12.1.0client_1networkadmin *

* If you are going with the EZCONNECT method, then these steps are not required.

The ODAC installs are tricky and obscure — thanks to Dan English who gave me the method (detailed above) for that.


First published on MSDN on Jun 30, 2010

This is one of the most common errors while creating linked server to Oracle database. Today I will discuss the reason for this error and possible resolutions.

Full error message:


OLE DB provider «MSDAORA» for linked server «LINKED_ORA» returned message «ORA-12154: TNS:could not resolve the connect identifier specified».


Msg 7303, Level 16, State 1, Line 1


Cannot initialize the data source object of OLE DB provider «MSDAORA» for linked server «LINKED_ORA».

First of all make sure you have reviewed the following Microsoft KB article that has a lot of good information on troubleshooting Oracle linked server issues.

How to set up and troubleshoot a linked server to an Oracle database in SQL Server

http://support.microsoft.com/kb/280106

Also make sure you have installed Oracle Client on the SQL server. If the SQL server is 64 bit then we need to install 64 bit Oracle provider. You can also create linked server using Oracle ODBC driver together with Microsoft OLE DB provider for ODBC. Once again on a 64 bit SQL server you need to install the

64-Bit OLEDB Provider for ODBC (MSDASQL)

and 64 bit Oracle ODBC drivers. However 64-Bit OLEDB Provider for ODBC (MSDASQL) is already there in Windows Vista/Windows Server 2008 and later OS.

This particular error message is a very general error message and can happen for quite a number of reasons. For general understanding of the error, you can review oracle documentation like this

http://ora-12154.ora-code.com/

In SQL Server Linked Server, it could indicate a few things (not limited to)–

1.       SQL Server (and oracle net libraries) is not able to get the TNS alias from tnsnames.ora file.

2.       Something is wrong with the way the alias is created in the tnsnames.ora file (incorrect syntax)

3.       TNS alias could not be resolved into a connect descriptor

Below is a list of things that you can try to resolve this issue.

1. Verify that the tnsnames.ora file has the alias and the service name that the customer is using.

TNS entry for the Oracle database

===========================

OracleDB_Dev =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = server01.mydomain.com)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = OracleDB)

(SERVER = DEDICATED)

)

)

In the above tnsnames.ora file Alias = OracleDB_Dev

Service Name: OracleDB (Actual Oracle service name [instance name in SQL])

2.  Check the sqlnet.ora file under ‘Admin’ folder in Oracle home [Dir:appproduct11.1.0client_1networkadmin] and ensure that we have TNSNames in NAMES.DIRECTORY_PATH

NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)

3. Verify if you can connect to Oracle from the SQL server machine using tools installed with Oracle Client [For example «SQL Developer» or “SQL Plus”] with the same user id/password or TNS alias.

5. Check if the environment variable ‘PATH’ has the path for tnsnames.ora file specified.

Sample Value of Environment Variable PATH:


E:appproduct11.1.0client_1bin

;C:Program FilesBusiness ObjectsCommon3.5binNOTES;C:Program FilesBusiness ObjectsCommon3.5binNOTESDATA;%Systemroot%Microsoft.NETFrameworkv1.1.4322;%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;C:Program FilesDellSysMgtomabin;C:Program FilesMicrosoft SQL Server80ToolsBINN;C:Program FilesCommon FilesMicrosoft Sharedweb server extensions60TEMPLATEADMIN1033;C:Program FilesMicrosoft SQL Server80ToolsBinn;C:Program FilesMicrosoft SQL Server90DTSBinn;C:Program FilesMicrosoft SQL Server90Toolsbinn;C:Program FilesMicrosoft SQL Server90ToolsBinnVSShellCommon7IDE;C:Program FilesMicrosoft Visual Studio 8Common7IDEPrivateAssemblies;C:Program FilesMicrosoft Network Monitor 3


Note: make sure that the path is a valid path and there is no space.

6. Check the value of the key  ”Oracle_Home” in the registry under  HKEY_LOCAL_MACHINESOFTWAREORACLEKEY_OraClient11g_home1  and verify that it has the right path for the Oracle home.

7.  Check for the registry key “TNS_ADMIN” at HKEY_LOCAL_MACHINESOFTWAREORACLE. If it exists then make sure it has the right value as “Dir:appproduct11.1.0client_1networkadmin”. If you don’t see the key then create the key and set appropriate value as below.

Regedit->HKEY_LOCAL_MACHINE->Software->Oracle->RightClick NEW->StringValue and name

it TNS_ADMIN and give the value  “X:appproduct11.1.0client_1networkadmin”


Note: This is not a must but in some cases this is what fixed the issue.

8.   Check if SQL server start up account has permission to the Oracle Home. Also collect Process monitor log and check for “access denied”.  Process monitor log should show if we are able to find the tnsnames.ora file.

9. Make sure you don’t have multiple Oracle homes or multiple Oracle clients installed. Check the «HKEY_LOCAL_MACHINESOFTWAREORACLEALL_HOMESHOME_COUNTER» key value.

10. Check if Oracle OLE DB provider is running InProcess. If ‘yes’ then try to run out-of- process and see if that resolves the issue.

Note: You can check and verify if MS OLE DB Provider for Oracle is running InProcess from the registry key at HKEY_LOCAL_MACHINESOFTWAREMicrosoftMSSQLServerProvidersMSDAORA

11. You can try collecting simultaneous Network trace from both SQL and Oracle servers and check if there are any communications between the two servers.

12. Try to connect to Oracle from the SQL server using the UDL.  Use the same TNS name. If you get the same error that means the issue is not specific to SSMS or linked server.

Creating and Configuring Universal Data Link (.udl) Files

http://msdn.microsoft.com/en-us/library/e38h511e(VS.71).aspx

13.  Try to specify all the information in the data source instead of using the TNS alias to connect to the Oracle database (this is a way to bypass tnsnames.ora file when connecting to Oracle).

Sample Data Source:

Data Source=(DESCRIPTION=(CID=GTU_APP)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST= server01.mydomain.com)(PORT=1521)))(CONNECT_DATA=(SID=OracleDB)(SERVER=DEDICATED)));

Author : Mohammad(MSFT) SQL Developer Engineer, Microsoft

Reviewed by : Azim(MSFT), SQL Developer Technical Lead , Microsoft

I want use PL/SQL Developer

first my oracle directory

C:oracleproduct10.2.0client_1BIN

I use windows10 and environment variable setting

ORACLE_HOME C:oracleproduct10.2.0client_1

Path C:oracleproduct10.2.0client_1BIN
but execute Initialization error.

Initialization error
Could not load "C:oracleproduct10.2.0client_1binoci.dll"

OracleHomeKey: SOFTWAREORACLEKEY_OraClient10g_home1
OracleHomeDir: C:oracleproduct10.2.0client_1
Found: oci.dll
Using: C:oracleproduct10.2.0client_1binoci.dll
LoadLibrary(C:oracleproduct10.2.0client_1binoci.dll) return 0

a_horse_with_no_name's user avatar

asked Mar 10, 2017 at 4:42

chohyunwook's user avatar

1

  1. download oracle instant client (64 bits for latest version of PL/SQL; 32 bits for old version)
  2. extract to a folder. for example: c:oracleinstantclient
  3. open PL/SQL developer—> Configure—> Preferences —> Oracle Connection
  4. under OCI library, keyin OCI.DLL file path in the text box: c:oracleinstantclientoci.dll
  5. click OK and restart PL/SQL

Ahmed Ashour's user avatar

Ahmed Ashour

5,05710 gold badges35 silver badges55 bronze badges

answered Dec 28, 2017 at 3:40

honglin zhang's user avatar

honglin zhanghonglin zhang

1,4671 gold badge10 silver badges8 bronze badges

1

I meet the same error on my new windows 10 computer. At last i found that i missed the Microsoft Visual Studio 2013 Redistributable. After i install it, the error gone.

answered Jul 26, 2018 at 3:17

林少峰's user avatar

林少峰林少峰

931 gold badge1 silver badge6 bronze badges

I was getting below error while connecting to database from PL/SQL developer (in windows10 64 bit).

Initialization error
Could not initialize
«C:app<username>product12.2.0dbhome_1binoci.dll»

Make sure you have the 32 bits Oracle Client installed.

OracleHomeKey: 
OracleHomeDir: C:app<username>product12.2.0dbhome_1
Found: oci.dll
Using: C:app<username>product12.2.0dbhome_1binoci.dll
LoadLibrary(C:app<username>product12.2.0dbhome_1binoci.dll) 
return 0

To resolve this issue, refer to the below documentation provided by Oracle to install the Oracle Instant Client. If your windows is 64 bit, then download the 32 bit Oracle Instant Client from below link —

Oracle guide

Link to download the Oracle Instant Client — (Download the BASIC and SDK and SQL*Plus Package)

Take all the above three packages in one directory and extract the same and add the path of extracted directory in system environment variable PATH and OCI_LIB32.

If OCI_LIB32 is not present then create the same.

Try to connect to database from PLSQL developer, if you getting error as ‘ORACLE initialization or shutdown in progress’ then go through the below link

Good Luck :)

Makdous's user avatar

Makdous

1,4491 gold badge11 silver badges24 bronze badges

answered Jul 7, 2020 at 13:40

Ajinkya Patil's user avatar

Check Environment Variables %PATH%

answered Dec 10, 2018 at 5:33

Dipesh Deb's user avatar

I had the similar problem and these steps did helped me

steps:

  • Download oracle instant client (64 bits for latest version of PL/SQL; 32 bits for old version)
  • Extract to a folder. for example: c:oracleinstantclient
  • Open PL/SQL developer—> Configure—>Preferences—> Oracle Connection
  • Under OCI library, keyin OCI.DLL file path in the text box: c:oracleinstantclientoci.dll
  • Click OK and restart PL/SQL
    done

Taslim Oseni's user avatar

Taslim Oseni

6,06710 gold badges44 silver badges68 bronze badges

answered Oct 3, 2019 at 20:09

Shashi's user avatar

Most of the cases this happens

  1. If you dont have any oracle client

In this case, you can download instant client and put it in C drive, then copy the path of the oci.dll file path and put it in the OCI library text field in the PL SQL Dev config option

  1. If you have multiple oracle home

If you have multiple homes reflecting, then check the correct oracle home from the Oracle Home drop down in PLSQL Dev config option.

Attached the image of the config screen for easy reference.

enter image description here

answered Sep 29, 2021 at 12:56

Bishnu's user avatar

BishnuBishnu

991 silver badge7 bronze badges

Download oracle client after that use PL/SQL to connect

answered May 12, 2022 at 17:13

KR93's user avatar

KR93KR93

1,06811 silver badges10 bronze badges

User-153615472 posted

<?xml:namespace prefix = o ns = «urn:schemas-microsoft-com:office:office» /><o:p></o:p> 

<o:p> </o:p>

I created webapp on one server to query an oracle database housed on another server

It works from within visual studio,”view in browser” but when the page is server from IIS the following
is displayed<o:p></o:p>

<o:p> </o:p>

System.Data.OracleClient.OracleException:
ORA-12154: TNS:could not resolve the connect identifier specified<o:p></o:p>

<o:p> </o:p>

Any help is much appreciated; [:'(]

full details of the setup are below, is this a permissions issue.

I have read many many posts and believe that I have everything configured correctly ?

<o:p> </o:p>

<o:p> </o:p>

SERVERone: <o:p></o:p>

Windows 2003 server running IIS 6.0 with .NET framework 2.057 and oracle InstantClient.<o:p></o:p>

Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210<o:p></o:p>

                       
I have a tnsname.ora and sqlnet.ora saved to the same directory (C:instantClientinstantclient10_1) <o:p></o:p>

I have a corresponding enviroment variable to that folder TNS_ADMIN C:instantClientinstantclient10_1<o:p></o:p>

“Authenticated Users” has FULL CONTROL
 permissions on this folder and subfolders<o:p></o:p>

Permission for read execute are also set for IWAM_SERVERone , IUSR_SERVERone, SERVERtwo/ASPNET<o:p></o:p>

<o:p> </o:p>

<o:p> </o:p>

SERVEtwo: <o:p></o:p>

Windows 2003 sever which is running an instance of Oracle 9i database.in <o:p></o:p>

ORA home folder
“Authenticated Users” has FULL CONTROL permissions and sub folders
<o:p></o:p>

Permission for read execute are also set for IWAM_SERVERone, IUSR_SDMS-SERVERone, SERVERtwo ASPNET<o:p></o:p>

<o:p> </o:p>

I can successfully connect from SERVERone to SERVERtwo using
TOAD 9.0.1 and I can query the database.<o:p></o:p>

<o:p> </o:p>

<o:p>More Details…..</o:p>

I want to create a web app on SERVERone to queryan oracle database on SERVERtow

I created an ASP.NET application using visual web developer.<o:p></o:p>

I addded a sqldatasource and configured the sqldatasource to use “oracle database” as the
data source, and the data provider.NET Framework Data Provider for Oracle”<o:p></o:p>

I set the
Server Name to the entry from the Tnanames.ora file an dentered the username and password<o:p></o:p>

When I click TEST CONNECTION it works , I then added a select * from xyz query<o:p></o:p>

<o:p> </o:p>

WHEN I RUN THE PAGE FROM WITHIN VWD it works perfectly ( “view in browser”)<o:p></o:p>

<o:p> </o:p>

However when I add the site to IIS and launch the page I get the ORA-12154 error

<o:p> </o:p>

<o:p>

TNSNAME.ORA entry<o:p></o:p>

<o:p> </o:p>

HOMER= <o:p></o:p>

 
(DESCRIPTION = <o:p></o:p>

   
(ADDRESS_LIST = <o:p></o:p>

       
(ADDRESS = <o:p></o:p>

         
(PROTOCOL = TCP)<o:p></o:p>

         
(HOST = 182.198.100.14)<o:p></o:p>

         
(PORT = 1521)<o:p></o:p>

       
)<o:p></o:p>

   
)<o:p></o:p>

   
(CONNECT_DATA =<o:p></o:p>

      
(SID = ERR)<o:p></o:p>

      
(GLOBAL_NAME = ERR.world)<o:p></o:p>

   
)<o:p></o:p>

 
)<o:p></o:p>

 <o:p></o:p>

sqlnet.ora ( this is the only line in this file , I also tried NTFS to no avail)<o:p></o:p>

<o:p> </o:p>

SQLNET.AUTHENTICATION_SERVICES= (NONE)<o:p></o:p>

</o:p>

<o:p> </o:p>

DATA SOURCE<o:p></o:p>

<asp:SqlDataSource
ID=»SqlDataSource1″
runat=»server»
ConnectionString
<%$ ConnectionStrings:ConnectionString
%>«<o:p></o:p>

           
ProviderName<%$ ConnectionStrings:ConnectionString.ProviderName
%>«
SelectCommand
=’SELECT * FROM XYZ’><o:p></o:p>

           
<SelectParameters>
<o:p></o:p>

<o:p> </o:p>

<o:p> WEB CONFIG Entry</o:p>

<o:p>

<


</o:p>

ORA-12154: TNS:could not resolve the connect identifier specified<o:p></o:p>

Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details:
System.Data.OracleClient.OracleException: ORA-12154: TNS:could not resolve the connect identifier specifiedSource Error: <o:p></o:p>

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified
using the exception stack trace below.
<o:p></o:p>


Stack Trace: <o:p></o:p>

<o:p> </o:p>
[OracleException (0x80131938): ORA-12154: TNS:could not resolve the connect identifier specified<o:p></o:p>
]<o:p></o:p>
   System.Data.OracleClient.OracleException.Check(OciErrorHandle errorHandle, Int32 rc) +84<o:p></o:p>
   System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName) +688<o:p></o:p>
   System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions) +135<o:p></o:p>
   System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +37<o:p></o:p>
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28<o:p></o:p>
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +429<o:p></o:p>
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +70<o:p></o:p>
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +512<o:p></o:p>
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +85<o:p></o:p>
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +102<o:p></o:p>
   System.Data.OracleClient.OracleConnection.Open() +34<o:p></o:p>
   System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121<o:p></o:p>
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137<o:p></o:p>
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83<o:p></o:p>
   System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1770<o:p></o:p>
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17<o:p></o:p>
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149<o:p></o:p>
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70<o:p></o:p>
   System.Web.UI.WebControls.GridView.DataBind() +4<o:p></o:p>
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82<o:p></o:p>
   System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69<o:p></o:p>
   System.Web.UI.Control.EnsureChildControls() +87<o:p></o:p>
   System.Web.UI.Control.PreRenderRecursiveInternal() +41<o:p></o:p>
   System.Web.UI.Control.PreRenderRecursiveInternal() +161<o:p></o:p>
   System.Web.UI.Control.PreRenderRecursiveInternal() +161<o:p></o:p>
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360<o:p></o:p>

<o:p> </o:p>

Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.210
<o:p></o:p>

█ 26.05.2017 17:23

Доброе время суток! )
При добавлении базы в Администраторе сервера приложений выскакивает такая ошибка. В алертлогах все в порядке. Переменная path проверена тоже все ок. БД 10.2.0.4. СМ версия 1033.3 СП4.

Дополнительно вот еще: «Значение не может быть неопределенным.
Имя параметра: sPath»

█ 26.05.2017 19:11

Решилось удалением софта оракла полностью (прибег к помощи RegOrganizer), была лишняя запись ORACLE_DEFAULT

█ 26.05.2017 19:45

Я так подозреваю, что и до этого к чьей-то помощи из этого вот прибегали… Покромсали реестр и как результат…
На будущее рекомендую сравнивать ключ вроде HKEY_LOCAL_MACHINESOFTWAREORACLEKEY_OraDb10g_home1 с другой машиной…

Часовой пояс GMT +3, время: 03:17.

Форум на базе vBulletin®
Copyright © Jelsoft Enterprises Ltd.
В случае заимствования информации гипертекстовая индексируемая ссылка на Форум обязательна.

automated-testing.info

Загрузка…

  • testomat.io управление авто тестами
  • Python
  • Реклама
  • Работа
  • Консультации
  • Обучение

Hi ,

The issue seems to be caused by,

An old ORACLE_HOME had not been deinstalled/removed correctly and the following registry information still existed:

[HKEY_LOCAL_MACHINESOFTWAREORACLEOracleMTSRecoveryService]

[HKEY_LOCAL_MACHINESOFTWAREORACLEOracleMTSRecoveryServiceProtid_0]
«Name»=»HTTP»
«Host»=»hostname»
«Port»=»49155»

[HKEY_LOCAL_MACHINESOFTWAREORACLEOracleMTSRecoveryServiceSetup]
«NumberOfInstalls»=dword:00000001

[HKEY_LOCAL_MACHINESOFTWAREORACLEOracleMTSRecoveryServiceSetupAll Versions]

[HKEY_LOCAL_MACHINESOFTWAREORACLEOracleMTSRecoveryServiceSetupAll Versions1]
«Version»=»11.2.0.1.0»
«Home»=»SOFTWARE\ORACLE\KEY_OraDb11g_home2»

[HKEY_LOCAL_MACHINESOFTWAREORACLEOracleMTSRecoveryServiceSetupCurrent Version]
«Version»=»11.2.0.1.0»
«Home»=»SOFTWARE\ORACLE\KEY_OraDb11g_home2»

Please do the following,

1. Verify that:
the above registry keys exist in the Windows registry, and
they point to an old %ORACLE_HOME% which no longer exists on the server
If the registry keys do not exist or if they point to a valid %ORACLE_HOME% on the server, there is another cause for the error which needs to be investigated further. Do not perform step 2.

2. After verifying both of the above points, remove the above registry keys and perform the 11.2 installation again. The error should no longer occur.

Hope this fixes the issue

1. Оракул был установлен сегодня, и сообщалось об ошибке при открытии pl / sql. SQL * Net неправильно установлен OracleHomeKey: ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ ORACLE

PL/SQL Developer — (Not logged on)

—————————

Initialization error

SQL*Net not properly installed

OracleHomeKey: SOFTWAREORACLE

OracleHomeDir:

Возможно, причина в том, что структура установочного каталога Oracle10g изменилась, и вам необходимо перенастроить каталоги ORACLE_HOME и «OCI Library» в PLSQL Developer.

Шаги следующие:

В PLSQL Developer выберите Инструменты> Настройки> Параметры>, как показано ниже: «Oracle Home» и «Библиотека OCI», как показано на рисунке:

Oracle10g установлен в d: oracle Oracle Home is d: oracle product 10.1.0

Библиотека OCI является d: oracle product 10.1.0 Db_1 BIN oci.dll

Перезапустите PLSQL Developer после настройки, вход в систему успешен

Второй метод

Добавьте каталог, где oci.dll добавлен в путь в переменной окружения моего компьютера

Например, мой файл oci.dll находится в папке D: config instantclient_10_2

Тогда я добавлю в путь;D:configinstantclient_10_2

Это нормально, обратите внимание на точку с запятой

Kalinkin92

0 / 0 / 0

Регистрация: 05.08.2014

Сообщений: 9

1

06.08.2014, 10:12. Показов 73260. Ответов 18

Метки нет (Все метки)


Доброго времени суток. Знаю, что эта проблема уже не раз здесь обсуждалась.
Но ни одно предложенное решение мне не помогло.
Oracle DB 11g XE, ОС windows 7.
Сервер и клиент на одной машине.
При коннекте через FORM BUILDER и другие средства из dev. suit. выдаётся ошибка «ora-12154: TNS…..»
Через SQL console и SQL developer коннектится без проблем.

Bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#tnsname.ora
XE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = Игорь-ПК)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)
    )
  )
 
EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )
 
ORACLR_CONNECTION_DATA = 
  (DESCRIPTION = 
    (ADDRESS_LIST = 
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) 
    ) 
    (CONNECT_DATA = 
      (SID = CLRExtProc) 
      (PRESENTATION = RO) 
    ) 
  )

Пожалуйста помогите!

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь

0

Модератор

4186 / 3026 / 576

Регистрация: 21.01.2011

Сообщений: 13,096

06.08.2014, 11:41

2

Если работа идет через Forms (кстати какой версии?), то он использует своего клиента. Ты из какого ORACLE_HOME показываешь tnsnames.ora?

1

0 / 0 / 0

Регистрация: 05.08.2014

Сообщений: 9

06.08.2014, 13:37

 [ТС]

3

Grossmeister,
Forms версия 10.1.2.0.2

ORACLE_HOME значение= C:oraclexeapporacleproduct11.2.0server
ORACLE_HOME_KEY = SOFTWAREORACLEKEY_XE
ORACLE_HOME_NAME = XE

tnsnames.ora находится по адресу C:oraclexeapporacleproduct11.2.0servernetwo rkADMIN

0

6 / 6 / 1

Регистрация: 28.07.2014

Сообщений: 49

06.08.2014, 14:25

4

tnsping проходит?

0

Модератор

4186 / 3026 / 576

Регистрация: 21.01.2011

Сообщений: 13,096

06.08.2014, 16:03

5

Цитата
Сообщение от Kalinkin92
Посмотреть сообщение

ORACLE_HOME значение= C:oraclexeapporacleproduct11.2.0server

Я не понял. Если на компе стоят и клиент, и сервер, то ORACLE_HOME д.б. минимум 2.

Кстати, если HOST действительно с таким именем, то в некоторых версиях Oracle не нравились имена с тире.

0

0 / 0 / 0

Регистрация: 05.08.2014

Сообщений: 9

06.08.2014, 17:31

 [ТС]

6

Grossmeister,
Запись в реестре ORACLE_HOME только одна

Добавлено через 3 минуты
Vic345,
>tnsping XE
TNS Ping Utility for 64-bit Windows: Version 11.2.0.2.0 — Production on 06-└┬├-2
014 17:29:28
Copyright (c) 1997, 2014, Oracle. All rights reserved.
Used parameter files:
C:oraclexeapporacleproduct11.2.0servernetwo rkadminsqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = ╚уюЁ№-╧╩
)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE)))
OK (110 msec)
Пинг проходит.
Проблема может быть в том, что имя компьютера на русском?

0

Модератор

4186 / 3026 / 576

Регистрация: 21.01.2011

Сообщений: 13,096

07.08.2014, 09:41

7

Цитата
Сообщение от Kalinkin92
Посмотреть сообщение

Проблема может быть в том, что имя компьютера на русском?

Это легко проверить. Можно вместо имени хоста писать ip

0

0 / 0 / 0

Регистрация: 05.08.2014

Сообщений: 9

08.08.2014, 10:32

 [ТС]

8

Какой IP адрес указывать если сервер и клиент на одной машине?

0

Модератор

4186 / 3026 / 576

Регистрация: 21.01.2011

Сообщений: 13,096

08.08.2014, 10:48

9

Цитата
Сообщение от Kalinkin92
Посмотреть сообщение

Какой IP адрес указывать если сервер и клиент на одной машине?

Локальный ip завсегда был 127.0.0.1

Кстати, что означает твоя фраза, что клиент и сервер на одной машине? Если имеется ввиду Oracle Client, то он обязательно ставится в свой ORACLE_HOME, а из твоих слов у тебя на компе только 1 ORACLE_HOME

0

0 / 0 / 0

Регистрация: 05.08.2014

Сообщений: 9

10.08.2014, 21:22

 [ТС]

10

Grossmeister, Да всё верно, ORACLE_HOME только одна запись в реестре. Значит у меня не создан клиент? Из-за этого не удаётся подключиться к бд через oracle forms?

Добавлено через 2 часа 3 минуты
Отредактировал tnsnames.ora в oracle dev. suit. Проблема решилась.
Но теперь при подключении появляется
ORA — 00604:error occured at recursive SQL level 1
ORA — 12705:Cannot access NLS data files or invalid environment
выполнил действия
Как связать Oracle Forms с базой данных? изменений нет.
NLS_LANG = AMERICAN_AMERICA.CL8MSWIN1251

0

Модератор

4186 / 3026 / 576

Регистрация: 21.01.2011

Сообщений: 13,096

11.08.2014, 10:07

11

Цитата
Сообщение от Kalinkin92
Посмотреть сообщение

ORA — 00604:error occured at recursive SQL level 1
ORA — 12705:Cannot access NLS data files or invalid environment

Обычно такая ошибка появляется в случае, когда неправильно прописан PATH. Посмотри, что там у тебя, заодно увидишь, есть там пути к 1, или к 2 ORACLE_HOME (что-нибудь типа …ora…bin)

1

0 / 0 / 0

Регистрация: 05.08.2014

Сообщений: 9

11.08.2014, 10:38

 [ТС]

12

Grossmeister,
ORACLE_HOME=C:oraclexeapporacleproduct11.2.0 server
если добавить в конце bin, то не запускается даже sql console
NLS_LANG=AMERICAN_AMERICA.CL8MSWIN1251

>SELECT USERENV (‘language’) FROM DUAL
Выдаёт также AMERICAN_AMERICA.CL8MSWIN1251

0

Модератор

4186 / 3026 / 576

Регистрация: 21.01.2011

Сообщений: 13,096

11.08.2014, 10:50

13

PATH — это переменная окружения (environment var) Win. Просмотр — Мой компьютер — прав. кн. мыши — Свойства — Дополнительно. Или дать команду set в командной строке.

1

0 / 0 / 0

Регистрация: 05.08.2014

Сообщений: 9

11.08.2014, 11:01

 [ТС]

14

Path=C:oraclexeapporacleproduct11.2.0server bin;; <- здесь указано 2 символа ‘;’
C:DevSuiteHome_1jdkjrebinclassic;
C:DevSuiteHome_1jdkjrebin;
C:DevSuiteHome_1jdkjrebinclient;
C:DevSuiteHome_1jlib;
C:DevSuiteHome_1bin;
C:DevSuiteHome_1jre1.4.2binclient;
C:DevSuiteHome_1jre1.4.2bin;
…..
пути для других программ

0

Модератор

4186 / 3026 / 576

Регистрация: 21.01.2011

Сообщений: 13,096

11.08.2014, 12:23

15

Не работал с Forms 10 (только с Forms 6), но предполагаю, что это — C:DevSuiteHome_1bin — ORACLE_HOME для Forms.
Для проверки можно поискать в этом директории sqlplus. Если это так, то в директории C:DevSuiteHome_1networkadmin находится тот tnsnames.ora, которым пользуется Forms. Нужно привести оба tnsnames.ora в соответствие (или в реестре сделать ключик TNS_ADMIN, в котором указать путь к правильному tnsnames.ora).

На текущий момент первым в PATH стоит путь к серверному ORACLE_HOME, с которым, возможно, Forms работать не может. Поэтому перед запуском Forms нужно менять ORACLE_HOME (для смены обычно используется Home Selector в OUI — Oracle Universal Installer). Правда не знаю, как в этом случае поведет себя запущенный сервер (встречал на некоторых версиях, что сервер при смене ORACLE_HOME падал).
Либо можно для запуска Forms создать cmd-файл, в котором сначала будет устанавливаться нужный PATH (в котором путь к директориям Forms будет «первее», чем путь к серверным директориям), а только потом запускаться Forms.

0

0 / 0 / 0

Регистрация: 05.08.2014

Сообщений: 9

11.08.2014, 13:12

 [ТС]

16

Grossmeister,
Какое значение должен иметь ORACLE_HOME?
На какую директорию он должен указывать чтобы формы подключались?

0

Модератор

4186 / 3026 / 576

Регистрация: 21.01.2011

Сообщений: 13,096

11.08.2014, 13:24

17

Цитата
Сообщение от Kalinkin92
Посмотреть сообщение

На какую директорию он должен указывать чтобы формы подключались?

Если мое предположение верно, то C:DevSuiteHome_1

0

0 / 0 / 0

Регистрация: 05.08.2014

Сообщений: 9

11.08.2014, 16:52

 [ТС]

18

Grossmeister,
Я изменил ORACLE_HOME на C:DevSuiteHome_1
Oracle form перестал отвечать.
Возможны ещё какие нибудь варианты решения?

Добавлено через 2 часа 53 минуты
Товарищ Grossmeister,
Очень надеюсь на вашу помощь!

0

0 / 0 / 0

Регистрация: 15.02.2011

Сообщений: 9

23.01.2019, 11:45

19

ГУГЛ поиск сосрана ERROR ORA 12154 TNS

ORACLE_HOME правильный путь где библиотека отвечает

OCI.DLL oraclient11.dll ORACORE11.DLL

вот и приложите правильный путь — ЖИРНАЯ это версия клиента ОРАКЛА 11

NLS_LANG = AMERICAN_AMERICA.CL8MSWIN1251 — это в REGEDIT
КомпьютерHKEY_LOCAL_MACHINESOFTWAREORACLE ищите там NLS_LANG

TNSNAMES
Мой компьютер — прав. кн. мыши — Свойства — Дополнительно. кнопка ПЕРЕМЕННЫЕ СРЕДЫ
там ПЕРЕМЕННЫЕ СРЕДЫ ПОЛЬЗОВАТЕЛЯ кнопка СОЗДАТЬ первой строке TNSNAMES , а ниже ORCL по умолчанию установки , а ваш как меняли ли при установке СЕРВИС SID ? XE

0

IT_Exp

Эксперт

87844 / 49110 / 22898

Регистрация: 17.06.2006

Сообщений: 92,604

23.01.2019, 11:45

Помогаю со студенческими работами здесь

ORA-12154
ORA-12154: TNS:невозможно разрешить заданный идентификатор соединения
Знаю что ошибка очень…

ORA-12154!
Пытаюсь подключиться к серву через PL/SQL developer и выдает эту ошибку( ORA-12514: TNS:listener…

Sqlplus из shell. ORA-12154
Доброго.

Немогу запустить sqlplus из скрипта. Если нужных значений в переменных $ORACLE_HOME,…

Forms Builder, ORA-12154
Хочу поставить на одной машине сервер базы и сервер приложений.

— Установилa Oracle Database…

Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:

19


First published on MSDN on Jun 30, 2010

This is one of the most common errors while creating linked server to Oracle database. Today I will discuss the reason for this error and possible resolutions.

Full error message:


OLE DB provider «MSDAORA» for linked server «LINKED_ORA» returned message «ORA-12154: TNS:could not resolve the connect identifier specified».


Msg 7303, Level 16, State 1, Line 1


Cannot initialize the data source object of OLE DB provider «MSDAORA» for linked server «LINKED_ORA».

First of all make sure you have reviewed the following Microsoft KB article that has a lot of good information on troubleshooting Oracle linked server issues.

How to set up and troubleshoot a linked server to an Oracle database in SQL Server

http://support.microsoft.com/kb/280106

Also make sure you have installed Oracle Client on the SQL server. If the SQL server is 64 bit then we need to install 64 bit Oracle provider. You can also create linked server using Oracle ODBC driver together with Microsoft OLE DB provider for ODBC. Once again on a 64 bit SQL server you need to install the

64-Bit OLEDB Provider for ODBC (MSDASQL)

and 64 bit Oracle ODBC drivers. However 64-Bit OLEDB Provider for ODBC (MSDASQL) is already there in Windows Vista/Windows Server 2008 and later OS.

This particular error message is a very general error message and can happen for quite a number of reasons. For general understanding of the error, you can review oracle documentation like this

http://ora-12154.ora-code.com/

In SQL Server Linked Server, it could indicate a few things (not limited to)–

1.       SQL Server (and oracle net libraries) is not able to get the TNS alias from tnsnames.ora file.

2.       Something is wrong with the way the alias is created in the tnsnames.ora file (incorrect syntax)

3.       TNS alias could not be resolved into a connect descriptor

Below is a list of things that you can try to resolve this issue.

1. Verify that the tnsnames.ora file has the alias and the service name that the customer is using.

TNS entry for the Oracle database

===========================

OracleDB_Dev =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = server01.mydomain.com)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = OracleDB)

(SERVER = DEDICATED)

)

)

In the above tnsnames.ora file Alias = OracleDB_Dev

Service Name: OracleDB (Actual Oracle service name [instance name in SQL])

2.  Check the sqlnet.ora file under ‘Admin’ folder in Oracle home [Dir:appproduct11.1.0client_1networkadmin] and ensure that we have TNSNames in NAMES.DIRECTORY_PATH

NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)

3. Verify if you can connect to Oracle from the SQL server machine using tools installed with Oracle Client [For example «SQL Developer» or “SQL Plus”] with the same user id/password or TNS alias.

5. Check if the environment variable ‘PATH’ has the path for tnsnames.ora file specified.

Sample Value of Environment Variable PATH:


E:appproduct11.1.0client_1bin

;C:Program FilesBusiness ObjectsCommon3.5binNOTES;C:Program FilesBusiness ObjectsCommon3.5binNOTESDATA;%Systemroot%Microsoft.NETFrameworkv1.1.4322;%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;C:Program FilesDellSysMgtomabin;C:Program FilesMicrosoft SQL Server80ToolsBINN;C:Program FilesCommon FilesMicrosoft Sharedweb server extensions60TEMPLATEADMIN1033;C:Program FilesMicrosoft SQL Server80ToolsBinn;C:Program FilesMicrosoft SQL Server90DTSBinn;C:Program FilesMicrosoft SQL Server90Toolsbinn;C:Program FilesMicrosoft SQL Server90ToolsBinnVSShellCommon7IDE;C:Program FilesMicrosoft Visual Studio 8Common7IDEPrivateAssemblies;C:Program FilesMicrosoft Network Monitor 3


Note: make sure that the path is a valid path and there is no space.

6. Check the value of the key  ”Oracle_Home” in the registry under  HKEY_LOCAL_MACHINESOFTWAREORACLEKEY_OraClient11g_home1  and verify that it has the right path for the Oracle home.

7.  Check for the registry key “TNS_ADMIN” at HKEY_LOCAL_MACHINESOFTWAREORACLE. If it exists then make sure it has the right value as “Dir:appproduct11.1.0client_1networkadmin”. If you don’t see the key then create the key and set appropriate value as below.

Regedit->HKEY_LOCAL_MACHINE->Software->Oracle->RightClick NEW->StringValue and name

it TNS_ADMIN and give the value  “X:appproduct11.1.0client_1networkadmin”


Note: This is not a must but in some cases this is what fixed the issue.

8.   Check if SQL server start up account has permission to the Oracle Home. Also collect Process monitor log and check for “access denied”.  Process monitor log should show if we are able to find the tnsnames.ora file.

9. Make sure you don’t have multiple Oracle homes or multiple Oracle clients installed. Check the «HKEY_LOCAL_MACHINESOFTWAREORACLEALL_HOMESHOME_COUNTER» key value.

10. Check if Oracle OLE DB provider is running InProcess. If ‘yes’ then try to run out-of- process and see if that resolves the issue.

Note: You can check and verify if MS OLE DB Provider for Oracle is running InProcess from the registry key at HKEY_LOCAL_MACHINESOFTWAREMicrosoftMSSQLServerProvidersMSDAORA

11. You can try collecting simultaneous Network trace from both SQL and Oracle servers and check if there are any communications between the two servers.

12. Try to connect to Oracle from the SQL server using the UDL.  Use the same TNS name. If you get the same error that means the issue is not specific to SSMS or linked server.

Creating and Configuring Universal Data Link (.udl) Files

http://msdn.microsoft.com/en-us/library/e38h511e(VS.71).aspx

13.  Try to specify all the information in the data source instead of using the TNS alias to connect to the Oracle database (this is a way to bypass tnsnames.ora file when connecting to Oracle).

Sample Data Source:

Data Source=(DESCRIPTION=(CID=GTU_APP)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST= server01.mydomain.com)(PORT=1521)))(CONNECT_DATA=(SID=OracleDB)(SERVER=DEDICATED)));

Author : Mohammad(MSFT) SQL Developer Engineer, Microsoft

Reviewed by : Azim(MSFT), SQL Developer Technical Lead , Microsoft

When creating a new Oracle data source, I’m receiving the following message:

Unable to connect: We encountered an error while trying to connect to . Details: «We could not register this data source for any gateway instances within this cluster. Please find more details below about specific errors for each gateway instance.»Hide details

Activity ID: 5d862ea5-3a96-0835-6db7-8f7f459bf828
Request ID: 0ad21c9b-99f9-419b-2dda-37a8d184731e
Cluster URI: https://wabi-us-east2-redirect.analysis.windows.net
Status code: 400
Error Code: DMTS_PublishDatasourceToClusterErrorCode
Time: Wed Sep 12 2018 09:58:40 GMT-0400 (Eastern Daylight Time)
Version: 13.0.6617.130
  Cannot connect to the mashup data source. See error details for more information.
Underlying error code: -2147467259
Underlying error message: Oracle: ORA-12154: TNS:could not resolve the connect identifier specified
DM_ErrorDetailNameCode_UnderlyingHResult: -2147467259
Microsoft.Data.Mashup.ValueError.DataSourceKind: Oracle
Microsoft.Data.Mashup.ValueError.DataSourcePath:  
Microsoft.Data.Mashup.ValueError.ErrorCode: -2146232008
Microsoft.Data.Mashup.ValueError.Message: ORA-12154: TNS:could not resolve the connect identifier specified
Microsoft.Data.Mashup.ValueError.Reason: DataSource.Error

I have the following already configured:

1) Oracle 12.1 64-bit client is installed.

2) ORACLE_HOME and TNS_ADMIN locations are setup in PATH environment variable.

3) TNS_ADMIN evironment variable is added as an environment variable.

4) Entry in tnsnames.ora file, i.e.) net_service_name in tns entry is being used as ‘Server’ value for data source.

5) NAMES_DIRECTORY_PATH=(TNSNAMES, EZCONNECT) in sqlnet.ora file.

6) The value of the key «Oracle_home» in the registry under HKEY_LOCAL_MACHINESOFTWAREORACLEKEY_OraClient12Home1 is set to the correct path.

7) The registry key for «TNS_ADMIN» is correctly set.

:smiling_face_with_sunglasses: There are not multiple Oracle homes.

There were already 2 Oracle data sources that previously worked.  Now, unsure why, they no longer work and the new data source creation is failing when attempted to add an Oracle database.

Thanks in advance for your help!

Frank

Понравилась статья? Поделить с друзьями:
  • Oracle exception код ошибки
  • Oracle exception вывести ошибку
  • Oracle 01033 ошибка что значит
  • Ora 942 ошибка
  • Ora 6512 ошибка