Oracle Location SQL

Source: Internet
Author: User

----Querying the current database for blocking SQL

Select COUNT (*), Sql_id,min (Sql_exec_start), sql_child_number from v$session where status= ' ACTIVE ' GROUP by Sql_id,sql_ Child_number ORDER by 1, 3;

---Blocking SQL content based on SQL_ID queries

SELECT * from V$sql where sql_id= ' CCT9Z95T5SSGA ';

---Query bound variables based on SQL content query

SELECT b.name, B.position, b.datatype_string, b.value_string
From V$sql_bind_capture B, V$sqlarea a
WHERE B.hash_value = A.hash_value
and b.sql_id = a.sql_id
and a.sql_id = ' CCT9Z95T5SSGA ';

-----Execute the plan based on a full SQL query, or execute the plan directly based on the SQL_ID query

SELECT * from TABLE (Dbms_xplan. Display_cursor (' &1 ', &2, ' advanced-projection ');---the first variable is sql_id

---query the SQL corresponding host, IP address and other information according to SQL_ID

Select A.username,a.schemaname,a.machine,a.program,a.module,a.client_info from V$session a where a.sql_id= ' &1 '

----If the SQL content is not already queried in V$sql, V$sqlarea

SELECT * from Dba_hist_sqltext q where q.sql_id= ' CCT9Z95T5SSGA '

---Host information cannot be queried in v$session

SELECT * from Dba_hist_active_sess_history w where w.sql_id= ' Cct9z95t5ssga '

-OR

SELECT * from V$active_session_history w where w.sql_id= ' Cct9z95t5ssga '

Oracle Location 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.