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;
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%';
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 --
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: Upgrading OPatch Version
http://oracle-in-memory.blogspot.com/2016/02/12c-upgrading-opatch-version.html
http://oracle-in-memory.blogspot.com/2016/02/12c-new-notation-for-patching-number.html
12c: In Memory Column Store
http://oracle-in-memory.blogspot.com/2016/02/12c-upgrading-opatch-version.html
12c: Upgrading Oracle Multitenant database
12c: New Notation for Oracle Patching Numberhttp://oracle-in-memory.blogspot.com/2016/02/12c-new-notation-for-patching-number.html
12c: In Memory Column Store
12c: Heat Map and Automatic Data Optimization (ADO).
http://oracle-in-memory.blogspot.com/2015/11/12c-heat-map-and-automatic-data.html
http://oracle-in-memory.blogspot.com/2015/11/12c-heat-map-and-automatic-data.html
12c: In-database archiving
http://oracle-in-memory.blogspot.com/2015/11/12c-in-database-archiving.html
http://oracle-in-memory.blogspot.com/2015/11/12c-in-database-archiving.html
12c: parameter: temp_undo_enabled
http://oracle-in-memory.blogspot.com/2015/12/12c-parameter-tempundoenabled.html
12c: Trigger to open all pdbs after cdb reboothttp://oracle-in-memory.blogspot.com/2015/12/12c-parameter-tempundoenabled.html
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
12c: Creating Service on Pluggable Database using DBMS_SERVICE
http://oracle-in-memory.blogspot.com/2016/02/12c-creating-service-on-pdb.html
http://oracle-in-memory.blogspot.com/2016/02/12c-creating-service-on-pdb.html