In the process of using Oracle database, we will inevitably encounter some problems, such as forgetting the sys password of the administrator account. In this case, we need to take some measures to solve the problem so that we can regain the permissions of the sys account. In this article, we will provide you with some methods and techniques to solve the problem of forgetting Oracle sys password.
1. Use SYSDBA permissions to change the password
sqlplus / as sysdba
alter user sys identified by 新密码;
Note: Enter The password will not be displayed. So you need to enter the password first and then press Enter to confirm.
2. Use the orapwd tool to reset the SYS password
orapwd file=sys_password password=新密码 entries=1 force=yes
alter system set remote_login_passwordfile='EXCLUSIVE';
3. Use SQL*Plus to reset the SYS password
sqlplus sys/旧密码 as sysdba
alter user sys identified by 新密码;
Summary:
In general, if we encounter the situation of forgetting the oracle sys password, we can use the above three methods to reset the password. The first method is relatively simple to use SYSDBA permissions to change the password, but it requires the use of SYSDBA permissions; the second method uses the orapwd tool to reset the password file, which is more flexible, but requires the use of the operating system command line; the third method uses SQL*Plus is more convenient to reset the password, but you need to know the old password. Therefore, choose the appropriate method according to your own situation to quickly restore the permissions of the oracle sys account.
The above is the detailed content of What to do if you forget your oracle sys password?. For more information, please follow other related articles on the PHP Chinese website!