共计 1398 个字符,预计需要花费 4 分钟才能阅读完成。
丸趣 TV 小编给大家分享一下 oracle 如何使用 odbc 连接 dm7,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!
1 在 oracle 服务器创建 dm 的数据源 1.1 先安装 unixODBC-2.3.0
上传软件包到服务器,运行以下命令:
tar zxf unixODBC-2.3.0.tar.gz
cd unixODBC-2.3.0
./configure –with-iconv-char-enc=GB18030 –enable-iconv=yes
make make install
1.2 配置 unixODBC
cd /usr/local/etc
vim odbc.ini
[DM7]
Description = DM ODBC DSN
Driver = DM7 ODBC DRIVER
SERVER = 192.168.1.33
UID = SYSDBA
PWD = SYSDBA
TCP_PORT = 5236
vim odbcinst.ini
[DM7 ODBC DRIVER]
Description = ODBC DRIVER FOR DM7
Driver = /dmdbms/bin/libdodbc.so
threading = 0
1.3 测试 oracle 服务器能连接 dm 数据源
isql -v DM7 SYSDBA SYSDBA
2 配置 HS
file $ORACLE_HOME/bin/dg4odbc
ELF 64-bit LSB executable, x86-64
cd /oracle/app/oracle/product/11.2.0/hs/admin
vim initDM7.ora
HS_FDS_CONNECT_INFO = DM7
HS_FDS_TRACE_LEVEL = debug
set ODBCINI=/usr/local/etc/odbc.ini
HS_FDS_SHAREABLE_NAME = /usr/local/lib/libodbc.so
3 oracle 配置静态监听
cd $ORACLE_HOME/network/admin
vim listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME =
DM7)
(ORACLE_HOME = /oracle/app/oracle/product/11.2.0)
(PROGRAM =
dg4odbc)
)
)
4 配置 Oracle 的 tnsnames.ora
vim tnsnames.ora
DM7 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME =
DM7)
)
(HS=OK)
)
lsnrctl status
5 创建 dblink 和测试
sqlplus /as sysdba
SQL
create public database link dmlink connect to SYSDBA identified by SYSDBA using DM7
SQL select name,status$ from v$instance@dmlink;
看完了这篇文章,相信你对“oracle 如何使用 odbc 连接 dm7”有了一定的了解,如果想了解更多相关知识,欢迎关注丸趣 TV 行业资讯频道,感谢各位的阅读!