- 浏览: 2160545 次
- 性别:
- 来自: 合肥
文章分类
- 全部博客 (401)
- Agile (16)
- Apache Commons (3)
- Architecture (8)
- DB.MongoDB (5)
- DB.Mysql (3)
- DB.Oracle (34)
- DirectoryService (1)
- DotNet (1)
- English (3)
- Groovy (0)
- Html (28)
- Java (67)
- Java.Aixs (7)
- Java.Cache (2)
- Java.jPBM (1)
- Java.Resin (6)
- Java.Spring (4)
- Java.Struts2 (5)
- Java.Tomcat (16)
- Javascript (45)
- Javascript.Google Map (2)
- Javascript.Jquery (8)
- Life (15)
- Maven&Ant (4)
- Network (5)
- OS.Linux (45)
- OS.Windows (10)
- OS.Windows.Office (1)
- PlayFramework (15)
- Python (28)
- Reading notes (11)
- Security (13)
- Server.Apache (3)
- Server.Nginx (7)
- Test (6)
- Tool (15)
- Work.Solution (15)
- Other (20)
- SSO&CAS&Identity (13)
最新评论
-
hutuxiansheng123:
防火墙、Iptables、netfilter/iptables、NAT 概述 -
dacoolbaby:
非常棒的正则表达式,非常适用。万分感谢。
用python分析nginx的access日志 -
loot00:
您好! 我也遇到了相同的错误信息。我是用f_link_lob ...
LOB variable no longer valid after subsequent fetch -
feihangchen:
@OnApplicationStop public clas ...
Play framework 1.2.3 Jobs定时任务、异步任务、引导任务、触发任务、关闭任务 -
洞渊龙王:
谢谢了
www.w3.org被qiang导致logback报错:Connect reset
查询每台应用服务器占用oracle数据库会话情况
select machine, count(*) c from v$session group by machine order by c desc;
根据机器名查询该机器发出的所有会话
select t.STATE,t.* from v$session t where t.MACHINE like '%computername%'
查询当前数据库连接会话中正在等待资源或者事件的信息
select * from v$session_wait
通过sid或者session对应的完整sql
select sql_text from v$sqltext a where a.hash_value = (select sql_hash_value from v$session b where b.sid = '&sid' )
order by piece asc
#查看某个表的索引
select index_name,index_type from user_indexes where table_name = '&tableName'
中断回话
ALTER SYSTEM KILL SESSION 'SID,SERIAL#';
plsql 命令窗口中用desc v$session可以查看到表结构
比较有用的v$session字段定义:
SADDR Session地址
SID SessionID
SERIAL# Session序列号
USER# 使用的oracle 用户名对应的id
USERNAME 使用的oracle用户名
LOCKWAIT 锁的状态
STATUS 会话状态 ACTIVE , INACTIVE, KILLED, CACHED , SNIPED
OSUSER 用户操作系统的登录名
MACHINE 用户的机器名
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
<!-- [if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:PunctuationKerning/> <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:SpaceForUL/> <w:BalanceSingleByteDoubleByteWidth/> <w:DoNotLeaveBackslashAlone/> <w:ULTrailSpace/> <w:DoNotExpandShiftReturn/> <w:AdjustLineHeightInTable/> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> <w:UseFELayout/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!-- [if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--><!-- [if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]-->
引用:http://xubin-8880-163-com.iteye.com/blog/451640
发表评论
-
linux下手动启动oracle监听
2012-01-16 11:19 1121lsnrctl start [root@vm ~]# fin ... -
更新插入时,用触发器更新【最后更新时间字段】
2011-12-29 15:28 1970CREATE OR REPLACE TRIGGER TR_TB ... -
Toad常用快捷键&常用功能
2011-12-29 08:30 8672F8 调出以前执行的sql命令 F9 执行全部sql Ctrl ... -
oracle 11g 卸载
2011-12-28 09:15 7586由于Toad不支持64位的oracle客户端,因此要卸载已经安 ... -
表A与表B是一对多关系,取表B中任一记录与A关联查询
2011-09-13 14:33 2718通过Group By + min方法取得表B中分组后的多条记录 ... -
超出表空间"users"的空间限额
2011-08-23 09:16 1280这是因为用户被数据库限制了在建表的表空间。 执行一下下面的语 ... -
Clob字段的值部分替换 replace和空判断
2011-08-10 11:36 3879--oracle中可以对Clob字段进行替换操作 U ... -
oracle 循环sql快速插入数据
2011-06-14 09:41 2088具体的insert sql可以通过plsql查询结果上方工具栏 ... -
oracle获取汉字拼音和拼音首字母
2011-06-01 16:23 1455select name,f_getspell(name),f_ ... -
oracle表复制
2011-05-13 15:51 1181select * into dest_tab from r ... -
输出完整的sql语句(带参数)
2011-05-10 15:44 3598#log4jdbc配置,只用在开发环境 jdbc.driver ... -
plsqldev常用技巧
2011-05-09 09:46 36311,PL/SQL美化器 2,F8 SQL执行 3,F5 执行计 ... -
oracle中排序和分页的相互影响
2011-04-14 11:39 1383如下sql: select * from (sele ... -
省市县物化视图
2011-03-23 09:34 977CREATE MATERIALIZED VIEW mv_b ... -
(转)Oracle数据库的自动导出备份脚本(windows环境)
2011-03-11 10:44 1722转自Oracle数据库的自动导出备份脚本(windows环境) ... -
oracle tnsping & ora-12154
2011-01-05 10:06 3614使用命令sqlplus user/pwd@tnsname的时候 ... -
oracle rebuild index and table move and rename
2010-12-30 15:55 6321Oracle里大量删除记录后 ... -
普通视图和物化视图区别,物化视图简单语法(转)
2010-12-20 11:51 2844转自普通视图和物化视 ... -
使用to_char(wm_concat(item))的时候报ORA-64203错误
2010-12-08 09:34 14405使用to_char(wm_concat(item))的时候报O ... -
每月100W数据统计处理解决方案
2010-12-06 15:12 2196任务:每月产生100W条数据(csv格式),要求对这些数据进行 ...
相关推荐
在Oracle数据库管理与优化的过程中,`v$session`与`v$session_wait`视图扮演着至关重要的角色,它们提供了关于当前活动会话及其等待事件的详细信息,这对于诊断性能问题、理解数据库行为以及进行有效的资源管理至关...
Oracle 数据库提供了大量的动态性能视图(Dynamic Performance Views),其中 `V$SESSION` 和 `V$SESSION_WAIT` 是两个非常重要的视图,它们能够帮助数据库管理员深入了解当前会话的状态以及等待事件的信息。...
V$视图包括了如`V$SESSION`(会话信息)、`V$DATABASE`(数据库信息)、`V$PARAMETER`(参数设置)等,覆盖了数据库性能监控、资源管理、配置设置等多个方面。V$视图通过公共同义词(Public Synonym)前缀为V$的形式...
Oracle动态性能(V$)视图是Oracle数据库管理系统中极为重要的组成部分,它们提供了实时的数据库运行信息,帮助DBA(数据库管理员)监控、诊断和优化数据库性能。这些视图以V$开头,通常由一系列的数据字典视图组成,...
这里使用了`sql_hash_value`字段来关联`v$session`和`v$sqltext`两个视图,其中`&sid`是一个输入参数,代表了要查询的会话的SID。`order by piece asc`是为了按照SQL语句的片段顺序排列。 #### 3. 监控当前会话的...
总结,`v$bh`视图是Oracle DBA进行性能调优的重要工具,通过对缓冲区缓存的深入理解和监控,能够有效地提升数据库系统的整体性能和稳定性。通过学习和实践,你可以更好地掌握这个视图,并应用于日常的数据库管理和...
如果关闭autotrace,SQL*Plus将终止第二个会话并不再监视v$session视图。 Oracle数据库连接与会话是两个紧密相连的概念,但它们之间存在一定的区别。理解它们之间的关系对于Oracle数据库管理系统的正确使用非常重要...
同时,结合`V$SESSION`和`V$SESS_IO`视图,可以进一步分析特定会话的资源消耗情况。 6. **识别锁定问题**:使用`V$LOCK`和`V$SESSION`视图可以帮助识别锁定问题,并且可以根据需要关闭相关会话以解决冲突。 7. **...
在Oracle数据库管理中,有时会遇到一些异常情况,比如某个Session长时间未响应或占用大量资源,这时可能需要管理员手动干预,通过`ALTER SYSTEM KILL SESSION 'SID,SERIAL#'`命令来强制终止这个Session。然而,在...
这些视图,以`V$`前缀标识,是由数据库服务器实时维护的,它们提供了关于数据库运行状况的详细信息,帮助DBA(数据库管理员)进行性能优化、故障排查等工作。由于这些视图的内容与性能紧密相关,因此它们会随着...
在Oracle数据库管理中,处理死锁进程和释放状态为killed的session是一项关键技能,尤其对于维护数据库性能和稳定性至关重要。以下将详细阐述如何通过一系列步骤有效地关闭Oracle死锁进程,以及如何释放状态为killed...
**Oracle动态性能视图**是一组预定义的视图,用于显示Oracle数据库的内部状态和活动信息。这些视图对于DBA(数据库管理员)来说非常重要,可以帮助他们监控数据库性能、诊断问题并进行调优。 #### 二、Oracle动态...
`V$SESSION_WAIT`视图提供了每个会话正在等待的资源信息,这对于诊断会话阻塞等问题非常有帮助。 ##### 示例 ```sql SELECT EVENT, COUNT(*) FROM V$SESSION_WAIT GROUP BY EVENT ORDER BY COUNT(*) DESC; ``` 此...
V$SESSION 视图是 Oracle 提供的核心性能监视视图之一,它记录了所有与数据库实例建立连接的会话(session)信息,包括用户会话和后台进程,如 DBWR(数据库写进程)、LGWR(日志写进程)和归档进程等。通过 V$...
例如,V$SESSION视图提供了当前活跃会话的信息,V$INSTANCE视图显示了数据库实例的详细配置,而V$WAITSTAT则可以帮助分析系统的等待事件,从而定位性能瓶颈。 在"oracle10g_V$_Views.pdf"中,可能包含了对Oracle 10...
例如,V$SESSION视图可以提供当前连接会话的信息,这对于诊断性能问题、追踪用户活动或进行资源管理十分有用。V$PGA_AGGREGATE_TARGET和V$SGA_TARGET等视图则帮助管理员管理共享全局区(SGA)和程序全局区(PGA)的...
### Oracle数据库管理员经常使用的表和视图 在Oracle数据库管理工作中,熟练掌握并利用系统提供的数据字典表和动态性能视图(Dynamic Performance Views)对于提高数据库管理效率、确保数据库健康运行至关重要。...