Oracle consumes more resources for SQL

Source: Internet
Author: User

Time:

Select Sql_id,sid,serial#,username,target, Sql_plan_operation,sofar blocks_read,totalwork total_blocks,round (time_ REMAINING/60) minutes from V$session_longops
where sofar<>totalwork
and Username= ' XXX '

Sofar:units of work do so far for the operation specified in the Opname column
This value will always increase.

Totalwork:total units of work for the operation specified in the Opname column
Estimated total data block read volume, does not change

Time_remaining:estimate (in seconds) of time remaining for the operation to complete

V$session_longops Displays the status of various operations that run for longer than 6 seconds (in absolute time). These operations currently include many backup and recovery functions, statistics gathering, and query execution, and more Operations is added for every Oracle release.

The official documentation does not provide a detailed introduction to the V$session_longops principle, and to monitor an operation through V$session_longops, the following conditions are required:

1 perform operation for more than 6 seconds
2 Execute Operation Access data block must be greater than 10000
3 must be set timed_statistics or open Sql_trace
4 The correspondence in the performing operation must be analyzed by dbms_stats or analyze

Io

Select Sql_id,disk_reads from
(select sql_id,buffer_gets,disk_reads,sorts,cpu_time/1000000 cpu,rows_processed,elapsed_time from V$sqlstats
ORDER BY disk_reads Desc

---The exact sort of information to choose from, and the multiple values in this view are cumulative

Oracle consumes more resources for SQL

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.