How to modify the username and password of an oracle Database
Change the user name and password of the oracle database (Linux is used as an example). For more information, see.
I. Preparations before modification:
Use ssh to connect to the server as root,
Switch to oracle user: su-oracle (Press ENTER)
Use sqlplus to connect to the database: sqlplus/nolog (Press ENTER)
Log on to the sys user as an administrator: conn sys/sys as sysdba (Press ENTER)
The database is successfully connected. Now the preparation is complete.
2. Modify the user name.
After the database connection is successful, enter the following information after the SQL> prompt:
First, find the user needs to modify the user name: select user #, name from user $; (Press ENTER) -- for example: user # is equal to 66
Now you can modify the user name: update user $ set name = 'new user name' where user # = 66; (Press ENTER)
The system will prompt: 1 row updated. indicates that the modification is successful,
Enter commit; (Press ENTER) to submit the modification.
3. Change the user password.
After the database connection is successful, enter the new password "alter user Username identified by" after the prompt "SQL>" (Press ENTER)
Enter commit; (Press ENTER) to submit the modification.
Supplemented by other netizens:
The procedure is as follows:
SQL * Plus: Release 9.2.0.5.0-Production on Sunday November 21 13:32:34 2004
Copyright (c) 1982,200 2, Oracle Corporation. All rights reserved.
SQL> connect sys/oracle as sysdba
Connected.
SQL> select username, password from dba_users;
USERNAME PASSWORD
------------------------------------------------------------
SYS 8A8F025737A9097A
SYSTEM 2D594E86F93B17A1
DBSNMP E066D214D5421CCC
TOAD A1BA01CF0DD82695
OUTLN 4A3BA55E08595C81
WMSYS 7C9BA362F8314299
You have selected 6 rows.
SQL> connect system/oracle
Connected.
SQL> connect sys/oracle as sysdba
Connected.
Change User system Password to manager
SQL> alter user system identified by manager;
The user has changed.
Unlock a user
SQL> alter user system account unlock;
The user has changed.
SQL> select username, password from dba_users;
USERNAME PASSWORD
------------------------------------------------------------
SYS 8A8F025737A9097A
SYSTEM D4DF7931AB130E37
DBSNMP E066D214D5421CCC
TOAD A1BA01CF0DD82695
OUTLN 4A3BA55E08595C81
WMSYS 7C9BA362F8314299
You have selected 6 rows.
SQL> connect system/manager
Connected.
Then, you can perform any operations you want.
SQL> connect sys/oracle as sysdba
Connected.
Change the user's system password to a previous value.
SQL> alter user system identified by values '2d594e86f93b17a1 ';
The user has changed.
SQL> connect system/oracle
Connected.
SQL> connect sys/oracle as sysdba
Connected.
SQL> connect system/manager
ERROR:
ORA-01017: invalid username/password; logon denied
Warning: you are no longer connected to ORACLE.