查看数据库连接
select * from v$session;
中断回话
ALTER SYSTEM KILL SESSION 'SID,SERIAL#';
v$session表每个字段的意义:
$SESSION
This view lists session information for each current session.
Column Datatype Description
SADDR
RAW(4)
Session address
SID
NUMBER
Session identifier
SERIAL#
NUMBER
Session serial number. Used to identify uniquely 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
AUDSID
NUMBER
Auditing session ID
PADDR
RAW(4)
Address of the process that owns this session
USER#
NUMBER
Oracle user identifier
USERNAME
VARCHAR2(30)
Oracle username
COMMAND
NUMBER
Command in progress (last statement parsed); for a list of values, see Table 3-7
OWNERID
NUMBER
The column contents are invalid if the value is 2147483644. Otherwise, this column contains the identifier of the user who owns the migratable session
For operations using Parallel Slaves, interpret this value as a 4Byte value. The low-order 2Bytes of which represent the session number, and the high-order bytes the instance ID of the query coordinator
TADDR
VARCHAR2(8)
Address of transaction state object
LOCKWAIT
VARCHAR2(8)
Address of lock waiting for; NULL if none
STATUS
VARCHAR2(8)
Status of the session: ACTIVE (currently executing SQL), INACTIVE, KILLED (marked to be killed), CACHED (temporarily cached for use by Oracle*XA), SNIPED (session inactive, waiting on the client)
SERVER
VARCHAR2(9)
Server type: DEDICATED, SHARED, PSEUDO, NONE
SCHEMA#
NUMBER
Schema user identifier
SCHEMANAME
VARCHAR2(30)
Schema user name
OSUSER
VARCHAR2(15)
Operating system client user name
PROCESS
VARCHAR2(9)
Operating system client process ID
MACHINE
VARCHAR2(64)
Operating system machine name
TERMINAL
VARCHAR2(10)
Operating system terminal name
PROGRAM
VARCHAR2(48)
Operating system program name
TYPE
VARCHAR2(10)
Session type
SQL_ADDRESS
RAW(4)
Used with SQL_HASH_VALUE to identify the SQL statement that is currently being executed
SQL_HASH
_VALUE
NUMBER
Used with SQL_ADDRESS to identify the SQL statement that is currently being executed
MODULE
VARCHAR2(48)
Contains the name of the currently executing module as set by calling the DBMS_APPLICATION_INFO.SET_MODULE procedure
MODULE_HASH
NUMBER
The hash value of the above MODULE
ACTION
VARCHAR2(32)
Contains the name of the currently executing action as set by calling the
DBMS_APPLICATION_INFO.SET_ACTION procedure
ACTION_HASH
NUMBER
The hash value of the above action name
CLIENT_INFO
VARCHAR2(64)
Information set by the DBMS_APPLICATION_INFO.SET_CLIENT_INFO procedure
FIXED_TABLE
_SEQUENCE
NUMBER
This 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#
NUMBER
Object ID for the table containing the ROWID specified in ROW_WAIT_ROW#
ROW_WAIT_FILE#
NUMBER
Identifier for the datafile containing the ROWID specified in ROW_WAIT_ROW#. This column is valid only if the session is currently waiting for another transaction to commit and the value of ROW_WAIT_OBJ# is not -1
ROW_WAIT
_BLOCK#
NUMBER
Identifier for the block containing the ROWID specified in ROW_WAIT_ROW#. This column is valid only if the session is currently waiting for another transaction to commit and the value of ROW_WAIT_OBJ# is not -1
ROW_WAIT_ROW#
NUMBER
The current ROWID being locked. This column is valid only if the session is currently waiting for another transaction to commit and the value of ROW_WAIT_OBJ# is not -1
LOGON_TIME
DATE
Time of logon
LAST_CALL_ET
NUMBER
The last call
PDML_STATUS
VARCHAR2(8)
If ENABLED, the session is in a PARALLEL DML enabled mode. If DISABLED, PARALLEL DML enabled mode is not supported for the session. If FORCED, the session has been altered to force PARALLEL DML.
PDDL_STATUS
VARCHAR2(8)
If ENABLED, the session is in a PARALLEL DDL enabled mode. If DISABLED, PARALLEL DDL enabled mode is not supported for the session. If FORCED, the session has been altered to force PARALLEL DDL.
PDML_ENABLED
VARCHAR2(3)
This column has been replaced by PDML_ENABLED and PDML_STATUS. See above.
FAILOVER_TYPE
VARCHAR2(10)
NONE if failover is disabled for this session, SESSION if client is able to failover its session following a disconnect, and SELECT if client is able to fail over selects in progress as well
FAILOVER
_METHOD
VARCHAR2(3)
NONE if failover is disabled for this session, BASIC if client reconnects following a disconnect, PRECONNECT if the backup instance is able to support all connections from every instance that it is backup for
FAILED_OVER
VARCHAR2(13)
TRUE if running in failover mode and have failed over, otherwise FALSE
RESOURCE_CONSUMER_GROUP
VARCHAR2(32)
Name of the session's current resource consumer group
分享到:
相关推荐
1. **Session ID**:`SID`字段标识了每个会话的唯一编号。 2. **用户名与机器名**:`USERNAME`与`MACHINE`字段分别显示了发起会话的用户名和其所在的机器名。 3. **状态信息**:`STATUS`字段指示了会话的当前状态,...
这里使用了`sql_hash_value`字段来关联`v$session`和`v$sqltext`两个视图,其中`&sid`是一个输入参数,代表了要查询的会话的SID。`order by piece asc`是为了按照SQL语句的片段顺序排列。 #### 3. 监控当前会话的...
通过`a.sql_address = b.address`这个条件,可以将两者关联起来,进而得到每个会话正在执行的具体SQL语句。 2. **按时间筛选SQL语句** ```sql SELECT b.SQL_TEXT, b.FIRST_LOAD_TIME, b.SQL_FULLTEXT FROM v$...
V$SESSION 视图是 Oracle 提供的核心性能监视视图之一,它记录了所有与数据库实例建立连接的会话(session)信息,包括用户会话和后台进程,如 DBWR(数据库写进程)、LGWR(日志写进程)和归档进程等。通过 V$...
文档标题“Oracle数据字典各字段解析.pdf”表明该文档专注于解析 Oracle 数据库中数据字典的各个字段。数据字典是 Oracle 数据库中存储数据库结构信息的特殊表,它记录了数据库中所有对象的定义和相关信息。Oracle ...
- **Serial#**:当用户连接到Oracle数据库时,每个会话都会被分配一个唯一的序列号。这个序列号与SID结合使用,可以唯一地标识出当前会话。 #### Oracle PID - **PID (Process ID)**:在操作系统层面,每个运行的...
rem 从 v$session 视图中取出关心的字段,创建 my_session 表,并在查询要用到的字段上创建索引,以加快查询速度 drop table my_session; create table my_session as select a.username, a.sid, a.serial#, a....
- 功能:记录每个会话的I/O操作详情。 9. **V$TRANSACTION** - 描述:事务信息。 - 关键字段:`Addr`, `Xidusn` - 功能:跟踪正在进行的事务的状态。 10. **V$ROLLNAME 和 V$ROLLSTAT** - 描述:回滚段信息。...
Oracle数据库的日常维护是确保系统稳定性和数据安全性的重要环节。这份文档主要涵盖了Oracle数据库的每日、每周、每月以及每年的维护任务,同时提供了...因此,理解并执行上述任务是每个DBA日常工作中不可或缺的部分。
- `dba_data_files` 表包含每个数据文件的信息。 - 使用 `JOIN` 将两个表连接起来,基于 `tablespace_name` 字段。 - `SUM` 函数计算总大小,然后通过除以 `(1024*1024)` 转换为MB单位。 - `ROUND` 函数对结果...
这个查询可以帮助我们了解每个表空间的数据文件的总大小、已使用的空间、空闲的空间以及空闲空间的比例等信息。 #### 七、了解表在表空间中的存储情况 如果想要查询某个表在其所在表空间中的存储情况,可以使用...
1. `STATISTIC#`: 统计标识符,每个统计项都有唯一的编号。 2. `NAME`: 统计项的名称,用于描述特定的性能指标。 3. `VALUE`: 当前统计项的值,反映了相应的资源使用量。 视图中的`class`列虽然存在,但通常较少...
在并行执行中,主Session作为协调者,负责任务分配,而参与并行执行的每个进程(Parallel Process)也会在数据库中对应一个Session。这种设计使得并行执行能充分利用系统资源,提高复杂查询的执行效率。 总结来说,...
`DBA_TABLESPACES`视图可以显示表空间的总大小,而`DBA_DATA_FILES`则提供每个数据文件的大小信息。 7. **查看表空间剩余空间**: 结合`DBA_FREE_SPACE`视图可以计算出表空间的剩余空间。 8. **本地认证**: ...
- **V$BUFFER_POOL**:详细记录了缓冲池中每个缓冲区的状态,如`ID`、`NAME`、`BLOCK_SIZE`等,对于理解缓存机制至关重要。 ##### 消息队列管理 - **V$QUEUE**:用于管理消息队列,其中包含了如`QUEUE_ID`、`QUEUE...
- 此查询通过分组统计不同的等待事件,计算出每个事件的当前等待次数 (`Curr`)、前一个采样点的等待次数 (`Prev`) 和总的等待次数 (`Tot`),便于理解当前系统的等待情况。 #### 3. 检查回滚段状态 **SQL语句:** `...
- `v$session` 是Oracle中的一个动态性能视图,用于展示当前所有会话的状态。 - `count(*)` 统计所有行的数量,此处用于计算当前活跃的会话总数。 **应用场景:** - 监控数据库的负载情况。 - 分析数据库的并发压力...
根据提供的文件信息,可以看出这是一份关于Oracle...每个知识点都围绕着Oracle数据库的管理和使用展开,覆盖了数据库的基本操作、性能调优、安全控制等多个方面,对于Oracle数据库的学习和日常维护具有很高的参考价值。
Oracle表中的字段数量受制于表的总宽度以及每个字段的最大长度。一般来说,Oracle允许的最大字段数为1000个。 #### 18. 怎样查得数据库的SID? 可以通过查询`V$DATABASE`视图来获取数据库的SID。例如: ```sql ...
- 分析表空间利用率:通过聚合函数和计算,可以了解每个表空间的总MB、已用MB、空闲MB以及使用率。 - 查询特定用户下所有表占用的空间大小:`SELECT Segment_Name, Sum(bytes)/1024/1024 FROM User_Extents GROUP ...