セッションの情報を参照するには、V$SESSIONビューを参照します。
V$SESSIONの定義
V$SESSIONの定義です。
列名 | 型 | メモ |
---|---|---|
SADDR | RAW | |
SID | NUMBER | セッション識別子 |
SERIAL# | NUMBER | セッション・シリアル番号 セッションを一意に判別するために使用 |
AUDSID | NUMBER | |
PADDR | RAW | |
USER# | NUMBER | |
USERNAME | VARCHAR2(30) | セッションのユーザ名 |
COMMAND | NUMBER | |
OWNERID | NUMBER | |
TADDR | VARCHAR2(8) | |
LOCKWAIT | VARCHAR2(8) | |
STATUS | VARCHAR2(8) | |
SERVER | VARCHAR2(9) | |
SCHEMA# | NUMBER | |
SCHEMANAME | VARCHAR2(30) | |
OSUSER | VARCHAR2(30) | |
PROCESS | VARCHAR2(24) | |
MACHINE | VARCHAR2(64) | |
PORT | NUMBER | |
TERMINAL | VARCHAR2(30) | |
PROGRAM | VARCHAR2(48) | |
TYPE | VARCHAR2(10) | |
SQL_ADDRESS | RAW | |
SQL_HASH_VALUE | NUMBER | |
SQL_ID | VARCHAR2(13) | |
SQL_CHILD_NUMBER | NUMBER | |
SQL_EXEC_START | DATE | |
SQL_EXEC_ID | NUMBER | |
PREV_SQL_ADDR | RAW | |
PREV_HASH_VALUE | NUMBER | |
PREV_SQL_ID | VARCHAR2(13) | |
PREV_CHILD_NUMBER | NUMBER | |
PREV_EXEC_START | DATE | |
PREV_EXEC_ID | NUMBER | |
PLSQL_ENTRY_OBJECT_ID | NUMBER | |
PLSQL_ENTRY_SUBPROGRAM_ID | NUMBER | |
PLSQL_OBJECT_ID | NUMBER | |
PLSQL_SUBPROGRAM_ID | NUMBER | |
MODULE | VARCHAR2(48) | |
MODULE_HASH | NUMBER | |
ACTION | VARCHAR2(32) | |
ACTION_HASH | NUMBER | |
CLIENT_INFO | VARCHAR2(64) | |
FIXED_TABLE_SEQUENCE | NUMBER | |
ROW_WAIT_OBJ# | NUMBER | |
ROW_WAIT_FILE# | NUMBER | |
ROW_WAIT_BLOCK# | NUMBER | |
ROW_WAIT_ROW# | NUMBER | |
TOP_LEVEL_CALL# | NUMBER | |
LOGON_TIME | DATE | |
LAST_CALL_ET | NUMBER | |
PDML_ENABLED | VARCHAR2(3) | |
FAILOVER_TYPE | VARCHAR2(13) | |
FAILOVER_METHOD | VARCHAR2(10) | |
FAILED_OVER | VARCHAR2(3) | |
RESOURCE_CONSUMER_GROUP | VARCHAR2(32) | |
PDML_STATUS | VARCHAR2(8) | |
PDDL_STATUS | VARCHAR2(8) | |
PQ_STATUS | VARCHAR2(8) | |
CURRENT_QUEUE_DURATION | NUMBER | |
CLIENT_IDENTIFIER | VARCHAR2(64) | |
BLOCKING_SESSION_STATUS | VARCHAR2(11) | |
BLOCKING_INSTANCE | NUMBER | |
BLOCKING_SESSION | NUMBER | |
FINAL_BLOCKING_SESSION_STATUS | VARCHAR2(11) | |
FINAL_BLOCKING_INSTANCE | NUMBER | |
FINAL_BLOCKING_SESSION | NUMBER | |
SEQ# | NUMBER | |
EVENT# | NUMBER | |
EVENT | VARCHAR2(64) | |
P1TEXT | VARCHAR2(64) | |
P1 | NUMBER | |
P1RAW | RAW(8) | |
P2TEXT | VARCHAR2(64) | |
P2 | NUMBER | |
P2RAW | RAW(8) | |
P3TEXT | VARCHAR2(64) | |
P3 | NUMBER | |
P3RAW | RAW(8) | |
WAIT_CLASS_ID | NUMBER | |
WAIT_CLASS# | NUMBER | |
WAIT_CLASS | VARCHAR2(64) | |
WAIT_TIME | NUMBER | |
SECONDS_IN_WAIT | NUMBER | |
STATE | VARCHAR2(19) | |
WAIT_TIME_MICRO | NUMBER | |
TIME_REMAINING_MICRO | NUMBER | |
TIME_SINCE_LAST_WAIT_MICRO | NUMBER | |
SERVICE_NAME | VARCHAR2(64) | |
SQL_TRACE | VARCHAR2(8) | |
SQL_TRACE_WAITS | VARCHAR2(5) | |
SQL_TRACE_BINDS | VARCHAR2(5) | |
SQL_TRACE_PLAN_STATS | VARCHAR2(10) | |
SESSION_EDITION_ID | NUMBER | |
CREATOR_ADDR | RAW | |
CREATOR_SERIAL# | NUMBER | |
ECID | VARCHAR2(64) |
サンプル
例)接続しているユーザの一覧を取得する
1 |
SELECT DISTINCT USER_NAME FROM V$SESSION; |