OCILogon在宽限期 - ORA-28002 [英] OCILogon during Grace Period - ORA-28002

查看:295
本文介绍了OCILogon在宽限期 - ORA-28002的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用SQL * Plus,连接到密码进入宽限期(Oracle 11g,Oracle 8i)的用户时,我收到一条错误消息,但连接仍然成功:

when I use SQL*Plus, connecting to a user whose password entered the grace period (Oracle 11g, Oracle 8i), I get an error message but the connect is still successful:

SQL*Plus:

=====================================

SQL> connect gumiplesku
Enter password:
ERROR:
ORA-28002: the password will expire within 7 days


Connected.
SQL> select User from dual;


USER

======================================

gumiplesku

=====================================

另一方面,在我的C + OCI代码做一个 OCILogon2 ,如果我尝试连接同一个用户,我得到一个 OCI_ SUCCESS_ WITH_ INFO 与同样的错误,但如果我继续, OCISvcCtx * 我似乎是无效的(即使它不是null),因为试图做一个 OCIAttrGet OCIStmtExecute 上给我一个 OCI_INVALID_HANDLE 错误。

On the other hand, in my C++ OCI code doing a OCILogon2, if I try to connect the same user, I get an OCI_ SUCCESS_ WITH_ INFO with the same "error", but if I continue, the OCISvcCtx* I got seems to be invalid (even though it's not null), since trying to do a OCIAttrGet or OCIStmtExecute on it gives me an OCI_INVALID_HANDLE error.

用户应在所有宽限期内成功连接到数据库,直到密码完全过期。
那么SQL * Plus怎么能连接好,当我得到一个坏的句柄?

User should successfuly connect to database during all his grace period, until his password will be totally expired. So how come SQL*Plus can connect OK, when I get a bad handle? Shall I be attempting to connect a different way?

推荐答案

这是我经验之外的一点,但由于没有人回答我会给它一个镜头。

This is a little outside my experience, but since nobody is answering I'll give it a shot.

我记得有一些错误处理程序回调你可以安装。因为你能够通过 OCIErrorGet (?)得到错误信息,我认为它触发正常的错误处理机制。是否有可能有一个错误处理程序在发生错误时关闭连接,而不检查此特殊情况?

I recall there being some kind of error handler callback you can install. Since you are able to get the error information via OCIErrorGet (?), I assume it's triggering normal error handling mechanisms. Is it possible that there's an error handler that closes the connection when an "error" occurs without checking for this special case?

这也让我想起了一个问题以前,如果你把错误的句柄类型传递给OCI函数,它们可能以奇怪的方式失败。从 OCIErrorGet 文档的角度来看,可能是传递了 OCI_HTYPE_ERROR 和环境句柄,或者 OCI_HTYPE_ENV 和错误处理。

This also reminds me of a problem I had long ago, if you pass in the wrong handle type to OCI functions they can fail in odd ways. From a look at the OCIErrorGet docs, it might be that you're passing in OCI_HTYPE_ERROR and an environment handle, or OCI_HTYPE_ENV and an error handle.

您正在呼叫 OCIErrorGet 多次? Oracle可以生成多个错误,也许你必须先检索它们,然后才继续?但这似乎不合理。

Are you calling OCIErrorGet multiple times? Oracle can generate multiple errors, maybe you have to retrieve them all before continuing? But that doesn't really seem reasonable.

除了这些长镜头,我会尝试一个简单的 OCI示例或来自Oracle的任何示例代码,以查看它是否具有相同的问题。如果没有,那么向后工作,找出造成差异的原因。

Beyond those long-shots, I would try a simple OCI example or any example code from Oracle to see if it has the same issue. If not, then work backwards to find what's making the difference.

这篇关于OCILogon在宽限期 - ORA-28002的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆