我正在尝试将 SQL Server 2005 链接到 Oracle 10g 数据库。我已经在 SQL 服务器上安装了 Oracle 客户端,并验证我可以使用 tnsping 和 sqlplus 连接到 Oracle 数据库。当我尝试在 SQL Server 中运行查询时,我得到以下信息:
OLE DB provider "OraOLEDB.Oracle" for linked server "ORA_CSSA2APD" 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 "OraOLEDB.Oracle" for linked server "ORA_CSSA2APD".
有任何想法吗?我已经尝试了以下两个查询,但都没有运气:
select * from openquery(ORA_CSSA2APD, 'select count(rowid) from eservice_op.agent')
select count(rowid) from ORA_CSSA2APD..eservice_op.agent