SQL Execution time, SQL Execution

Source: Internet
Author: User
Tags sql server query

SQL Execution time, SQL Execution

Enable SQL Execution time statistics
Set timing on;

 

Check whether SQL statements with long execution time exist.
Select a. sid, B. SQL _text
From v $ session a, v $ sqlarea B
Where a. SQL _hash_value = B. hash_value
And a. sid in
(Select sid from GV $ Session_longops where TIME_REMAINING> 0 );


How to test the SQL statement execution time in the SQL server Query Analyzer

Query-query option-advanced, there is a set statistics time hook, and then execute the SQL statement, read the message, there will be execution TIME

How to view the remaining time of SQL Execution, view through the view

SELECT c. STATUS, time_remaining/60 remaining time minutes, SQL _text Execute SQL, machine, message
From v $ SESSION_LONGOPS a inner join v $ SQL B on
A. SQL _hash_value = B. hash_value
Inner join v $ session c on a. sid = c. sid
Where sofar <totalwork
Order by time_remaining desc

This is the estimated time of oracle Based on the executed and unexecuted blocks. It may not be very accurate and can only be referred

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.