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

时间:2021-11-23 21:32:33

环境: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:

[oracle@db01 admin]$ sqlplus infa/infa@asm12c1 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:

[oracle@db01 admin]$ sqlplus infa/infa@asm12c2 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> 

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