最近有个金融客户在oracle 11g ASM instance中创建用户时报错ORA-15306 和ORA-15321,做oracle 近20年DBA这错还是第一次见,最近几年国产化改造,有些国产的同步软件,需要在ASM Instance创建用户读取里面的归档。但之前也有创建过未曾遇到过。
su - grid
sqlplus / as sysasm
SQL> create user dataxxx identified by "xxxxxxxxx"
ERROR at line 1:
ORA-15306: ASM password file update failed on at least one node
ORA-15321: cannot set attribute with connected clients
ORA-15321: cannot set attribute with connected clients
Cause: The disk group attribute could not be set because there were connected clients.
Action: Shut down connected clients and retry the command. Query the V$ASM_CLIENT fixed view in an ASM instance or use ASMCMD LSCT to list active clients.
没理由关掉所有db 实例吧?全网居然找不到相同报错, 如果错误少见,那多数是低级错误或非常规环境。
在How to create asmsnmp user in ASM instance(11g). 有个案例是在密码时提示ORA-15306: ASM password file update failed on at least one node,那是因为密码文件中没有这个用户。 那创建用户报错,是不是可能没有密码文件?
检查密码文件
这是查询 ASM 实例密码文件位置最直接的方法。
[grid@node01 dbs]$ crsctl stat res ora.asm -p | grep -i pw
PWFILE=+OCR/orapwASM
PWFILE_BACKUP=+OCR/orapwASM_backup
[grid@node01 dbs]$ asmcmd pwget --asm
+OCR/orapwASM
或直接在操作系统上查,因为从Oracle 12c(12.1)开始支持将 ASM 实例和数据库实例的 Password File 存放在 ASM 磁盘组中,实现集群节点间共享密码文件。11g 只能在本地。
su - grid
cd $ORACLE_HOME/dbs
ls -l
确实没有。
解决方法
创建ASM密码文件
A) Create a password file if not already present
$orapwd file=/u01/app/11.2.0/grid/dbs/orapw+ASM password=<sys_password>
Remember below important point about password file in ASM
If there are two nodes with +ASM1 running on node 1 and +ASM2 running on node2.
– Pre 11gR2 –
Password file on Node1: orapw+ASM1
Password file on Node2: orapw+ASM2
– 11gR2 –
Password file on Node1: orapw+ASM
Password file on Node2: orapw+ASM
B) Copy the password file to other nodes
$ scp orapw+ASM :/u01/app/11.2.0/grid/dbs/
如果不复制到其他节点,这步创建用户也会报同样的错误
ORA-15306: ASM password file update failed on at least one node
ORA-15321: cannot set attribute with connected clients
接下来就和DB instance创建用户一样了。