在已装有Oracle DB 10gR2的Linux环境下安装 gateway 11g for sybase
[oracle@QGYT01~]$ mkdir /u03/gateway
[oracle@QGYT01gateways]$ ./runInstaller
注意:由于数据库版本与gateway版本不同,因此不能在原oracle_home目录下安装gateway,要使用新目录,否则bin下的程序会被覆盖,导致oracle软件不可用。
[root@QGYT01 ~]# /u03/gate/root.sh
RunningOracle 11g root.sh script...
Thefollowing environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u03/gate
Enter thefull pathname of the local bin directory: [/usr/local/bin]: /u03/gate/local/bin
Creating/u03/gate/local/bin directory...
Copying dbhome to /u03/gate/local/bin ...
Copying oraenv to /u03/gate/local/bin ...
Copying coraenv to /u03/gate/local/bin ...
Entrieswill be added to the /etc/oratab file as needed by
DatabaseConfiguration Assistant when a database is created
Finishedrunning generic part of root.sh script.
Nowproduct-specific root actions will be performed.
此处是配置监听,由于我安装之前有装数据库,已经安装了监听,因此在这里不再安装。
[oracle@QGYT01admin]$ more initdg4sybs.ora
# This isa customized agent init file that contains the HS parameters
# thatare needed for the Database Gateway for Sybase
#
# HS initparameters
#
HS_FDS_CONNECT_INFO=[192.168.131.57]:4100/amtrix
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
这个是我们之前安装gateway写的sybase数据库连接信息,如果当初没有写错,则无需修改,忽略此步。
[oracle@QGYT01 admin]$ vi listener.ora
#listener.ora Network Configuration File: /u01/oracle/product/10.2.0/db/network/admin/listener.ora
#Generated by Oracle configuration tools.
SID_LIST_LISTENER=
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME =/u01/oracle/product/10.2.0/db)
(PROGRAM = extproc)
)
(SID_DESC=
(SID_NAME=dg4sybs) --与initdg4sybs.ora一致
(ORACLE_HOME=/u03/gateway) --gateway安装目录(bin的上级目录)
(PROGRAM=dg4sybs) --gateway安装目录bin目录下的程序
)
)
LISTENER=
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =QGYT01)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY =EXTPROC0))
)
)
ADR_BASE_LISTENER = /u01/oracle
配置好之后,重启监听
--加入以下内容
dg4sybs =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.131.120)(PORT=1521))
--HOST为本机ip或hostname
(CONNECT_DATA=(SID=dg4sybs))
(HS=OK)
)
--用 tnsping dg4sybs测试一下:
[oracle@QGYT01 admin]$ tnsping dg4sybs
TNS PingUtility for Linux: Version 10.2.0.5.0 - Production on 12-JUN-2014 13:53:43
Copyright(c) 1997, 2010, Oracle. All rights reserved.
Usedparameter files:
UsedTNSNAMES adapter to resolve the alias
Attemptingto contact (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.131.120)(PORT=1521))(CONNECT_DATA=(SID=dg4sybs)) (HS=OK))
OK (0msec)
CREATE DATABASELINK sybase_ssdd_linkCONNECTTO"sa"IDENTIFIEDBY" "USING'dg4sybs'
select count(*)from"XQW_ERROR_INFO"@sybase_ssdd_link;
COUNT(*)
----------
140928
1 row selected.
成功!
[oracle@QGYT01 admin]$ cp initdg4sybs.ora initdg4sybs2.ora
[oracle@QGYT01 admin]$ vi initdg4sybs2.ora
# This isa customized agent init file that contains the HS parameters
# thatare needed for the Database Gateway for Sybase
#
# HS initparameters
#
HS_FDS_CONNECT_INFO=[192.168.131.57]:4100/amtrix
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
# This isa customized agent init file that contains the HS parameters
# thatare needed for the Database Gateway for Sybase
#
# HS initparameters
#
HS_FDS_CONNECT_INFO=[192.168.131.57]:4100/amtrix
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
dg4sybs2 =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.131.120)(PORT=1521))
(CONNECT_DATA=(SID=dg4sybs2)) --与initdg4sybs2.ora一致
(HS=OK)
)
[oracle@QGYT01 admin]$ vi listener.ora
#listener.ora Network Configuration File:/u01/oracle/product/10.2.0/db/network/admin/listener.ora
# Generatedby Oracle configuration tools.
SID_LIST_LISTENER=
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME =/u01/oracle/product/10.2.0/db)
(PROGRAM = extproc)
)
(SID_DESC=
(SID_NAME=dg4sybs)
(ORACLE_HOME=/u03/gateway)
(PROGRAM=dg4sybs)
)
(SID_DESC=
(SID_NAME=dg4sybs2) --与initdg4sybs2.ora一致
(ORACLE_HOME=/u03/gateway)
(PROGRAM=dg4sybs)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =QGYT01)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY =EXTPROC0))
)
)
ADR_BASE_LISTENER= /u01/oracle
CREATE DATABASELINK sybase_amtrix_linkCONNECTTO"sa"IDENTIFIEDBY" "USING 'dg4sybs2';
select * from "test"@sybase_amtrix_link;
id
---------------
3
1 row selected.
成功!
Sharon
2014.06.12
----------------------------------------------------------------------------------------------
转载须注明出处!
http://blog.csdn.net/sharqueen_wu/article/details/30244317转载须注明出处!
http://blog.csdn.net/sharqueen_wu/article/details/30244317转载须注明出处!
http://blog.csdn.net/sharqueen_wu/article/details/30244317