Unable to connect to read only database, Getting error ORA-00604 ORA-16000 (Doc ID 461653.1)

Applies to:

Oracle Server - Enterprise Edition - Version 9.2.0.1 to 10.2.0.1 [Release 9.2 to 10.2]
Information in this document applies to any platform.

Symptoms

A read-only database is cloned from a read-write production database.
The read-only database is brought to sync with the production database everyday and is used only for reporting.

At times, users are unable to connect to the database, otherwise they can login to the read-only database without any problem.

The error they receive is:
ORA-00604: Error occurred at recursive SQL line 1
ORA-16000: Database open for read-only access

Changes

Profile has been set for the users connecting to the read-only database.

SQL> select RESOURCE_NAME,RESOURCE_TYPE,LIMIT from dba_profiles where profile='NEWBIZUSERS';


RESOURCE_NAME                     RESOURCE             LIMIT
----------------------------      --------     --------------------
....
FAILED_LOGIN_ATTEMPTS             PASSWORD        6
PASSWORD_LIFE_TIME                PASSWORD        60
PASSWORD_REUSE_TIME               PASSWORD        UNLIMITED
PASSWORD_REUSE_MAX                PASSWORD        5
PASSWORD_VERIFY_FUNCTION          PASSWORD        VERIFY_PASSWD_8CHAR
PASSWORD_LOCK_TIME                PASSWORD        UNLIMITED
PASSWORD_GRACE_TIME               PASSWORD        0

Cause

Errorstack for the error ORA-16000 shows that the following statement was being executed.

update user$ set name=:2,password=:3,datats#=:4,tempts#=:5,type#=:6,defrole=:7,
resource$=:8,ptime=DECODE(to_char(:9, 'YYYY-MM-DD'), '0000-00-00', to_date(NULL)
, :9),exptime=DECODE(to_char(:10, 'YYYY-MM-DD'), '0000-00-00', to_date(NULL), :
10),ltime=DECODE(to_char(:11, 'YYYY-MM-DD'), '0000-00-00', to_date(NULL), :11),
astatus=:12, lcount=:13, defschclass=:14 where user#=:1


In a read only database, update can't happen when the users try to connect, so the users were unable to connect and got the error
ORA-00604: Error occurred at recursove SQL line 1
ORA-16000: Database open for read-only access.

The field LCOUNT keeps track of the number of unsuccessful logins. It is reset when a successful login is made.

If for a user there is LCOUNT >0 in Production (which is a read write), that count is pushed to the READ
database after sync. Then the user attempts to log on to the READ with a correct password. Oracle
recognizes this and attempts to reset the LCOUNT in user$ in database, for this user id, to zero.
Because in a read only database, update can't happen when the users try to connect, so the users were unable to connect and got the error
ORA-00604: Error occurred at recursove SQL line 1
ORA-16000: Database open for read-only access.

Solution

For the users to always successfully connect to the read only database, the LCOUNT should never be > 0.
This can possibly be worked around either by disabling the profiles for the users, or by removing the FAILED_LOGIN_ATTEMPTS or setting it to unlimited.

==========

In a standby environment this could also be:
Bug 7581964 - Incorrect login to primary causes ORA-16000 on login to standby database
Applying the fix for bug 7581964 may resolve the issue.

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值