oracle 10g 远程连接asm

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了oracle 10g 远程连接asm相关的知识,希望对你有一定的参考价值。

asm远程连接可能会遇到以下报错:

ORA-12505 TNS:listener could not resolve SID given in connect descriptor
ORA-12541: TNS:no listener
ORA-15000: command disallowed by current instance type
ORA-12528: TNS:listener: all appropriate instances are blocking new connections
ORA-1031:   insufficient privileges

asm远程连接配置如下:
参数配置:

remote_login_passwordfile = exclusive ... for stand alone ASM setups
remote_login_passwordfile = shared ... for ASM setups that also use Real Application Cluster (RAC)

节点1:

[[email protected] admin]$ cat listener.ora 
SID_LIST_LISTENER_prodb1 =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
      (PROGRAM = extproc)
     (SID_DESC =
       (SID_NAME = +ASM1)  
       (GLOBAL_DBNAME  = +ASM)  
       (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
    )
  )

LISTENER_prodb1 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = prodb1-vip)(PORT = 1521)(IP = FIRST))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.10.101)(PORT = 1521)(IP = FIRST))
    )
  )

节点2:

[[email protected] admin]$ cat listener.ora 

SID_LIST_LISTENER_prodb2 =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
      (PROGRAM = extproc)
     (SID_DESC =
       (SID_NAME = +ASM2)  
       (GLOBAL_DBNAME  = +ASM)  
       (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
    )
  )

LISTENER_prodb2 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = prodb2-vip)(PORT = 1521)(IP = FIRST))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.10.102)(PORT = 1521)(IP = FIRST))
    )
  )

客户端tnsname.ora:

ASM1 =  
   (DESCRIPTION =  
     (ADDRESS_LIST =  
       (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.10.101)(PORT = 1521))  
     )  
     (CONNECT_DATA =  
       (SERVICE_NAME = +ASM)  
    (UR=A)
     )  
   )  

ASM2 =  
   (DESCRIPTION =  
     (ADDRESS_LIST =  
       (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.10.102)(PORT = 1521))  
     )  
     (CONNECT_DATA =  
       (SERVICE_NAME = +ASM)  
    (UR=A)
     )  
   )

ASM =  
   (DESCRIPTION =  
     (ADDRESS_LIST =  
       (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.10.102)(PORT = 1521))  
       (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.10.101)(PORT = 1521))
     )  
     (CONNECT_DATA =  
       (SERVICE_NAME = +ASM)  
    (UR=A)
     )  
   )

关键部分为 (UR=A),如果不配置该选项,则连接的时候报:

$ sqlplus sys/[email protected] as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on чǚ? 7? 5 21:44:30 2018

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

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

UR=A选项通常用来连接使用nomount,mount或restricted模式启动数据库。

数据库启动到nomount,监听状态为BLOCKED;
数据库启动到mount,监听状态为READY;
数据库启动到restrict,监听状态为RESTRICT;
静态注册的asm为BLOCKED

参考自:How to connect to ASM instance from a remote client (Oracle Net) (文档 ID 340277.1)

以上是关于oracle 10g 远程连接asm的主要内容,如果未能解决你的问题,请参考以下文章

ORACLE10g R2RAC+ASM→RAC+ASM

oracle10G rac asm 安装总结

rhel5下ORACLE 10g之ASM创建

ORACLE10g R2RAC+ASM→单实例FS

翻译自mos文章使用asm来部署 超大数据库(10TB到PB 范围)--针对oracle 10G

oracle 第二个数据库实例,用plsql不能连接