---- Query the current database to block 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;
--- Query blocking SQL content according to SQL_ID
select * from v$sql where sql_id='cct9z95t5ssga';
--- Query Query bind variables based on SQL content
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';
----- According to the complete SQL query execution plan; or directly according to the SQL_ID query execution plan
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR('&1',&2, 'ADVANCED -PROJECTION'));---the first variable is SQL_ID
---Query the host, IP address and other information corresponding to SQL 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 cannot be queried in v$sql and 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'