1 description
When we use the PL/SQL tool to log in to the database with the SYS user, we find that the prompt password is incorrect:
Ora-01017:invalid Username/password; Logon denied
What to do?
2 Modify login Password directly
Before using this method, you must confirm with the database administrator, do not remember the password, and after the modification to inform the rest of the user, the password is modified to prevent scolded ~ ~
In the database server, using Sqlplus/as SYSDBA, through the operating system authentication, directly logged into the database, there is no need to verify the password, and then modify the SYS user password:
ALTER USER SYS identified by Oracle;
This is where the SYS user's password is set to Oracle.
3 Modifying the authentication method
The Oracle Login authentication method includes password authentication and operating system authentication.
Operating system authentication, that is, Oracle believes that the operating system users are secure, when using Sqlplus login, do not verify the user password, direct login.
Password authentication means that Oracle believes that the user of the operating system is not secure and requires password authentication via password files. ORACLE's password file is typically stored in the $oracle_home/dba/directory with the name Orapw+sid.
Oracle restricts the use of password files by initializing parameter remote_login_passwordfile, which is described in detail below:
1) NONE
Remote_login_passwordfile=none indicates that password file verification is disabled at login, SYSDBA users can only log in to the database through operating system authentication, other methods such as PL/SQL, will report the ORA-01017 errors mentioned earlier.
The operating system authentication method involves the parameter sqlnet.authentication_services in the Sqlnet.ora ($ORACLE _home/network/admin directory):
A) NONE: Shut down the operating system certification, only through password file authentication;----
b) under the All:linux/unix platform, operating system authentication, but remote SYSDBA login still need password file authentication.
c) Nts:windows platform under the operating system certification.
2) EXCLUSIVE
Remote_login_passwordfile=exclusive that the exclusive mode uses the password file, which is the default value that is used in single-database single-instance environments. In this mode, SYSDBA users can be added, modified, deleted, and can modify the SYSDBA user password, recorded in the password file.
To view users who are granted SYSDBA permissions:
SELECT USERNAME from V$pwfile_users WHERE sysdba= ' TRUE ';
Add/Remove sysdba rights user in password file
REVOKE SYSDBA from Non-sys-user;
GRANT SYSDBA to Non-sys-user;
3) SHARED
In this mode, the use of password files can be shared among multiple databases, and password files cannot be modified, including the SYS user password cannot be modified. Oracle recommends that users who need SYSDBA permissions be set up in excusive mode first, and then modify the Remote_login_passwordfile to shared password files.
Modification Method:
Alter system set remote_login_passwordfile=shared Scope=spfile;
Then restart the database.
Through the above analysis, we can see that if PL/SQL login, the password is correct, but is not logged in, and said the password is not correct, we will use Sqlplus login on the database server, and then view the system parameters Remote_login_ Passwordfile whether the password file authentication is initiated, should be set to exclusive generally. At the same time attention Sqlnet.ora parameter sqlnet.authentication_services.
4 Summary
SYS user forgot password, or clearly the password is correct, but login times password wrong, do not worry.
About the sys password forgotten, or clearly correct, but reported that the password is not correct solution