Wednesday, March 28, 2012

Linked server problem

Hi, im trying to make a linked server with an oracle db. Here is the Tsql
code:
set nocount on
-- if exists must drop
IF EXISTS (select * from master.dbo.sysservers WHERE srvname = 'sena')
BEGIN
EXEC sp_droplinkedsrvlogin 'sena', NULL
EXEC sp_dropserver 'sena'
END
-- Create linked server
use master
go
EXEC sp_addlinkedserver @.server = 'sena', @.srvproduct = 'Oracle',
@.provider = 'MSDAORA', @.datasrc = 'bdsena'
go
EXEC sp_addlinkedsrvlogin 'sena', 'false', NULL, 'general', 'general'
go
SELECT * FROM OPENQUERY(sena, 'Select * From oferente')
set nocount off
When the analizer try to make the openquery i get the following error:
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDAORA' reported an error.
[OLE/DB provider returned message: Oracle client and networking components
were not found. These components are supplied by Oracle Corporation and are
part of the Oracle Version 7.3.3 or later client software installation.
Provider is unable to function until these components are installed.]
OLE DB error trace [OLE/DB Provider 'MSDAORA' IDBInitialize::Initialize
returned 0x80004005: ].
The problem is that i have in the server the oracle client and i can connect
to the oracle database from sqlplus or activex (using msdaora)
Any idea?
Thanks,
Andres Chaves"Andres Chaves" <guest@.guest.com> wrote in message
news:#7OPittrDHA.2432@.TK2MSFTNGP10.phx.gbl...
> Hi, im trying to make a linked server with an oracle db. Here is the Tsql
> code:
> set nocount on
> -- if exists must drop
> IF EXISTS (select * from master.dbo.sysservers WHERE srvname = 'sena')
> BEGIN
> EXEC sp_droplinkedsrvlogin 'sena', NULL
> EXEC sp_dropserver 'sena'
> END
> -- Create linked server
> use master
> go
> EXEC sp_addlinkedserver @.server = 'sena', @.srvproduct = 'Oracle',
> @.provider = 'MSDAORA', @.datasrc = 'bdsena'
> go
> EXEC sp_addlinkedsrvlogin 'sena', 'false', NULL, 'general', 'general'
> go
> SELECT * FROM OPENQUERY(sena, 'Select * From oferente')
> set nocount off
> When the analizer try to make the openquery i get the following error:
> Server: Msg 7399, Level 16, State 1, Line 1
> OLE DB provider 'MSDAORA' reported an error.
> [OLE/DB provider returned message: Oracle client and networking components
> were not found. These components are supplied by Oracle Corporation and
are
> part of the Oracle Version 7.3.3 or later client software installation.
> Provider is unable to function until these components are installed.]
> OLE DB error trace [OLE/DB Provider 'MSDAORA' IDBInitialize::Initialize
> returned 0x80004005: ].
>
> The problem is that i have in the server the oracle client and i can
connect
> to the oracle database from sqlplus or activex (using msdaora)
> Any idea?
> Thanks,
> Andres Chaves
>
Did you try to connect to the Oracle from sqlplus using SQL Server's Windows
NT account?
You might need to install Oracle client one more time.
Regards,
Igor Raytsin

No comments:

Post a Comment