oracle官方文档之V$SESSION

V$SESSION

V$SESSION displays session information for each current session.

ColumnDatatypeDescription
SADDRRAW(4 | 8)Session address
SIDNUMBERSession identifier
SERIAL#NUMBERSession serial number. Used to uniquely identify a session's objects. Guarantees that session-level commands are applied to the correct session objects if the session ends and another session begins with the same session ID.
AUDSIDNUMBERAuditing session ID
PADDRRAW(4 | 8)Address of the process that owns the session
USER#NUMBEROracle user identifier
USERNAMEVARCHAR2(30)Oracle username
COMMANDNUMBERCommand in progress (last statement parsed).

You can find the command name for any value n returned in thisCOMMAND column by running this SQL query:

SELECT command_name
   FROM v$sqlcommand
   WHERE command_type = n;

A value of 0 in this COMMAND column means the command is not recorded inV$SESSION.

OWNERIDNUMBERIdentifier of the user who owns the migratable session; the column contents are invalid if the value is2147483644

For operations using Parallel Slaves, interpret this value as a 4-byte value. The low-order 2 bytes represent the session number and the high-order bytes represent the instance ID of the query coordinator.

TADDRVARCHAR2(8)Address of the transaction state object
LOCKWAITVARCHAR2(8)Address of the lock the session is waiting for; NULL if none
STATUSVARCHAR2(8)Status of the session:
  • ACTIVE - Session currently executing SQL

  • INACTIVE - Session which is inactive and either has no configured limits or has not yet exceeded the configured limits

  • KILLED - Session marked to be killed

  • CACHED - Session temporarily cached for use by Oracle*XA

  • SNIPED - An inactive session that has exceeded some configured limits (for example, resource limits specified for the resource manager consumer group or idle_time specified in the user's profile). Such sessions will not be allowed to become active again.

SERVERVARCHAR2(9)Server type:
  • DEDICATED

  • SHARED

  • PSEUDO

  • POOLED

  • NONE

SCHEMA#NUMBERSchema user identifier
SCHEMANAMEVARCHAR2(30)Schema user name
OSUSERVARCHAR2(30)Operating system client user name
PROCESSVARCHAR2(24)Operating system client process ID
MACHINEVARCHAR2(64)Operating system machine name
PORTNUMBERClient port number
TERMINALVARCHAR2(30)Operating system terminal name
PROGRAMVARCHAR2(48)Operating system program name
TYPEVARCHAR2(10)Session type
SQL_ADDRESSRAW(4 | 8)Used with SQL_HASH_VALUE to identify the SQL statement that is currently being executed
SQL_HASH_VALUENUMBERUsed with SQL_ADDRESS to identify the SQL statement that is currently being executed
SQL_IDVARCHAR2(13)SQL identifier of the SQL statement that is currently being executed
SQL_CHILD_NUMBERNUMBERChild number of the SQL statement that is currently being executed
SQL_EXEC_STARTDATETime when the execution of the SQL currently executed by this session started; NULL ifSQL_ID is NULL
SQL_EXEC_IDNUMBERSQL execution identifier; NULL ifSQL_ID is NULL or if the execution of that SQL has not yet started (seeV$SQL_MONITOR)
PREV_SQL_ADDRRAW(4 | 8)Used with PREV_HASH_VALUE to identify the last SQL statement executed
PREV_HASH_VALUENUMBERUsed with SQL_HASH_VALUE to identify the last SQL statement executed
PREV_SQL_IDVARCHAR2(13)SQL identifier of the last SQL statement executed
PREV_CHILD_NUMBERNUMBERChild number of the last SQL statement executed
PREV_EXEC_STARTDATESQL execution start of the last executed SQL statement
PREV_EXEC_IDNUMBERSQL execution identifier of the last executed SQL statement
PLSQL_ENTRY_OBJECT_IDNUMBERObject ID of the top-most PL/SQL subprogram on the stack; NULL if there is no PL/SQL subprogram on the stack
PLSQL_ENTRY_SUBPROGRAM_IDNUMBERSubprogram ID of the top-most PL/SQL subprogram on the stack; NULL if there is no PL/SQL subprogram on the stack
PLSQL_OBJECT_IDNUMBERObject ID of the currently executing PL/SQL subprogram; NULL if executing SQL
PLSQL_SUBPROGRAM_IDNUMBERSubprogram ID of the currently executing PL/SQL object; NULL if executing SQL
MODULEFoot 1 VARCHAR2(48)Name of the currently executing module as set by calling theDBMS_APPLICATION_INFO.SET_MODULE procedure
MODULE_HASHNUMBERHash value of the MODULE column
ACTIONFootref 1VARCHAR2(32)Name of the currently executing action as set by calling theDBMS_APPLICATION_INFO.SET_ACTION procedure
ACTION_HASHNUMBERHash value of the ACTION column
CLIENT_INFOVARCHAR2(64)Information set by theDBMS_APPLICATION_INFO.SET_CLIENT_INFO procedure
FIXED_TABLE_SEQUENCENUMBERThis contains a number that increases every time the session completes a call to the database and there has been an intervening select from a dynamic performance table. This column can be used by performance monitors to monitor statistics in the database. Each time the performance monitor looks at the database, it only needs to look at sessions that are currently active or have a higher value in this column than the highest value that the performance monitor saw the last time. All the other sessions have been idle since the last time the performance monitor looked at the database.
ROW_WAIT_OBJ#NUMBERObject ID for the table containing the row specified inROW_WAIT_ROW#
ROW_WAIT_FILE#NUMBERIdentifier for the datafile containing the row specified inROW_WAIT_ROW#. This column is valid only if the session is currently waiting for another transaction to commit and the value ofROW_WAIT_OBJ# is not -1.
ROW_WAIT_BLOCK#NUMBERIdentifier for the block containing the row specified inROW_WAIT_ROW#. This column is valid only if the session is currently waiting for another transaction to commit and the value ofROW_WAIT_OBJ# is not -1.
ROW_WAIT_ROW#NUMBERCurrent row being locked. This column is valid only if the session is currently waiting for another transaction to commit and the value ofROW_WAIT_OBJ# is not -1.
TOP_LEVEL_CALL#NUMBEROracle top level call number
LOGON_TIMEDATETime of logon
LAST_CALL_ETNUMBERIf the session STATUS is currentlyACTIVE, then the value represents the elapsed time (in seconds) since the session has become active.

If the session STATUS is currently INACTIVE, then the value represents the elapsed time (in seconds) since the session has become inactive.

PDML_ENABLEDVARCHAR2(3)This column has been replaced by thePDML_STATUS column
FAILOVER_TYPEVARCHAR2(13)Indicates whether and to what extent transparent application failover (TAF) is enabled for the session:
  • NONE - Failover is disabled for this session

  • SESSION - Client is able to fail over its session following a disconnect

  • SELECT - Client is able to fail over queries in progress as well

See Also:

FAILOVER_METHODVARCHAR2(10)Indicates the transparent application failover method for the session:
  • NONE - Failover is disabled for this session

  • BASIC - Client itself reconnects following a disconnect

  • PRECONNECT - Backup instance can support all connections from every instance for which it is backed up

FAILED_OVERVARCHAR2(3)Indicates whether the session is running in failover mode and failover has occurred (YES) or not (NO)
RESOURCE_CONSUMER_GROUPVARCHAR2(32)Name of the session's current resource consumer group
PDML_STATUSVARCHAR2(8)If ENABLED, the session is in aPARALLEL DML enabled mode. If DISABLED, PARALLEL DML enabled mode is not supported for the session. IfFORCED, the session has been altered to force PARALLEL DML.
PDDL_STATUSVARCHAR2(8)If ENABLED, the session is in aPARALLEL DDL enabled mode. If DISABLED, PARALLEL DDL enabled mode is not supported for the session. IfFORCED, the session has been altered to force PARALLEL DDL.
PQ_STATUSVARCHAR2(8)If ENABLED, the session is in aPARALLEL QUERY enabled mode. If DISABLED, PARALLEL QUERY enabled mode is not supported for the session. IfFORCED, the session has been altered to force PARALLEL QUERY.
CURRENT_QUEUE_DURATIONNUMBERIf queued (1), the current amount of time the session has been queued. If not currently queued, the value is0.
CLIENT_IDENTIFIERVARCHAR2(64)Client identifier of the session
BLOCKING_SESSION_STATUSVARCHAR2(11)This column provides details on whether there is a blocking session:
  • VALID - there is a blocking session, and it is identified in the BLOCKING_INSTANCE and BLOCKING_SESSION columns

  • NO HOLDER - there is no session blocking this session

  • NOT IN WAIT - this session is not in a wait

  • UNKNOWN - the blocking session is unknown

BLOCKING_INSTANCENUMBERInstance identifier of the blocking session. This column is valid only ifBLOCKING_SESSION_STATUS has the value VALID.
BLOCKING_SESSIONNUMBERSession identifier of the blocking session. This column is valid only ifBLOCKING_SESSION_STATUS has the value VALID.
FINAL_BLOCKING_SESSION_STATUSVARCHAR2(11)The final blocking session is the final element in the wait chain constructed by following the sessions that are blocked by one another starting with this session. In the case of a cyclical wait chain, one of the sessions in the wait chain will be chosen as the final blocker.

This column provides details on whether there is a final blocking session:

  • VALID - there is a final blocking session and it is identified in theFINAL_BLOCKING_INSTANCE and FINAL_BLOCKING_SESSION columns

  • NO HOLDER - there is no session blocking this session

  • NOT IN WAIT - this session is not in a wait

  • UNKNOWN - the final blocking session is unknown

FINAL_BLOCKING_INSTANCENUMBERInstance identifier of the final blocking session. This column is valid only ifFINAL_BLOCKING_SESSION_STATUS has the value VALID.
FINAL_BLOCKING_SESSIONNUMBERSession identifier of the blocking session. This column is valid only ifFINAL_BLOCKING_SESSION_STATUS has the value VALID.
SEQ#NUMBERA number that uniquely identifies the current or last wait (incremented for each wait)
EVENT#NUMBEREvent number
EVENTVARCHAR2(64)Resource or event for which the session is waiting

See Also: Appendix C, "Oracle Wait Events"

P1TEXTVARCHAR2(64)Description of the first wait event parameter
P1NUMBERFirst wait event parameter (in decimal)
P1RAWRAW(8)First wait event parameter (in hexadecimal)Foot 2 
P2TEXTVARCHAR2(64)Description of the second wait event parameter
P2NUMBERSecond wait event parameter (in decimal)
P2RAWRAW(8)Second wait event parameter (in hexadecimal)Footref 2
P3TEXTVARCHAR2(64)Description of the third wait event parameter
P3NUMBERThird wait event parameter (in decimal)
P3RAWRAW(8)Third wait event parameter (in hexadecimal)Footref 2
WAIT_CLASS_IDNUMBERIdentifier of the class of the wait event
WAIT_CLASS#NUMBERNumber of the class of the wait event
WAIT_CLASSVARCHAR2(64)Name of the class of the wait event
WAIT_TIMENUMBERIf the session is currently waiting, then the value is0. If the session is not in a wait, then the value is as follows:
  • > 0 - Value is the duration of the last wait in hundredths of a second

  • -1 - Duration of the last wait was less than a hundredth of a second

  • -2 - Parameter TIMED_STATISTICS was set to false

This column has been deprecated in favor of the columns WAIT_TIME_MICRO andSTATE.

SECONDS_IN_WAITNUMBERIf the session is currently waiting, then the value is the amount of time waited for the current wait. If the session is not in a wait, then the value is the amount of time since the start of the last wait.

This column has been deprecated in favor of the columns WAIT_TIME_MICRO andTIME_SINCE_LAST_WAIT_MICRO.

STATEVARCHAR2(19)Wait state:
  • WAITING - Session is currently waiting

  • WAITED UNKNOWN TIME - Duration of the last wait is unknown; this is the value when the parameterTIMED_STATISTICS is set to false

  • WAITED SHORT TIME - Last wait was less than a hundredth of a second

  • WAITED KNOWN TIME - Duration of the last wait is specified in theWAIT_TIME column

WAIT_TIME_MICRONUMBERAmount of time waited (in microseconds). If the session is currently waiting, then the value is the time spent in the current wait. If the session is currently not in a wait, then the value is the amount of time waited in the last wait.
TIME_REMAINING_MICRONUMBERValue is interpreted as follows:
  • > 0 - Amount of time remaining for the current wait (in microseconds)

  • 0 - Current wait has timed out

  • -1 - Session can indefinitely wait in the current wait

  • NULL - Session is not currently waiting

TIME_SINCE_LAST_WAIT_MICRONUMBERTime elapsed since the end of the last wait (in microseconds). If the session is currently in a wait, then the value is0.
SERVICE_NAMEVARCHAR2(64)Service name of the session
SQL_TRACEVARCHAR2(8)Indicates whether SQL tracing is enabled (ENABLED) or disabled (DISABLED)
SQL_TRACE_WAITSVARCHAR2(5)Indicates whether wait tracing is enabled (TRUE) or not (FALSE)
SQL_TRACE_BINDSVARCHAR2(5)Indicates whether bind tracing is enabled (TRUE) or not (FALSE)
SQL_TRACE_PLAN_STATSVARCHAR2(10)Frequency at which row source statistics are dumped in the trace files for each cursor:
  • never

  • first_execution

  • all_executions

SESSION_EDITION_IDNUMBERShows the value that, in the session, would be reported bysys_context('USERENV', 'SESSION_EDITION_ID')
CREATOR_ADDRRAW(4 | 8)Address of the creating process or circuit
CREATOR_SERIAL#NUMBERSerial number of the creating process or circuit
ECIDVARCHAR2(64)Execution context identifier (sent by Application Server)

Footnote 1 The datatype of this column isVARCHAR2(64) starting with Oracle Database 11g Release 2 (11.2.0.2).

Footnote 2 The P1RAW,P2RAW, and P3RAW columns display the same values as theP1, P2, and P3 columns, except that the numbers are displayed in hexadecimal.

See Also:

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值