0

Hello Im using two machines : Windows XP and Windows Server 2003 , on both I have installed the oracle client 10g, and when I try to use ODBC for linked server option on SQL Server It just work on my XP but on the server I cant get it work, even with the same configuration.

Note:

Windows XP - SQL Server 2008 Developer Windows Server 2003 - SQL Server 2000 Standard

Will be the SQL Version?

Thanks.

in Both machines I get the same tnsnames.ora file:

# tnsnames.ora Network Configuration File: C:\oradata\client\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

MEDICAL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = SERVERCONTABLE.RESOCENTRO.COM)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = medical)
    )
  )

but with diferent install dir.

Error Stack from SSMS :

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

Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)

------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476

------------------------------
Program Location:

   at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.Process(Object connectionInfo, Request request)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.BuildDynamicItemWithQuery(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, String urnQuery, Boolean registerBuilder, Boolean registerBuiltItems)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.BuildDynamicItem(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, IFilterProvider filter)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.Build(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, IFilterProvider filter)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItem.GetChildren(IGetChildrenRequest request)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ExplorerHierarchyNode.BuildChildren(WaitHandle quitEvent)

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

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------
Program Location:

   at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteReader(String sqlCommand)
   at Microsoft.SqlServer.Management.Smo.ExecuteSql.GetDataReader(String query)
   at Microsoft.SqlServer.Management.Smo.DataProvider.SetConnectionAndQuery(ExecuteSql execSql, String query)
   at Microsoft.SqlServer.Management.Smo.ExecuteSql.GetDataProvider(StringCollection query, Object con, StatementBuilder sb, RetriveMode rm)
   at Microsoft.SqlServer.Management.Smo.SqlObjectBase.FillData(ResultType resultType, StringCollection sql, Object connectionInfo, StatementBuilder sb)
   at Microsoft.SqlServer.Management.Smo.SqlObjectBase.FillDataWithUseFailure(SqlEnumResult sqlresult, ResultType resultType)
   at Microsoft.SqlServer.Management.Smo.SqlObjectBase.BuildResult(EnumResult result)
   at Microsoft.SqlServer.Management.Smo.SqlObjectBase.GetData(EnumResult erParent)
   at Microsoft.SqlServer.Management.Sdk.Sfc.Environment.GetData()
   at Microsoft.SqlServer.Management.Sdk.Sfc.Environment.GetData(Request req, Object ci)
   at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.GetData(Object connectionInfo, Request request)
   at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.Process(Object connectionInfo, Request request)

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

El proveedor OLE DB 'OraOLEDB.Oracle' informa de un error. El proveedor no proporcionó información acerca del error. (.Net SqlClient Data Provider)

------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=08.00.2039&EvtSrc=MSSQLServer&EvtID=7399&LinkId=20476

------------------------------
Server Name: 192.168.0.3
Error Number: 7399
Severity: 16
State: 1
Procedure: sp_tables_ex
Line Number: 13


------------------------------
Program Location:

   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader()
   at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteReader(String sqlCommand)

When I try to use SSMS with OPENQUERY I get the following :

select * from openrowset 

('OraOLEDB.Oracle','oradb';'system';'siscad', 

'select * from emp') 

Servidor: mensaje 7399, nivel 16, estado 1, línea 1
El proveedor OLE DB 'OraOLEDB.Oracle' informa de un error.  
[OLE/DB provider returned message: ORA-12154: TNS:no se ha podido resolver el identificador de conexión especificado]
Traza de error de OLE DB [OLE/DB Provider 'OraOLEDB.Oracle' IDBInitialize::Initialize returned 0x80004005:   ].

traduced :

Server: Message 7399, level 16, State 1, line 1 OLE DB 'OraOLEDB.Oracle' provider reports an error.   
[OLE/DB provider returned message: ORA-12154: TNS:no could be resolved the connection identifier specified] 
OLE DB error trace [OLE/DB Provider 'OraOLEDB.Oracle' IDBInitialize:Initialize returned 0x80004005:].
Jonathan Escobedo
  • 169
  • 3
  • 6
  • 17
  • What are the errors that you're getting from the linked server on the Windows 2003 box? – squillman Jan 19 '10 at 19:20
  • I've added the error stack – Jonathan Escobedo Jan 19 '10 at 19:38
  • Ok, that's not going to get us far. What happens if you run your statement through SQL Server Management Studio (logged in as the user that your app is connecting with)? – squillman Jan 19 '10 at 19:42
  • look I cant use the SSMS for anything about that linked server, But I can work with tnsping and connect via prompt sqlplus in Windows Server 2003, I have checked Allow in process also and users are correct in security options – Jonathan Escobedo Jan 19 '10 at 20:00

2 Answers2

1

No, it's not likely to be because of the version of SQL. The most frequent error I get setting up linked servers to an Oracle target is an Oracle name resolution error. Check to make sure that your tnsnames.ora has the same entry on the Windows 2003 server as the XP machine has. The tnsnames.ora file is typically located in

\[oracle install root]\product\[version]\client_x\NETWORK\ADMIN

Where version is the version of Oracle and client_x is the instance of the client installation you're working with.

squillman
  • 37,618
  • 10
  • 90
  • 145
0

SOLUTION :

Edit or Add new REG_DWORD called AllowInProcess and set Hexa value as 1

RUN> regedit > HKEY_LOCALMACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\[Version]\Providers\OraOLEDB.Oracle
Jonathan Escobedo
  • 169
  • 3
  • 6
  • 17