WEB开发网
开发学院数据库Oracle Oracle-常用监控SQL 阅读

Oracle-常用监控SQL

 2008-12-17 13:06:31 来源:WEB开发网   
核心提示: 11. 监控内存和硬盘的排序比率,最好使它小于 .10,Oracle-常用监控SQL(3),增加 sort_area_size SELECT name, value FROM v$sysstat WHERE name IN ('sorts (memory)', 's

11. 监控内存和硬盘的排序比率,最好使它小于 .10,增加 sort_area_size

SELECT name, value FROM v$sysstat WHERE name IN ('sorts (memory)', 'sorts (disk)');

12. 监控当前数据库谁在运行什么SQL语句

SELECT osuser, username, sql_text from v$session a, v$sqltext b
where a.sql_address =b.address order by address, piece;

13. 监控字典缓冲区

SELECT (SUM(PINS - RELOADS)) / SUM(PINS) "LIB CACHE" FROM V$LIBRARYCACHE;
SELECT (SUM(GETS - GETMISSES - USAGE - FIXED)) / SUM(GETS) "ROW CACHE" FROM V$ROWCACHE;
SELECT SUM(PINS) "EXECUTIONS", SUM(RELOADS) "CACHE MISSES WHILE EXECUTING" FROM V$LIBRARYCACHE;

后者除以前者,此比率小于1%,接近0%为好。

SELECT SUM(GETS) "DICTIONARY GETS",SUM(GETMISSES) "DICTIONARY CACHE GET MISSES"
FROM V$ROWCACHE

14. 找ORACLE字符集

select * from sys.props$ where name='NLS_CHARACTERSET';

15. 监控 MTS

select busy/(busy+idle) "shared servers busy" from v$dispatcher;

此值大于0.5时,参数需加大

select sum(wait)/sum(totalq) "dispatcher waits" from v$queue where type='dispatcher';
select count(*) from v$dispatcher;
select servers_highwater from v$mts;

servers_highwater接近mts_max_servers时,参数需加大

16. 碎片程度

上一页  1 2 3 4  下一页

Tags:Oracle 常用 监控

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接