如何建立odbc连接的数据源此处不再描述,以下介绍第二种的配置方法:
网上关于这个的配置方法很多,但是按照其配置后总是出现这样或者那样的问题。现在把配置文件内容贴出来供以后配置使用:
listener.ora(D:\oarcle\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora)---开始:
# listener.ora Network Configuration File: D:\oarcle\app\Administrator\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\oarcle\app\Administrator\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = erp_bom)
(ORACLE_HOME = D:\oarcle\app\Administrator\product\11.2.0\dbhome_1)
(PROGRAM = dg4odbc) --10g数据库时此处应该为(PROGRAM = hsodbc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = USER-20140615NL)(PORT = 1521))
)
)
ADR_BASE_LISTENER = D:\oarcle\app\Administrator
listener.ora(D:\oarcle\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora)---结束
tnsnames.ora (D:\oarcle\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN\tnsnames.ora)---开始
# tnsnames.ora Network Configuration File: D:\oarcle\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN\tnsnames.ora
# Generated by Oracle configuration tools.
orcl =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orck)
)
)
LISTENER_orcl =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
erp_bom =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SID = erp_bom)
)
(HS=OK)
)
tnsnames.ora (D:\oarcle\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN\tnsnames.ora)---结束
listener.ora( D:\oarcle\app\Administrator\product\11.2.0\dbhome_1\hs\admin\initerp_bom.ora )----开始
# This is a sample agent init file that contains the HS parameters that are
# needed for the Database Gateway for ODBC
#
# HS init parameters
#
HS_FDS_CONNECT_INFO = erp_bom
HS_FDS_TRACE_LEVEL = OFF
#
# Environment variables required for the non-Oracle system
#
#set
listener.ora( D:\oarcle\app\Administrator\product\11.2.0\dbhome_1\hs\admin\initerp_bom.ora )----结束