Oracle数据库从10g开始使用ASM,ASM实例正常情况下都是mount状态,所以如果使用password命令,或者alter user sys identified by xxx;去修改密码的话通常会报错,无法修改。
Oracle提供了修改ASM的方法,直接生成pwfile去修改,参考:How To Change ASM SYS PASSWORD ? (Doc ID 452076.1)
1. Set the ORACLE_HOME and ORACLE_SID to the ASM instance
2. connect /as sysdba from sqlplus
3. If the value of the "remote_login_passwordfile" parameter in the pfile or spfile is EXCLUSIVE, you must shutdown your instance
4. RENAME or DELETE the existing password file PWD<SID>.ora( In Windows) / orapw<SID> ( in UNIX)
5. Issue the command:
WINDOWS:
orapwd file=<ORACLE_HOME>/database/PWD<SID>.ora password=<sys_password>
UNIX:
orapwd file=<ORACLE_HOME>/dbs/orapw<SID> password=<sys_password>
在11g R2之后,还可以使用asmcmd命令去修改:
单机环境:
-
$ export ORACLE_SID=+ASM
-
-
$ asmcmd
-
-
ASMCMD> passwd sys
-
Enter old password (optional): ******
-
Enter new password: ******
集群RAC环境:
-
ASMCMD> orapwusr --modify --password sys
-
-
Enter password: ******
-
ASMCMD> exit
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23850820/viewspace-2123139/
,如需转载,请注明出处,否则将追究法律责任。