Tuesday, March 22, 2016

Procedure to flush SQL_ID from Shared Pool : Oracle 12c


In order to change the plan we have flush the current cursor in the library cache. 
We can find existing cursor information with the help of SQL_ID :) 

Steps as follows 
Find out sql_id of the existing sql in memory using v$sqlarea; 
Using v$sqlarea we can find out "sql_id" as follows 
select sql_id, force_matching_signature, sql_text from v$sqlarea where SQL_TEXT like '%Select max%';

using DBMS_XPLAN.DISPLAY_CURSOR we can find "sql_id" stored in memory 
SQL>select * from TABLE(dbms_xplan.display_cursor('SQL_ID'));

Flush the cache from memory and using dbms_shared_pool.purge 
SQL>exec dbms_shared_pool.purge('address','old_hash_value','C');

--Nikhil Tatineni--
--Oracle Database 12c --
12c: Trigger to open all pdbs after cdb reboot
http://oracle-in-memory.blogspot.com/2016/02/12c-trigger-to-open-all-pdbs-after-cdb.html
12c: Clone pluggable database using existing Pluggable database

http://oracle-in-memory.blogspot.com/2016/02/12c-clone-pluggable-databases-using.html
12c: open & close Pluggable databases

http://oracle-in-memory.blogspot.com/2016/02/12c-open-close-pluggable-databases.html

12c: Rename PDB’S from CDB Root 
http://oracle-in-memory.blogspot.com/2016/02/12c-rename-pdbs-from-cdb-root.html
12c: Creating Service on Pluggable Database using DBMS_SERVICE
http://oracle-in-memory.blogspot.com/2016/02/12c-creating-service-on-pdb.html

Querys to monitor RAC

following few  Query's will help to find out culprits-  Query to check long running transaction from last 8 hours  Col Sid Fo...