Change the SYS user password in Oracle
For change the lost password of user, you need the admin user of Operating system from which oracle install or you can change with ORAPWD command of Oracle.
Change password with OS user
1. First login with the OS user in SQLPLUS.
For connect this you also have to modified the SQLNET.ORA file parameter has NONE to NTS value.
-- modify the SQLNET file at @ORACLE_HOME/network/admin/ location
SQLNET.AUTHENTICATION_SERVICES= (NTS)
sqlplus / as sysdba
2. After login, take backup of SYS user password.
Note: Backup is best may it used in any tool or any script.
SQL> SELECT spare4 FROM sys.user$ WHERE name = 'SYS';
SPARE4
-------------------------------------------------------------------------------------------------
S:DD1775444147818D189125F1DCBF48C471A2BB7980D4B1F894877DE2E278;H:7176A46E7C925506B740F6568554A6A1
SQL> SELECT USERNAME,PASSWORD_VERSIONS FROM DBA_USERS WHERE USERNAME = 'SYS';
USERNAME PASSWORD_VER ---------- ------------ SYS 10G 11G
3. Change the password with ALTER command
ALTER USER SYS IDENTIFIED BY [password];
ALTER USER SYS IDENTIFIED BY PASS123;
Change password with ORAPWD
1. Backup the old password file in Windows : ORACLE_HOME\database or Linux: ORACLE_HOME\dbs
2. Run the ORAPWD command to make a new file with new password.
C:\Users\ORACLE>orapwd file=C:\Oracle\dbhomeXE\database\PWDXE.ora password=Pass_123 entries=3
3. Test the new password:
C:\Users\ORACLE>sqlplus sys/Pass_123 as sysdba
SQL*Plus: Release 18.0.0.0.0 - Production on Tue Jul 14 14:45:23 2020
Version 18.4.0.0.0
Copyright (c) 1982, 2018, Oracle. All rights reserved.
Last Successful login time: Tue Jul 14 2020 14:45:00 +05:30
Connected to:
Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production
Version 18.4.0.0.0
SQL>