In V$SESSION, column SQL_ID is not NULL while STATUS is INACTIVE
Applies to:
Oracle Database - Standard Edition - Version 11.1.0.7 and laterOracle Database - Enterprise Edition - Version 11.1.0.7 and later
Information in this document applies to any platform.
Symptoms
When a session is inactive, the SQL_ID for this session is not null.
The issue can be reproduced by following these steps:
- connect from sqlplus as a test user
- connect from a second session as sys and run the following query:
SQL> select sid, username, status, sql_id, sql_exec_start from v$session;
Note: the first session should should be inactive and having SQL_ID NULL
- go back to the first session and run a query
SQL> select * from dual;
- go back to the SYS session and verify again the sessions
NOTE: the first session will show again as INACTIVE but this time the SQL_ID has an explicit value
SQL> conn scott/tiger
Connected.
SQL> create table test1(id number);
Table created.
SQL> select * from dual;
D
-
X
-- Second session as sysdba
SQL> select sql_id,status from v$session where username='SCOTT';
SQL_ID STATUS
------------- --------
INACTIVE
SQL> /
SQL_ID STATUS
------------- --------
7jnhyr6g49s8p INACTIVE
SQL> /
SQL_ID STATUS
------------- --------
a5ks9fhw2v9s1 INACTIVE
Cause
This is a product defect as when a session is inactive the sql_id for this session is supposed to be null.
As per the Oracle documentation :
SQL_ID VARCHAR2(13) SQL identifier of the SQL statement that is currently being executed
Reference:
The issue matches : IN V$SESSION, SQL_ID IS NOT NULL BUT STATUS IS INACTIVE
Solution
At the time of writing this document, the developers are still working on a fix for this issue under .
References
- IN V$SESSION, SQL_ID IS NOT NULL BUT STATUS IS INACTIVE來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31393455/viewspace-2131913/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20220531]inactive session等待事件2.txtSession事件
- [20220531]模擬inactive session等待事件.txtSession事件
- oracle 什麼時候才回收v$session 中status='KILLED'的程式OracleSession
- [20220531]驗證inactive session出現的問題.txtSession
- 異常:java.sql.SQLIntegrityConstraintViolationException: Column 'category' cannot be nullJavaSQLAIExceptionGoNull
- session和v$session說明Session
- 10.17 V$SESSIONSession
- V$SESSION COMMANDSession
- v$Session詳解Session
- [20210506]RAC crsctl status ... -v 獲取last started or status changes資訊.txtAST
- 10.18 V$SESSION_BLOCKERSSessionBloC
- 10.21 V$SESSION_EVENTSession
- 10.25 V$SESSION_WAITSessionAI
- [20210528]V$INDEXED_FIXED_COLUMN檢視.txtIndex
- ceph之pg inactive
- 10.27 V$SESSION_WAIT_HISTORYSessionAI
- 10.26 V$SESSION_WAIT_CLASSSessionAI
- [20221023]v$session_longops.txtSessionGo
- ASH可以生成指定的session或sql_id的報告,ASH和AWR的區別SessionSQL
- ORACLE OMS啟動失敗之BEA-300040 I/O error while writing node manager statusOracleErrorWhile
- [20211019]V$DETACHED_SESSION檢視.txtSession
- v$session - 你看到的event真的是session當前的等待事件麼?Session事件
- 利用v$session_longops監控長操作SessionGo
- V$ACTIVE_SESSION_HISTORY檢視的使用Session
- 非啟用視窗(Inactive Window)
- Check failed: status == CUDNN_STATUS_SUCCESS (4 vs. 0) CUDNN_STATUS_INTERNAL_ERRORAIDNNError
- Java 迴圈 - for, while 及 do…whileJavaWhile
- MTS方式連線V$SESSION中的SERVER狀態SessionServer
- OGG-01163 Bad column length (32) specified for column in table
- while迴圈以及do while迴圈While
- TIC Read Status
- git status 命令Git
- [20211230]完善sql_id指令碼.txtSQL指令碼
- python while/forPythonWhile
- 【NULL】Oracle null值介紹NullOracle
- [20220120]探究v$session.SQL_EXEC_ID在共享池.txtSessionSQL
- Java迴圈結構-for,while及do…whileJavaWhile
- Java while和do while迴圈詳解JavaWhile
- Java:運用while()與do....while與for()JavaWhile