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