Query to flush the running sql ## oracle Database ##

Query to flush the running sql ## oracle Database ##


Some times we have to flush the running sql due to bad sql plan. New sql plan can be picked if we can flush the running sql. Make sure the running sql has bad sql plan before flushing it.


Find the sql_id using below query.


select sid,serial#,sql_id from v$session where sid=438;




Flush the running sql from shared pool using below steps.


Step A: 


select address, hash_value from v$sqlarea where sql_id like 'gr7q58thdjntu';


Step B:


exec dbms_shared_pool.purge('00000000qaqla8, 2358767','C');

Comments

Popular posts from this blog

ORA-01565: error in identifying file '?/dbs/spfile@.ora'

Reboot Exadata Machine

How to combine Oracle .ova files