程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> Oracle數據庫 >> Oracle教程 >> oracle調優使用到相關sql,oracle調優相關sql

oracle調優使用到相關sql,oracle調優相關sql

編輯:Oracle教程

oracle調優使用到相關sql,oracle調優相關sql


select * from v$session where username is not null;
select username,count(username) from v$session where username is not null group by username;
select count(*) from v$process;
select value from v$parameter where name = 'processes';
Select count(*) from v$session where status='ACTIVE';
SELECT NAME, VALUE, DISPLAY_VALUE FROM V$PARAMETER WHERE NAME ='spfile';
SELECT COUNT(1) FROM v$spparameter where value is not null;
select user_name, count(user_name) from v$open_cursor group by user_name;
SELECT MAX(A.VALUE) AS HIGHEST_OPEN_CUR, P.VALUE AS MAX_OPEN_CUR
FROM V$SESSTAT A, V$STATNAME B, V$PARAMETER P WHERE A.STATISTIC# = B.STATISTIC#
AND B.NAME = 'opened cursors current' AND P.NAME = 'open_cursors' GROUP BY P.VALUE;
SELECT A.VALUE, S.USERNAME, S.SID, S.SERIAL# FROM V$SESSTAT A, V$STATNAME B, V$SESSION S WHERE A.STATISTIC# = B.STATISTIC#
AND S.SID = A.SID AND B.NAME = 'opened cursors curent';

SELECT NAME, VALUE FROM V$SYSSTAT WHERE NAME LIKE '%cursor%';
SELECT NAME, VALUE FROM V$SYSSTAT WHERE NAME LIKE '%parse%';
SELECT 'session_cached_cursors' PARAMETER, LPAD(VALUE, 5) VALUE,
DECODE(VALUE, 0, ' n/a', TO_CHAR(100 * USED / VALUE, '990') || '%') USAGE
FROM (SELECT MAX(S.VALUE) USED FROM V$STATNAME N, V$SESSTAT S WHERE N.NAME = 'session cursor cache count' AND S.STATISTIC# = N.STATISTIC#),
(SELECT VALUE FROM V$PARAMETER WHERE NAME = 'session_cached_cursors')
UNION ALL
SELECT 'open_cursors', LPAD(VALUE, 5), TO_CHAR(100 * USED / VALUE, '990') || '%' FROM (SELECT MAX(SUM(S.VALUE)) USED
FROM V$STATNAME N, V$SESSTAT S WHERE N.NAME IN ('opened cursors current', 'session cursor cache count')
AND S.STATISTIC# = N.STATISTIC# GROUP BY S.SID), (SELECT VALUE FROM V$PARAMETER WHERE NAME = 'open_cursors');

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved