Oracle tuning uses related SQL, oracle tuning related SQL

Source: Internet
Author: User

Oracle tuning uses related SQL, oracle tuning related 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 = 'processs ';
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. VALUE, S. USERNAME, S. SID, S. SERIAL # from v $ sesstat a, V $ statname B, V $ SESSION S WHERE. 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, '000000') | '%') 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, '000000') |' % '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 ');

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.