测试客户端连接12c ASM实例

Posted jyzhao

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了测试客户端连接12c ASM实例相关的知识,希望对你有一定的参考价值。

环境:Oracle 12.2.0.1 RAC
背景:用户反映12c ASM创建的用户具备sysasm权限,但无法在客户端连接到ASM实例,且没有报错。

1.ASM实例创建用户赋予sysasm权限

sqlplus / as sysasm

SQL> create user infa identified by infa;
User created.
SQL> grant sysasm to infa;
Grant succeeded.

2.客户端tnsnames.ora配置

分别针对ASM实例1和实例2配置对应的信息:

ASM12c1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.90)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = +ASM)
      (INSTANCE_NAME = +ASM1)
    )
  )
  
ASM12c2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.92)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = +ASM)
      (INSTANCE_NAME = +ASM2)
    )
  )

因为是12c版本,无需配置UR=A,关于UR=A可参考之前的测试:

3.客户端测试连接

客户端测试连接ASM12c1:

[[email protected] admin]$ sqlplus infa/[email protected] as sysasm

SQL*Plus: Release 11.2.0.4.0 Production on Wed Mar 13 22:45:53 2019

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> show parameter instance_name

NAME                                 TYPE
------------------------------------ ----------------------
VALUE
------------------------------
instance_name                        string
+ASM1
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

客户端测试连接ASM12c2:

[[email protected] admin]$ sqlplus infa/[email protected] as sysasm

SQL*Plus: Release 11.2.0.4.0 Production on Wed Mar 13 22:46:19 2019

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> show parameter instance_name

NAME                                 TYPE
------------------------------------ ----------------------
VALUE
------------------------------
instance_name                        string
+ASM2
SQL> 

我测试是没有任何问题的,明天连接实际客户环境再进一步看具体情况。

以上是关于测试客户端连接12c ASM实例的主要内容,如果未能解决你的问题,请参考以下文章

12C新特性 -- 共享asm口令文件

关于UR=A的测试

12C 启用客户端通过SID 连接PDB,防止ORA-12545

12C对ASM rebalance操作的优化

Oracle 12c应用连接VIP轮训负载均衡?

oracle 12c dbca 无法发现 asm diskgroup