RAC 环境的 Oracle 连接字符串?

我有一个 ORACLE RAC 环境访问权限.详细信息是

I have got an ORACLE RAC Environment access .The details are

数据库名称:orcl服务名称:orclIP 地址:192.168.1.1 和 192.168.1.2

Database Name: orcl Service Name: orcl IP Address: 192.168.1.1 and 192.168.1.2

SQL> host srvctl status database -d orcl

Instance orcl1 is running on node orclnode1

Instance orcl2 is running on node orclnode2

我担心的是我的连接,它是使用

My concern is my connection, which is being established using

(DESCRIPTION=(ADDRESS=
    (PROTOCOL=TCP)(HOST=192.168.1.1) (PORT=1521)
)(CONNECT_DATA=(SID=orcl1)))

但是提供者希望它通过 orcl 服务名称连接.

But the provider wants it to be connected via the orcl service name .

我没有与此相关的任何其他信息.我是否正确连接或我需要主机名或 IP 地址作为 orcl 服务名称.

I don`t have any other info related to this. Am I connecting correctly or I need hostname or IP address for orcl service name.

推荐答案

您的连接字符串正在引用一台服务器/节点上的一个实例.您应该改用公共服务名称,并标识它可用的所有服务器.

Your connection string is referencing one instance on one server/node. You should be using the common service name instead, and identifying all the servers it is available on.

你的等价物是这样的(为了清楚起见,这里换行):

The equivalent for you would be something like this (line breaks just for clarity here):

(DESCRIPTION=(ADDRESS_LIST=
    (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.1)(PORT=1521))
    (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.2)(PORT=1521))
)(CONNECT_DATA=(SERVICE_NAME=orcl)))

只要是可解析的,HOST 参数是使用 DNS 名称还是 IP 地址都没有关系.

As long as it is resolvable, it shouldn't matter whether you use the DNS names or the IP addresses for the HOST parameters.

您可能还需要 LOAD_BALANCEFAILOVER 参数;请参阅文档.

You may also need the LOAD_BALANCE or FAILOVER parameters; see the docs.

相关文章