I’m facing the problem about my database in Oracle, When I opened my database, it appear a message with: “ORA-28001: The password has expired”
I have updated my account with somes:
sqlplus /nolog
SQL> connect / as SYSDBA
Connected.
SQL> SELECT username, account_status FROM dba_users WHERE ACCOUNT_STATUS LIKE '%EXPIRED%';
SQL> ALTER USER system IDENTIFIED BY system;
User altered.
SQL> ALTER USER system ACCOUNT UNLOCK;
User altered.
SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
Profile altered.
SQL> exit
I check and see that, my account: ‘system’ has OPEN, but I open it on Oracle SQL Developer, it still have alert:
ORA-28001: The password has expired
I have refered very much links but it still same the problem, how to fix this?
asked Nov 14, 2016 at 2:34
7
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
alter user EPUSR100 identified by EPUSR100 account unlock;
commit;
OmG
18.2k8 gold badges54 silver badges89 bronze badges
answered Nov 14, 2017 at 1:51
YosraYosra
6715 silver badges2 bronze badges
I have fixed the problem, just need to check:
open_mode from v$database
and then check:
check account_status to get mode information
and then use:
alter user myuser identified by mynewpassword account unlock;
answered Nov 14, 2016 at 7:47
luongkhanhluongkhanh
1,7052 gold badges16 silver badges29 bronze badges
2
Try to connect with the users in SQL Plus, whose password has expired. it will prompt for the new password. Enter the new password and confirm password.
It will work
SQL Plus output image
answered Jan 21, 2019 at 6:38
1
Check “PASSWORD_LIFE_TIME” by
Sql > select * from dba_profiles;
Set to Never expire
Sql> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
Then reset the password of locked user.
answered Nov 14, 2016 at 4:19
user1979139user1979139
7545 silver badges5 bronze badges
1
C:>sqlplus /nolog
SQL> connect / as SYSDBA
SQL> select * from dba_profiles;
SQL> alter profile default limit password_life_time unlimited;
SQL> alter user database_name identified by new_password;
SQL> commit;
SQL> exit;
answered Apr 26, 2019 at 6:13
TaravatTaravat
1311 silver badge2 bronze badges
2
- Connect to Oracle
sqlplus sys/root as sysdba
- Check the status and expiry date for the user
SELECT username, account_status, expiry_date FROM dba_users;
- Change the password for the user to resolve expiry
ALTER USER dummy_user IDENTIFIED BY dummy_password;
- Unlock the user account if it locked
ALTER USER dummy_user ACCOUNT UNLOCK;
- Set the password expiry limit to unlimited to avoid issue in the future
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
- Again check the status of the user to verify the expiry date. The account status is now open and the expiry date is unlimited.
SELECT username, account_status, expiry_date FROM dba_users;
SQL commands:
sqlplus sys/root as sysdba
SELECT username, account_status, expiry_date FROM dba_users;
ALTER USER dummy_user IDENTIFIED BY dummy_password;
ALTER USER dummy_user ACCOUNT UNLOCK;
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
answered Mar 18, 2021 at 8:52
HarisudhaHarisudha
4725 silver badges5 bronze badges
I had same problem even after changing the password, it wasn’t getting reflected in SQLDEVELOPER.
Atlast following solved my problem :
- Open Command Propmt
- Type sqlplus
- login as sysdba
- Run following command :
alter user USERNAME identified by NEW_PASSWORD;
answered Oct 16, 2019 at 5:51
ShwetaShweta
2093 silver badges18 bronze badges
I had same problem, i am trying to login database it appear a message with: “ORA-28001: The password has expired” , I have fixed the problem simple steps
1.open command prompt
2.type sqlplus
3.It will ask Enter Password, you can give old password, it will show password has expired ORA-28001
4.It will ask new password and retype password
5.It will change with new password
6.Go to the sql database and try to connect with new password, it will connect.
answered Jul 20, 2020 at 16:05
I am running Oracle 18c in a Docker container, where the problematic database is a Pluggable database, so I had to take a different approach:
-
Log in to SYSDBA
-
Switch to Pluggagle Database
ALTER SESSION SET CONTAINER=XEPDB2;
-
Remove Password Expiry
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
-
Get Current User Details
SELECT dbms_metadata.get_ddl('USER','username') stmt from dual;
Replace the
username
above with your own.The output will be something like:
CREATE USER "…" IDENTIFIED BY VALUES '…'
-
To reset the password, run as:
ALTER USER "…" IDENTIFIED BY VALUES '…' ACCOUNT UNLOCK;
… using the username and password from the previous step.
This is a combination of other answers here and elsewhere.
answered Mar 2, 2022 at 1:57
ManngoManngo
13.5k10 gold badges83 silver badges105 bronze badges
1
If you get an additional error ORA-65066: The specified changes must apply to all containers
you have to switch first to the root cdb:
alter session set container=CDB$ROOT;
and then the alter command should work:
alter user USER identified by NEW_PASSWORD account unlock;
answered Jan 13 at 14:44
leon22leon22
5,22019 gold badges61 silver badges98 bronze badges
To know which users are expired, run command
SELECT * FROM <DATABASE USERS/PROFILES>;
To unlock users, run command
alter user identified by account unlock;
answered Aug 19, 2021 at 11:24
Simple..
Goto Command prompt and type
SQLPLUS /@connect string
Hit Enter.
It says password expired and provide the option to enter new password.
Enter new password and you are done.
answered May 21, 2021 at 6:17
1
Just go to the machine where your database resides, search windows -> search SqlPlus
Type the user name, then type password, it will prompt you to give new password. On providing new password, it will say successfully changed the password.
answered Jan 19, 2021 at 6:08
you are in wrong cdb/pdb so connect to right pdb
answered Aug 3, 2017 at 9:42
user3380585user3380585
1631 silver badge12 bronze badges
Перестало работать приложение, использующее СУБД Oracle XE, в логе сообщение об истечении срока действия пароля: ORA-28001: the password has expired.
При чем, было неизвестно под каким пользователем коннектится приложение. Но ясно, что искать надо просроченные пароли.
Приконнектиться к базе как супер админ:
conn / as sysdba
Посмотреть пользователей с истекшими паролями:
SQL> SELECT USERNAME,ACCOUNT_STATUS FROM dba_users WHERE ACCOUNT_STATUS LIKE '%EXPIRED%'; USERNAME ACCOUNT_STATUS ------------------------------ -------------------------------- DIP EXPIRED > LOCKED ORACLE_OCM EXPIRED > LOCKED DBSNMP EXPIRED > LOCKED APPQOSSYS EXPIRED > LOCKED ORAUSER EXPIRED > LOCKED
Стало ясно, что искомый пользователь ORAUSER. Теперь надо его разлочить и сменитьпереназначить пароль:
SQL> ALTER USER orauser ACCOUNT UNLOCK; User altered. SQL> ALTER USER orauser IDENTIFIED BY newpass; User altered.
Проверить статус и дополнительно посмотреть дату истечения пароля:
SQL> SELECT USERNAME,ACCOUNT_STATUS,EXPIRY_DATE FROM dba_users WHERE USERNAME LIKE '%ORAUSER%'; USERNAME ACCOUNT_STATUS EXPIRY_DA ------------------------------ -------------------------------- --------- ORAUSER OPEN 03-JAN-15
Видно, что учетка работает, но 3 января срок действия пароля снова истечет. Чтобы этого не происходило надо отключить данную возможность. Для этого надо узнать к какому профилю относится пользователь и отключить истечение времени действия пароля для этого профиля:
SQL> SELECT USERNAME,PROFILE from dba_users WHERE USERNAME LIKE '%ORAUSER%'; USERNAME PROFILE ------------------------------ ------------------------------ ORAUSER ORAPROFILE SQL> ALTER PROFILE oraprofile LIMIT PASSWORD_LIFE_TIME UNLIMITED; Profile altered.
Убедиться что все сработало. Поле EXPIRY_DATE должно быть пустым:
SQL> SELECT USERNAME,ACCOUNT_STATUS,EXPIRY_DATE FROM dba_users WHERE USERNAME LIKE '%ORAUSER%'; USERNAME ACCOUNT_STATUS EXPIRY_DA ------------------------------ -------------------------------- --------- ORAUSER OPEN
Все.
ORA-28001 means that your password has been expired according to your profile. Normally, you should change the password, but you can still work around it. Don’t be confused with ORA-28000: The account is locked, it’s a different account problem.
SQL> conn hr/hr
ERROR:
ORA-28001: the password has expired
While ORA-28001 alerts that the password has expired, ORA-28002 warns that the password will expired soon in grace time.
A preventive action is to make PASSWORD_LIFE_TIME into UNLIMITED in the profile, there will be no more expiration in the future. However, at this moment, the password expiration notice has been triggered, we need to solve it.
Solutions to ORA-28001
There’re several ways to solve ORA-28001.
- Change Password
- Defer Expiration
- Set Original Password
The formal way to solve it is to change the password.
An unofficial way to solve it is to revert the expiration.
If you want to set the original password, you can try this way.
Change Password
Of course, user can change the password immediately at connect-time.
Changing password for hr
New password:
Retype new password:
Password changed
Connected.
A privileged user can do it too.
SQL> conn / as sysdba
Connected.
SQL> alter user hr identified by hr;
User altered.
You can also use various GUI tools to change the password.
Defer Expiration
For senior DBA, you may consider to defer the password expiration.
Set Original Password
In some cases, changing password can not be done because the password is bound to specific application and even worse, no one remember the original one! So is there any way to unexpire the password? No, at least no direct syntax supports that, we have to set the original password for our user.
Here comes a question, where to find the original password? For 10g and early versions, just lookup the PASSWORD column in the dictionary view DBA_USERS, which is the encrypted value of password. But for later versions, the column is deprecated and shows nothing.
Now, let’s see what we can do to find the original password.
1. Generate the user’s DDL.
SQL> conn / as sysdba
Connected.
SQL> set long 4000;
SQL> select dbms_metadata.get_ddl('USER','HR') stmt from dual;
STMT
--------------------------------------------------------------------------------
CREATE USER "HR" IDENTIFIED BY VALUES 'S:E129CFF697C9B08E613D3B22B13DC1124B80
F9346C79FAECF8426B7F3580;T:3716DFD59DAF47A9DA01E6EAE75FC3A86D4911C6FD494F5517FE1
4E19F89E781BF193E27338CE1D8F3BEE184B1B22DD1B5C3A6A355E7EB7118E53C30B5CE60E246916
2F618D658D761207BDF81523871'
DEFAULT TABLESPACE "EXAMPLE"
TEMPORARY TABLESPACE "TEMP"
PASSWORD EXPIRE
2. Set Password by VALUES String
In the output, the string follows IDENTIFIED BY VALUES is the original encrypted password. We can use it to set the password. Just don’t forget to remove line breaks in betweens before using it.
SQL> alter USER "HR" IDENTIFIED BY VALUES 'S:E129CFF697C9B08E613D3B22B13DC1124B80F9346C79FAECF8426B7F3580;T:3716DFD59DAF47A9DA01E6EAE75FC3A86D4911C6FD494F5517FE14E19F89E781BF193E27338CE1D8F3BEE184B1B22DD1B5C3A6A355E7EB7118E53C30B5CE60E2469162F618D658D761207BDF81523871';
User altered.
Now the user’s password is unexpired, just like nothing happened.
SQL> conn hr/hr;
Connected.
Please note that, changing the profile with unlimited PASSWORD_LIFE_TIME for the user can not save ORA-28001 at this moment. But it makes your password unexpired afterwards.
Open SQL Developer and perform the following steps:
-
Right click on Connections > New Connection.
- Connection Name: sys
- Username: sys as sysdba
- Password: sys (or your sys password)
- Hostname: your database server IP
- Port: 1521
- SID: your sid
click connect.
-
Expand other users, and choose the user with the expired password. Right click and “edit” the user, enter the new password and confirm it.
If you want your password to never expire again uncheck the box for password expiry.
Ben
51.4k36 gold badges127 silver badges148 bronze badges
answered Jun 1, 2013 at 7:56
Mahmoud SalehMahmoud Saleh
33.4k119 gold badges337 silver badges496 bronze badges
3
Перейти к содержимому
Приложение перестало соединяться с базой данных Oracle. В логе — ошибка:
ORA-28001: the password has expired |
(это означает, что срок действия пароля истек)
Смотрим, у каких пользователей срок истёк:
select username,ACCOUNT_STATUS,EXPIRY_DATE from dba_users; |
Устанавливаем бесконечный срок для пароля:
ALTER PROFILE default LIMIT password_life_time UNLIMITED; |
После чего всё-таки придётся законнектиться sqlplus-ом под нужным пользователем и сменить пароль. Также нужно не забыть поменять его в приложении.