Open In App

How to Change the Oracle Database Password?

Last Updated : 26 Aug, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

Changing the password of an Oracle Database is an essential administrative task that can be done through two main methods such as using the ALTER USER command or the PASSWORD command in the command prompt. Both methods are straightforward and offer flexibility depending on our preference for database interaction.

In this guide, we will explore both methods in detail and provide a step-by-step explanation of how to change an Oracle database password securely

How to Change the Password of the Oracle Database

There are two methods, to change the password of the Oracle database, i.e., the the PASSWORD and the PASSWORD command. Let’s understand each of these method in detail.

Change Oracle Database Password By using the ALTER USER command

1. log in to your Oracle database as you normally would. Here we log in as username system and password geeks123.

Oracle database login

2. Use ALTER USER command and specify the new password for your user

Syntax:

 ALTER USER  user_name IDENTIFIED BY new_password ;

ALTER USER Command

Here ‘system’ is a username and now the new password for ‘system’ becomes ‘Newgeeks123’ it means ‘system’ is now identified by password Newgeeks123. The password is changed from geeks123 to Newgeeks123.

Output:

results

3. You don’t need any other privileges to change your own password. The same command can be used to change the password for another user from your database, that user behaves as a proxy user. You can use that proxy user and a new set password to login into your database.

4. Now if trying to log in with an old password (geeks123) it will show an invalid credential as shown below, it will log in successfully when login with a new password (Newgeeks123.)

oracle database log in screen

Change the Oracle Database Password By using the PASSWORD command in the command prompt.

1. Open command prompt window, enter sqlplus command to login into Oracle database.

2. Enter your username and password.

3. It will show a message like connected to Oracle database and your version name as shown below.

command prompt

4. Enter the password at the SQL prompt. You will be prompted for your Old password and the New password.

5. Type your Old Password and press enter. Now type a New Password and press enter.

6. Enter the New Password again and press enter. You will receive a confirmation that your password has changed for the database to which you were logged in as shown below.

enter new passoword

Conclusion

Changing the password of an Oracle Database is a simple yet vital task to maintain security. By using either the ALTER USER command or the PASSWORD command in the command prompt, you can ensure your database credentials are updated effectively. Always remember to choose strong passwords and update them regularly to safeguard your database.



Next Article
Article Tags :
Practice Tags :

Similar Reads