Oracle1129Transparent Gateway for SQL Server.docx

上传人:b****3 文档编号:5404145 上传时间:2022-12-16 格式:DOCX 页数:24 大小:33.75KB
下载 相关 举报
Oracle1129Transparent Gateway for SQL Server.docx_第1页
第1页 / 共24页
Oracle1129Transparent Gateway for SQL Server.docx_第2页
第2页 / 共24页
Oracle1129Transparent Gateway for SQL Server.docx_第3页
第3页 / 共24页
Oracle1129Transparent Gateway for SQL Server.docx_第4页
第4页 / 共24页
Oracle1129Transparent Gateway for SQL Server.docx_第5页
第5页 / 共24页
点击查看更多>>
下载资源
资源描述

Oracle1129Transparent Gateway for SQL Server.docx

《Oracle1129Transparent Gateway for SQL Server.docx》由会员分享,可在线阅读,更多相关《Oracle1129Transparent Gateway for SQL Server.docx(24页珍藏版)》请在冰豆网上搜索。

Oracle1129Transparent Gateway for SQL Server.docx

Oracle1129TransparentGatewayforSQLServer

OracleTransparentGatewayforSQLServer安装配置说明

===========================================================

作者:

yaohuacheng()

发表于:

2008.04.1814:

46

分类:

一般分类

出处:

---------------------------------------------------------------

最近在Oracle里安装TransparentGatewayforSQLServer,遇到不少问题,终于在今天完全搞定,所以把一些注意问题记录下来。

通过Gateway,可以在Oracle里透明的访问其他不同的数据库,如SQLServer,DB2,Sybase等等,就像远程Oracle数据库一样。

各不同的数据为配置方式也大同小异,本文只说明SQLServer的安装。

Oracle的透明网关的安装其实也挺简单:

第一步,安装OracleTransparentGateway软件。

在9i中,Gateway软件就在那三张安装盘里;而在11g中是一个单独的安装文件,需要单独下载。

Oracle的Linux版本下载地址为:

安装过程比较简单,不再详述。

只要在选择产品里选择SQLServer的那个就可以了。

安装完Gateway软件后,在ORACLE_HOME目录下有一下dg4msql的目录(在9i里是tg4msql,之后的命令也相应的是tg4msql,不再复述),这就是Gateway软件的目录了。

第二步,配置Gateway的设置。

在dg4msql/admin目录下有一个initdg4msql.ora的文件。

该文件的格式是init.ora,这里的SID在后面需要用到,系统默认的是dg4msql,一般情况这样就可以了,如果改名,在之后使用这个修改后地名字即可,配合使用Agency,则文件名变成initAgency.ora。

该文件是Gateway的初始参数文件,描述连接的是哪个SQLServer数据库。

文件内容如下HS_FDS_CONNECT_INFO=172.28.2.31:

1433//AgencyHS_FDS_TRACE_LEVEL=OFFHS_FDS_RECOVERY_ACCOUNT=RECOVERHS_FDS_RECOVERY_PWD=RECOVER只要修改HS_FDS_CONNECT_INFO参数就可以了。

格式是:

hostname:

port/serverinstance/databasename,其中hostname是机器名称或IP,PORT是SQLServer的端口号,SQLServer2005默认为1433(题外话:

在Oracle的安装文档里没有指定这个PORT,所以无法正确使用,我在这儿搞了很长时间才从网上找到原因,看来Oracle也不能太相信了!

)serverinstance是SQLServer的实例名,不知道什么时候SQLServer也搞起实例来了,一般空着就行。

Databasename是SQLServer的数据库名,好像也可以空着,不过我还是指定了。

这一步需要注意的就是那个端口号了。

另外在9i中格式跟这个不一样,是"SERVER=dataserver;DATABASE=Agency"。

第三步,配置监听器。

在listener.ora文件里加入以下内容:

SID_LIST_LISTENER=(SID_LIST=(SID_DESC=(PROGRAM=dg4msql)(SID_NAME=Agency)(ORACLE_HOME=/opt/oracle/product/11.1.0.6)))这里PROGRAM指定应用程序名称,不能改变。

SID_NAME就是前面init.ora文件名里指定的SID,ORACLE_HOME没什么说的吧?

这一步需要注意的是在集群环境下,SID_LIST_LISTENER也应该是这个名称而不应该是类似于SID_LIST_LISTENER_DBRAC1,SID_LIST_LISTENER_DBRAC2这样的名称。

不同机器下内容一样就可以了。

这也是我遇到的问题。

第四步,配置tnsnames.ora

Agency=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.28.2.21)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=172.28.2.22)(PORT=1521))(CONNECT_DATA=(SID=Agency))(HS=OK))此处的SID也是init.ora文件名中指定的SID。

与一般配置不同的就是(HS=OK)这句,这句指定是外部程序而不是Oracle数据库实例

第五步,创建DBLink

跟一般的DBLink一样,没什么说的,using子句里使用tnsnames.ora里配置的entry即可。

createpublicdatabaselinkAGENCYconnecttoSAidentifiedby"1"using'Agency';

第六步,使用数据库连接

按一般的数据库连接使用:

Selectcount(*)fromarea@Agency;注意事项不同版本的名称不同init.ora文件里的端口号集群环境的监听器配置Tnsnames.ora里的(HS=OK)未说明的重要问题事务问题

 

re:

OracleTransparentGatewayforSQLServer安装配置说明[回复]

楼主是否曾出现过连接代理时NET8诊断到错误.

如果有,请帮忙指点指点.

tnsnames.ora与listener.ora这两个文件分别是db_1下的文件,还是gt_1下的文件,或者是client_1下的文件,请帮忙指点下。

谢谢!

因为我用同样的方法已经试过了,没有见效,总是出现上面的错误。

东风破评论于:

2008.06.1110:

02

re:

OracleTransparentGatewayforSQLServer安装配置说明[回复]

9ConfiguringOracleDatabaseGatewayforSQLServer

Afterinstallingthegateway,performthefollowingtaskstoconfigureOracleDatabaseGatewayforSQLServer:

1.ConfiguretheGatewayInitializationParameterFile

2.ConfigureOracleNetfortheGateway

3.ConfiguretheOracleDatabaseforGatewayAccess

4.CreateDatabaseLinks

5.ConfigureTwo-PhaseCommit

6.CreateSQLServerViewsforDataDictionarySupport

7.EncryptGatewayInitializationParameterValues

8.ConfiguretheGatewaytoAccessMultipleSQLServerDatabases

ConfiguretheGatewayInitializationParameterFile

Performthefollowingtaskstoconfigurethegatewayinitializationparameterfile:

1.ChooseaSystemIdentifierfortheGateway

2.CustomizetheInitializationParameterFile

ChooseaSystemIdentifierfortheGateway

Thegatewaysystemidentifier(SID)isanalphanumericcharacterstringthatidentifiesagatewayinstance.Youneedonegatewayinstance,andthereforeonegatewaySID,foreachSQLServerdatabaseyouareaccessing.TheSIDisusedaspartofthefilenamefortheinitializationparameterfile.ThedefaultSIDisdg4msql.

YoucandefineagatewaySID,butusingthedefaultofdg4msqliseasierbecauseyoudonotneedtochangetheinitializationparameterfilename.However,ifyouwanttoaccesstwoSQLServerdatabases,youneedtwogatewaySIDs,oneforeachinstanceofthegateway.IfyouhaveonlyoneSQLServerdatabaseandwanttoaccessitsometimeswithonesetofgatewayparametersettings,andothertimeswithdifferentgatewayparametersettings,thenyouwillneedmultiplegatewaySIDsforthesingleSQLServerdatabase.

CustomizetheInitializationParameterFile

Theinitializationparameterfilemustbeavailablewhenthegatewayisstarted.Duringinstallation,thefollowingdefaultinitializationparameterfileiscreated:

ORACLE_HOMEdg4msqladmininitdg4msql.ora

WhereORACLE_HOMEisthedirectoryunderwhichthegatewayisinstalled.

ThisinitializationfileisforthedefaultgatewaySID.Ifyouarenotusingdg4msqlasthegatewaySID,youmustrenametheinitializationparameterfileusingtheSIDyouchoseintheprecedingstep"ChooseaSystemIdentifierfortheGateway".Thisdefaultinitializationparameterfileissufficientforstartingthegateway,verifyingasuccessfulinstallation,andrunningthedemonstrationscripts.

Anumberofinitializationparameterscanbeusedtomodifythegatewaybehavior.RefertoAppendixC,"InitializationParameters"forthecompletelistofinitializationparametersthatcanbeset.Changesmadetotheinitializationparametersonlytakeeffectinthenextgatewaysession.ThemostimportantparameteristheHS_FDS_CONNECT_INFOwhichdescribestheconnectiontothenon-Oraclesystem.

Thedefaultinitializationparameterfilealreadyhasanentryforthisparameter.ThesyntaxforHS_FDS_CONNECT_INFOisasfollows:

HS_FDS_CONNECT_INFO=host_name/[instance_name][/database_name]

Where:

VariableDescription

host_nameisthehostnameorIPaddressofthemachinehostingtheSQLServerdatabase.

instance_nameistheinstanceofSQLServerrunningonthemachine.

database_nameistheSQLServerDatabasedatabasename.

Bothinstance_nameanddatabase_nameareoptional.Ifinstance_nameisomittedanddatabase_nameisprovided,theslash(/)isrequired.Thiscanbeshownasfollows:

HS_FDS_CONNECT_INFO=host_name//database_name

SeeAlso:

AppendixC,"InitializationParameters"andOracleDatabaseHeterogeneousConnectivityAdministrator'sGuideformoreinformationaboutcustomizingtheinitializationparameterfile.

ConfigureOracleNetfortheGateway

ThegatewayrequiresOracleNettocommunicatewiththeOracledatabase.Afterconfiguringthegateway,performthefollowingtaskstoconfigureOracleNettoworkwiththegateway:

1.ConfigureOracleNetListenerfortheGateway

2.StopandStarttheOracleNetListenerfortheGateway

ConfigureOracleNetListenerfortheGateway

TheOracleNetListenerlistensforincomingrequestsfromtheOracledatabase.FortheOracleNetListenertolistenforthegateway,informationaboutthegatewaymustbeaddedtotheOracleNetListenerconfigurationfile,listener.ora.ThisfilebydefaultislocatedinORACLE_HOMEnetworkadmin,whereORACLE_HOMEisthedirectoryunderwhichthegatewayisinstalled.

Thefollowingentriesmustbeaddedtothelistener.orafile:

•AlistofOracleNetaddressesonwhichtheOracleNetListenerlistens

•TheexecutablenameofthegatewaythattheOracleNetListenerstartsinresponsetoincomingconnectionrequests

Asampleofthelistener.oraentry(listener.ora.sample)isavailableintheORACLE_HOMEdg4msqladmindirectorywhereORACLE_HOMEisthedirectoryunderwhichthegatewayisinstalled.

Syntaxoflistener.oraFileEntries

TheOracledatabasecommunicateswiththegatewayusingOracleNetandanysupportedprotocoladapters.ThefollowingisthesyntaxoftheaddressonwhichtheOracleNetListenerlistensusingtheTCP/IPprotocoladapter:

LISTENER=

(ADDRESS=

(PROTOCOL=TCP)

(HOST=host_name)

(PORT=port_number))

Where:

VariableDescription

host_namespecifiesthenameofthemachineonwhichthegatewayisinstalled.

port_numberspecifiestheportnumberusedbytheOracleNetListener.Ifyouhaveotherlistenersrunningonthesamemachine,thenthevalueofport_numbermustbedifferentfromtheotherlisteners'portnumbers.

TodirecttheOracleNetListenertostartthegatewayinresponsetoincomingconnectionrequests,addanentrytothelistener.orafile.

Note:

YoumustusethesameSIDvalueinthelistener.orafileandthetnsnames.orafilewhichwillbeconfiguredinthenextstep.

SID_LIST_LISTENER=

(SID_LIST=

(SID_DESC=

(SID_NAME=gateway_sid)

(ORACLE_HOME=oracle_home_directory)

(PROGRAM=dg4msql)

Where:

VariableDescription

gateway_sidspecifiestheSIDofthegatewayandmatchesthegatewaySIDspecifiedintheconnectdescriptorentryinthetnsnames.orafile.

oracle_home_directoryspecifiestheOraclehomedirectorywherethegatewayresides.

dg4msqlspecifiestheexecutablenameoftheOracleDatabaseGatewayforSQLServer.

IfyoualreadyhaveanexistingOracleNetListener,thenaddthefollowingsyntaxtoSID_LISTintheexistinglistener.orafile:

SID_LIST_LISTENER=

(SID_LIST=

(SID_DESC=.

.

(SID_DESC=.

.

(SID_DESC=

(SID_NAME=gateway_sid)

(ORACLE_HOME=oracle_home_directory)

(PROGRAM=dg4msql)

SeeAlso:

OracleDatabaseNetServicesAdministrator'sGuideforinformationaboutchangingthelistener.orafile.

StopandStarttheOracleNetListenerfortheGateway

YoumuststopandrestarttheOracleNetListenertoinitiatethenewsettings,asfollows:

1.FromtheStartmenu,selectSettings,ControlPanelandthenselectServices.

2.SelecttheOracleNetListenerserviceforthegateway.

3.Iftheserviceisalreadyrunning,clickStoptostopit.

4.ClickStarttostartorrestarttheservice.

ConfiguretheO

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 医药卫生 > 基础医学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1