I'm using Oracle for development. The password for a bootstrap account that I always use to rebuild my database has expired.
How do I turn off password expiration for this user (and all other users) permanently?
I'm using Oracle 11g, which has passwords expire by default.
I believe that the password expiration behavior, by default, is to never expire. However, you could set up a profile for your dev user set and set the
PASSWORD_LIFE_TIME
. See the orafaq for more details. You can see here for an example of one person's perspective and usage.For development you can disable password policy if no other profile was set (i.e. disable password expiration in default one):
Then, reset password and unlock user account. It should never expire again:
I will suggest its not a good idea to turn off the password expiration as it can lead to possible threats to confidentiality, integrity and availability of data.
However if you want so.
If you have proper access use following SQL
This should give you result like this.
Now you can use Pedro Carriço answer https://stackoverflow.com/a/6777079/2432468
To alter the password expiry policy for a certain user profile in Oracle first check which profile the user is using:
Then you can change the limit to never expire using:
If you want to previously check the limit you may use:
As the other answers state, changing the user's profile (e.g. the 'DEFAULT' profile) appropriately will lead to passwords, that once set, will never expire.
However, as one commenter points out, passwords set under the profile's old values may already be expired, and (if after the profile's specified grace period) the account locked.
The solution for expired passwords with locked accounts (as provided in an answering comment) is to use one version of the ALTER USER command:
However the unlock command only works for accounts where the account is actually locked, but not for those accounts that are in the grace period, i.e. where the password is expired but the account is not yet locked. For these accounts the password must be reset with another version of the ALTER USER command:
Below is a little SQL*Plus script that a privileged user (e.g. user 'SYS') can use to reset a user's password to the current existing hashed value stored in the database.
EDIT: Older versions of Oracle store the password or password-hash in the pword column, newer versions of Oracle store the password-hash in the spare4 column. Script below changed to collect the pword and spare4 columns, but to use the spare4 column to reset the user's account; modify as needed.