--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