oracle asm 12c and later
问题概述
在grid用户修改sys密码后,再使用密码远程登录报错,提示用户名或者密码不对。
示例:
sqlplus / as sysasm
alter user sys identified by syspass;
--远程登录,提示用户名或者密码错误
sqlplus sys/syspass@ip:1521/+ASM as sysasm
ORA-01017: invalid username/password; logon denied
问题原因
asm密码文件缺失及asm sys用户无sysasm权限。
解决方案
以下均在grid用户下操作:
srvctl config asm
显示Passworld File为空
--手动创建asm密码文件
orapwd file='+DG_ORA/orapwasm' ASM=y
提示报错:
ORA-15221: ASM operation requires compatible.asm of 12.1.0.0.0 or higher
--检查asm 的compatibility,发现10.2.0.0.0
select group_number, name,compatibility, database_compatibility from v$asm_diskgroup;
对比其它正常环境,均为19.0.0.0.0
--修改DG_ORA磁盘组compatibility
alter diskgroup DG_ORA set attribute 'compatible.asm'='19.0.0.0.0';
--然后重新创建密码文件成功
orapwd file='+DG_ORA/orapwasm' ASM=y
srvctl config asm
显示Passworld File正确配置
--连接测试,报 insufficient privileges错误
sqlplus sys/syspass@ip:1521/+ASM as sysasm
--检查sys权限
asmcmd
ASMCMD> lspwusr
Username sysdba sysoper sysasm
SYS TRUE TRUE FALSE
检查发现sys用户无sysasm权限
--手工进行授权
sqlplus / as sysasm
grant sysasm to sys;
--最后可以验证连接,可以正常连接
sqlplus sys/syspass@ip:1521/+ASM as sysasm