Oracle Execution Plan deviation processing steps

Source: Internet
Author: User

--SQL Execution time
Select a.executions,a.elapsed_time,a.elapsed_time/a.executions/1000/1000 as seconds, A.sql_id,a.hash_value,a.address,a. Sql_text from Gv$session B,gv$sql a where a.hash_value=b.sql_hash_value and username in (' zlcftpub ', ' Zlcftuser ') and Statu s= ' ACTIVE ';
0nx7fbv1w5xg2
0nx7fbv1w5xg2

Select Sql_id,a.* from Gv$session a where username in (' zlcftpub ', ' Zlcftuser ') and status= ' ACTIVE ';
--select ' Alter system kill session ' | | sid| | ', ' | | serial#| | '; ' from gv$session where username= ' zlcftpub ' and status= ' ACTIVE '

SELECT * from Gv$sql a where a.parsing_schema_name in (' Zlcftpub ', ' zlcftuser ');

--Execution Plan resolution
SELECT * FROM table (dbms_xplan.display_cursor (' 0nx7fbv1w5xg2 ', NULL, ' Advanced allstats last Peeked_binds '))--where Plan_table_output like '%full% ';
SELECT * FROM table (dbms_xplan.display_cursor (' 0nx7fbv1w5xg2 '));
SELECT * FROM table (Dbms_xplan.display_awr (' 0nx7fbv1w5xg2 '));

3janh23tkjac4
A77srfk7ybrn8

--SQL statements
SELECT * from V$sql where sql_id= ' 0nx7fbv1w5xg2 '

--Stored procedures
SELECT object_name,created,last_ddl_time from user_objects WHERE object_type = ' PROCEDURE ' ORDER by last_ddl_time Desc;

--The most recently executed SQL
Select Sql_text,last_load_time from V$sql order by last_load_time Desc;

Oracle Execution Plan deviation processing steps

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.