【DG】DG备库报ORA-28000: the account is locked的解决办法
测试用户为lhr
现象:主备库的lhr用户的状态都是OPEN,但是,备库连接的时候报ORA-28000: the account is locked错误。在主库执行“alter user lhr identified by lhr account unlock;”同步到备库也不能解决,在备库该命令不能执行。
解决:重启DG环境的备库实例即可
参考:ORA-28000 On Active Data Guard (文档 ID 1922621.1)
用户密码请参考:http://blog.itpub.net/26736162/viewspace-2129595/
主库
SYS@oradg11g > alter user lhr identified by lhr account unlock; User altered. SYS@oradg11g > User altered. LHR@oradg11g > conn lhr/lhr USERNAME USER_ID PASSWORD ACCOUNT_STATUS LOCK_DATE EXPIRY_DATE DEFAULT_TABLESPACE TEMPORARY_TABLESPACE CREATED PROFILE INITIAL_RSRC_CONSUMER_GROUP EXTERNAL_NAME PASSWORD E AUTHENTI
|
备库:
LHR@oradgphy > conn lhr/aa ERROR: ORA-01017: invalid username/password; logon denied Warning: You are no longer connected to ORACLE. @ > conn lhr/aa @ > conn lhr/aa @ > ERROR: @ > @ > conn lhr/aa conn lhr/aa conn lhr/aa ERROR: @ > @ > @ > conn lhr/aa conn lhr/aa conn lhr/aa ERROR: @ > @ > @ > ERROR: @ > @ > @ > ERROR: @ > @ > @ > conn lhr/aa ERROR: @ > @ > ERROR: @ > @ > @ > ERROR: @ > @ > @ > ERROR: @ > @ > @ > @ > conn lhr/aa @ > @ > conn lhr/lhr @ > select * from dba_users where USERNAME='LHR'; USERNAME USER_ID PASSWORD ACCOUNT_STATUS LOCK_DATE EXPIRY_DATE DEFAULT_TABLESPACE TEMPORARY_TABLESPACE CREATED PROFILE INITIAL_RSRC_CONSUMER_GROUP EXTERNAL_NAME PASSWORD E AUTHENTI SYS@oradgphy > conn lhr/lhr Warning: You are no longer connected to ORACLE. Total System Global Area 242171904 bytes SYS@oradgphy > Database altered. SYS@oradgphy > SYS@oradgphy > SYS@oradgphy > SYS@oradgphy > SYS@oradgphy > SYS@oradgphy > alter database recover managed standby database cancel; Database altered. SYS@oradgphy > alter database open; SYS@oradgphy > conn lhr/lhr Warning: You are no longer connected to ORACLE. VALUE 11 rows selected. SYS@oradgphy > Database altered. SYS@oradgphy > SYS@oradgphy > SYS@oradgphy > col name for a100 THREAD# NAME SEQUENCE# ARC APPLIED NEXT_CHANGE# SYS@oradgphy > archive log list; THREAD# NAME SEQUENCE# ARC APPLIED NEXT_CHANGE# SYS@oradgphy > alter database recover managed standby database using current logfile disconnect from session; SYS@oradgphy > alter database recover managed standby database cancel; [1]+ Stopped rlwrap sqlplus / as sysdba SQL*Plus: Release 11.2.0.3.0 Production on Mon Sep 25 11:59:00 2017 Copyright (c) 1982, 2011, Oracle. All rights reserved. Connected to: SYS@oradgphy > alter database open readonly; SYS@oradgphy > Database altered. SYS@oradgphy > conn lhr/lhr
|
ORA-28000 On Active Data Guard (文档 ID 1922621.1) |
In this Document
Symptoms |
Cause |
Solution |
References |
APPLIES TO:
Oracle Database - Enterprise Edition - Version 11.2.0.1 and later
Information in this document applies to any platform.
SYMPTOMS
Noticed one user account was locked in primary and its Active Data Guard instances. It was fine Primary Database after unlocking the User, but at the Active Data Guard Standby Database, it was showing ORA-28000 that the account is still locked. Followed
Note 1600401.1: ORA-28000 "the account is locked" in the standby database, even after the account was unlocked in the primary
but it is still unlocked and user can not connect to standby database. Here is log:
SQL> select name,database_role , open_mode from v$database ;
NAME DATABASE_ROLE OPEN_MODE
--------- ---------------- --------------------
ELFVRFI1 PHYSICAL STANDBY READ ONLY
SQL> select username,account_status from dba_users where username = 'A472033';
USERNAME ACCOUNT_STATUS
------------------------------ --------------------------------
A472033 LOCKED(TIMED)
SQL> alter user A472033 account unlock ;
SQL> alter user A472033 account unlock
*
ERROR at line 1:
ORA-28015: Account unlocked, but the database is open for read-only access
CAUSE
This issue is detailed in
Bug 16345308: LOGGING INTO ADG STANDBY GETS ORA-28000: THE ACCOUT IS LOCKED. AND IS NOT
It is not a bug, but a limitation of an Active Data Guard READ ONLY Database
SOLUTION
Regardless of how the account becomes locked once locked it will stay locked in the Active Data Guard standby that is open read only.
You may have an account profile that sets how many times an incorrect password can be used before the account is locked.
In this case the standby instance needs to be restarted to reflect the correct status of the account again in the primary.
Or the profile may lock the account after it times out depending on the settings.
You can then unlock the account in the primary and the data dictionary is updated, but that which locks the account in memory is not.
So again you must restart the ADG standby. This is not a bug it is a limitation of a read only standby database.
The issues with applications that have Identity in the database and applications that have Identity in the front end app.
The later is not a problem for this issues. With Identity in the database it can be.
Per this note Bug 17732353 - ORA-28000 "the account is locked" attempting to log in as a remote SYSDBA user if SYS account is locked (Doc ID 17732353.8)
it is fixed in 12.1 and 12.2
REFERENCES
BUG:16345308 - LOGGING INTO ADG STANDBY GETS ORA-28000: THE ACCOUT IS LOCKED. AND IS NOT.
NOTE:1600401.1 - ORA-28000 "the account is locked" in the standby database, even after the account was unlocked in the primary.
NOTE:17732353.8 - Bug 17732353 - ORA-28000 "the account is locked" attempting to log in as a remote SYSDBA user if SYS account is locked
Bug 16345308 : LOGGING INTO ADG STANDBY GETS ORA-28000: THE ACCOUT IS LOCKED. AND IS NOT. |
|
||||
|
类型 | |||
|
>> >>>> >> >>>>>>>>