Oracle User Password Reset : Two different methods – SQL*Plus and alter user

advertisements

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World
Method 1: Using SQL*Plus password command

If you connected as sys and trying to reset the password for other user it will not ask for old password.

SQL> connect / as sysdba
Connected.
SQL> show user
USER is "SYS"
SQL> password scott
Changing password for scott
New password:
Retype new password:
Password changed

Reset the user password from its own login.

SQL> connect scott/tiger
Connected.
SQL> show user
USER is "SCOTT"
SQL> password
Changing password for SCOTT
Old password:
New password:
Retype new password:
Password changed

Method 2: using alter user command

SQL>  alter user scott identified by tiger;

User altered.

How to deal with alpha numeric character in the password?

If you include any alpha numeric character in the password the alter user command will not accept without double quotes. See the example below. For the SQL*Plus password command it doesn’t matter as it takes the alpha numeric charters without quotes.

SQL> alter user scott identified by 123*new;
alter user scott identified by 123*new
                                   *
ERROR at line 1:
ORA-00922: missing or invalid option

SQL> alter user scott identified by "123*new";

User altered.

_____________________________________________________________________________________________________________________

Website Stats

0 comments:

Post a Comment

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-23 All Rights Reserved | Site Map | Contact | Disclaimer