oracle (ur=a),关于UR=A的测试 - osc_o8pkds53的个人空间 - OSCHINA - 中文开源技术交流社区...

当数据库在nomount,mount或者restricted这类特殊状态下,同时动态监听显示状态为BLOCKED,客户端无法直接连接到实例,此时可通过配置UR=A进行连接。最常见的场景就是10g版本的RAC,配置OGG时需要访问ASM实例的情况(实测11.2版本的RAC ASM实例动态监听的显示状态为Ready,无需添加UR=A配置即可连接)。下面是测试过程:

1.测试10.2.0.5连接ASM

**环境:**Oracle 10.2.0.5 RAC + ASM tnsnames.ora配置如下:

ASM =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.171)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = +ASM)

(INSTANCE_NAME = +ASM1)

)

监听状态如下:

[oracle@rac1-server admin]$ lsnrctl status

LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 14-FEB-2019 19:37:22

Copyright (c) 1991, 2010, Oracle. All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

STATUS of the LISTENER

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

Alias LISTENER_RAC1-SERVER

Version TNSLSNR for Linux: Version 10.2.0.5.0 - Production

Start Date 12-FEB-2019 12:59:06

Uptime 2 days 6 hr. 38 min. 15 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File /s01/oracle/product/10.2.0/db_1/network/admin/listener.ora

Listener Log File /s01/oracle/product/10.2.0/db_1/network/log/listener_rac1-server.log

Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.172)(PORT=1521)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.171)(PORT=1521)))

Services Summary...

Service "+ASM" has 1 instance(s).

Instance "+ASM1", status BLOCKED, has 1 handler(s) for this service...

Service "+ASM_XPT" has 1 instance(s).

Instance "+ASM1", status BLOCKED, has 1 handler(s) for this service...

Service "PLSExtProc" has 1 instance(s).

Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...

Service "SYS$SYS.KUPC$S_1_20170912101328.JY.ORACLE.COM" has 1 instance(s).

Instance "jy2", status READY, has 1 handler(s) for this service...

Service "jy.oracle.com" has 1 instance(s).

Instance "jy2", status READY, has 1 handler(s) for this service...

Service "jyXDB.oracle.com" has 1 instance(s).

Instance "jy2", status READY, has 1 handler(s) for this service...

Service "jy_XPT.oracle.com" has 1 instance(s).

Instance "jy2", status READY, has 1 handler(s) for this service...

Service "orcl" has 2 instance(s).

Instance "orcl1", status READY, has 2 handler(s) for this service...

Instance "orcl2", status READY, has 1 handler(s) for this service...

Service "orclXDB" has 2 instance(s).

Instance "orcl1", status READY, has 1 handler(s) for this service...

Instance "orcl2", status READY, has 1 handler(s) for this service...

Service "orcl_XPT" has 2 instance(s).

Instance "orcl1", status READY, has 2 handler(s) for this service...

Instance "orcl2", status READY, has 1 handler(s) for this service...

The command completed successfully

[oracle@rac1-server admin]$

此时如果通过网络连接ASM实例,会报错ORA-12528:

[oracle@rac1-server admin]$ sqlplus sys/oracle@asm as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Thu Feb 14 19:25:52 2019

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

ERROR:

ORA-12528: TNS:listener: all appropriate instances are blocking new connections

Enter user-name:

修改tnsnames.ora,增加UR=A配置:

ASM =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.171)(PORT = 1521))

(CONNECT_DATA =

(UR=A)

(SERVER = DEDICATED)

(SERVICE_NAME = +ASM)

(INSTANCE_NAME = +ASM1)

)

再次尝试通过网络连接ASM实例,可成功连接:

[oracle@rac1-server admin]$ sqlplus sys/oracle@asm as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Thu Feb 14 19:26:26 2019

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production

With the Partitioning, Real Application Clusters, OLAP, Data Mining

and Real Application Testing options

SQL>

2.测试11.2.0.4连接ASM

**环境:**Oracle 11.2.0.4 RAC + ASM tnsnames.ora配置如下:

ASM =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.107)(PORT = 1522))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = +ASM)

(INSTANCE_NAME = +ASM1)

)

)

监听状态如下:

[grid@db01 admin]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 14-FEB-2019 19:41:59

Copyright (c) 1991, 2013, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))

STATUS of the LISTENER

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

Alias LISTENER

Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production

Start Date 13-FEB-2019 11:28:44

Uptime 1 days 8 hr. 13 min. 14 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File /opt/app/11.2.0/grid/network/admin/listener.ora

Listener Log File /opt/app/grid/diag/tnslsnr/db01/listener/alert/log.xml

Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.107)(PORT=1522)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.117)(PORT=1522)))

Services Summary...

Service "+ASM" has 1 instance(s).

Instance "+ASM1", status READY, has 1 handler(s) for this service...

Service "A" has 1 instance(s).

Instance "orcl1", status READY, has 1 handler(s) for this service...

Service "B" has 1 instance(s).

Instance "orcl1", status READY, has 1 handler(s) for this service...

Service "orcl" has 1 instance(s).

Instance "orcl1", status READY, has 1 handler(s) for this service...

Service "orclXDB" has 1 instance(s).

Instance "orcl1", status READY, has 1 handler(s) for this service...

The command completed successfully

[grid@db01 admin]$

在没有配置UR=A的情况下,就可以正常连接到ASM实例:

--没有指定as sysasm会报错ORA-15000:

[oracle@db01 admin]$ sqlplus sys/oracle@asm

SQL*Plus: Release 11.2.0.4.0 Production on Thu Feb 14 19:23:57 2019

Copyright (c) 1982, 2013, Oracle. All rights reserved.

ERROR:

ORA-15000: command disallowed by current instance type

Enter user-name: ^C

--指定后就可以正常连接:

[oracle@db01 admin]$ sqlplus sys/oracle@asm as sysasm

SQL*Plus: Release 11.2.0.4.0 Production on Thu Feb 14 19:24:00 2019

Copyright (c) 1982, 2013, Oracle. All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Real Application Clusters and Automatic Storage Management options

SQL>

由此验证了11.2.0.4环境下,通过网络连接ASM实例,不再需要UR=A的配置。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值