Direct mode does not support RAC.YOU can connect only to one fixed server
in RAC.
ODAC 控件中的Direct模式不支持Oracle RAC,只能够链接一个确定的RAC实例。
如果要使用ODAC控件连接Oracle RAC,则需要Oracel安装客户端,并且不使用Direct模式,
链接方式与ADO连接Oracle一致。
根据说明,安装Oracle客户端,安装好之后,查找tnsnames.ora文件
在文件增加文章来源:https://www.toymoban.com/news/detail-510971.html
DMSII=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.73)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.74)(PORT = 1521))
(LOAD_BALANCE = ON)
(FAILOVER = ON)
(CONNECT_DATA =
(SERVICE_NAME = DMSII)
(FAILOVER_MODE =
(TYPE = select)
(METHOD = BASIC)
(RETRIES = 30)
(DELAY = 5)
)
)
)
注意,DMSII前不能有空格
程序代码修改
orsn1.Username:=UserName;
orsn1.Password:=PassWord;
orsn1.Server:=服务名;
orsn1.Connect;
链接即可。文章来源地址https://www.toymoban.com/news/detail-510971.html
到了这里,关于Delphi7 ODAC控件连接Oracle RAC的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!