是否有任何一致的方法来检查会话在 Oracle 中是否仍然存在?
Is there any consistent way to check whether the session is still alive in Oracle?
我有会话的 SID
和 SERIAL#
。是否有任何一致的方法来检查会话是否仍然存在并连接?
现在我的应用程序使用 GV$SESSION
视图的简单查询来获取该信息。但看起来活动会话可能会不时从视图中消失几秒钟,然后它再次以相同的 SID
和 SERIAL#
.
重新出现在视图中
Oracle documentation 谈到动态性能视图,例如 GV$SESSION
:
Dynamic performance views are based on virtual tables built from
database memory structures. Thus, they are not conventional tables
stored in the database. Read consistency is not guaranteed for the
views because the data is updated dynamically.
我认为这就是我的会话从 GV$SESSION
中消失的原因。有没有其他方法可以持续获取这些信息?
在 Oracle 中检查会话是否存在更可靠的方法似乎是使用 DBMS_SESSION
包,即 DBMS_SESSION.IS_SESSION_ALIVE 函数。
我有会话的 SID
和 SERIAL#
。是否有任何一致的方法来检查会话是否仍然存在并连接?
现在我的应用程序使用 GV$SESSION
视图的简单查询来获取该信息。但看起来活动会话可能会不时从视图中消失几秒钟,然后它再次以相同的 SID
和 SERIAL#
.
Oracle documentation 谈到动态性能视图,例如 GV$SESSION
:
Dynamic performance views are based on virtual tables built from database memory structures. Thus, they are not conventional tables stored in the database. Read consistency is not guaranteed for the views because the data is updated dynamically.
我认为这就是我的会话从 GV$SESSION
中消失的原因。有没有其他方法可以持续获取这些信息?
在 Oracle 中检查会话是否存在更可靠的方法似乎是使用 DBMS_SESSION
包,即 DBMS_SESSION.IS_SESSION_ALIVE 函数。