Oracle 请求计数器
我正在使用 IIS 计数器来监视 IIS 的“业务”。我特别喜欢其中的两个:
- 当前匿名用户(当前有 WWW 服务待处理的匿名请求的用户数量。在 IIS 6.0 中,当前用户(匿名或非匿名)是服务器当前正在处理的请求数量)
- 匿名用户总数(自 WWW 服务启动以来建立匿名请求的用户数量。当从内核缓存提供文件时,此计数器不会增加。)
因为我的瓶颈是数据库,恰好是 Oracle 10g ,我想知道是否可以从 Oracle 服务器(在数据库级别)获取类似的计数器。
基本上来说,我想知道在我发出请求时有多少对数据库 ABC 的请求正在等待服务,以及自(上次重置、当天开始...)以来服务了多少请求
我如何获取此数据甲骨文服务器?
I am using IIS counters to monitor "bussiness" of IIS. Specially I like 2 of them:
- Current Anonymous Users (The number of users who currently have an anonymous request pending with the WWW service. In IIS 6.0, Current Users (Anonymous or NonAnonymous) is the number of requests currently being worked on by the server)
- Total Anonymous User (The number of users who have established an anonymous request since the WWW service started. This counter does not increment when files are being served from the kernel cache.)
Because my bottle neck is database, which happend to be Oracle 10g, I wonder if similar counters could be taken from Oracle server (on database level).
Basicly speaking I would like to know how many request to database ABC is waiting to be served at the moment of my request, and how many request was served since (last reset, beginnig of the day...)
How I could get this data of Oracle Server ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
V$SESSION
可用于确定当前时刻有多少数据库会话处于活动状态。此查询将显示当前时刻处于活动状态的用户会话(而不是 Oracle 数据库本身创建的后台会话)的数量。您可能希望进一步将其限制为活动会话的数量,其中USERNAME
是中间层连接的用户或创建会话的MACHINE
是您的中间层服务器之一。Oracle 中没有简单的映射来表示 Web 浏览器的“服务请求数”。从数据库的角度来看,没有任何“请求”何时开始和结束的标记。您可能会对事务进行计数,但 Oracle 数据库本身会在后台不断发出事务,如果您想要一个与所服务的网页数量紧密对应的度量,这可能会导致问题。
然而,尽管如此,使用计数器来诊断和监控 Oracle 数据库性能并不是一个特别好的主意。 Oracle 拥有更复杂的监控和调优工具。根据版本(标准版或企业版)以及您是否已获得性能和调整包的许可,您最好获取 AWR 报告 来自数据库成为瓶颈的时间段,并对其进行分析以了解需要调整的内容。
V$SESSION
can be used to determine how many database sessions are active at the current instant in time. This query will show you the number of user sessions (rather than background sessions that the Oracle database itself creates) are active at the current instant. You may want to further restrict this to be the number of active sessions where theUSERNAME
is the user that your middle tier is connecting as or theMACHINE
from which the session is created is one of your middle tier servers.There is no easy mapping in Oracle for the "number of requests served" of a web browser. From a database perspective, there aren't any markers of when a "request" begins and ends. You could potentially count transactions but the Oracle database itself is constantly issuing transactions in the background which is likely to cause problems if you wanted a measure that would map closely to the number of web pages served.
That said, however, using counters to diagnose and monitor Oracle database performance is not a particularly good idea. Oracle has much more sophisticated monitoring and tuning tools available. Depending on the edition (standard or enterprise) and whether you've licensed the Performance and Tuning Pack, you'd be much better served grabbing an AWR report from a time period when the database was the bottleneck and analyzing that to see what needs to be tuned.