第一种情况,不知道该用户的密码,以管理员身份或者其他有权限的用户更改。
1、以system或者sys的身份登录。登录语句sqlplus system/psw@ora_name或者sqlplus sys/psw@ora_name as sysdba。
2、alter语句修改用户user1的密码。alter user user1 identified by new_psw;
3、password修改。password user1。之后按照提示输入新密码即可。
第二种情况,知道用户密码,以该用户user1登录进入数据库。
1、登录。sqlplus user1/psw@ora_name。
2、alter语句修改用户user1的密码。alter user user1 identified by new_psw;这种方式不需要再次输入旧密码
3、password语句。password user; 之后依次输入原密码,再输入新密码并确认即可。