SQL> select 'This is a test.' from dual; 'THISISATEST.' --------------- This is a test. SQL> select substr(sql_text,1,30), address, hash_value from v$sql where sql_text like 'select ''This is a test%'; SUBSTR(SQL_TEXT,1,30) ADDRESS HASH_VALUE ------------------------------ -------- ---------- select 'This is a test.' from 79B55950 3102535539 SQL> alter system flush shared_pool; System altered. SQL> select substr(sql_text,1,30), address, hash_value from v$sql where sql_text like 'select ''This is a test%'; no rows selected SQL> select 'This is a test.' from dual; 'THISISATEST.' --------------- This is a test. SQL> select substr(sql_text,1,30), address, hash_value from v$sql where sql_text like 'select ''This is a test%'; SUBSTR(SQL_TEXT,1,30) ADDRESS HASH_VALUE ------------------------------ -------- ---------- select 'This is a test.' from 79CE4B40 3102535539 SQL> exec sys.dbms_shared_pool.keep('79CE4B40, 3102535539', 'C') BEGIN sys.dbms_shared_pool.keep('79CE4B40, 3102535539', 'C'); END; * ERROR at line 1: ORA-06550: line 1, column 7: PLS-00201: identifier 'SYS.DBMS_SHARED_POOL' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored --Note: Do this only as SYS SQL> @?\rdbms\admin\dbmspool Package created. Grant succeeded. View created. Package body created. SQL> exec sys.dbms_shared_pool.keep('79CE4B40, 3102535539', 'C') PL/SQL procedure successfully completed. SQL> alter system flush shared_pool; System altered. SQL> select substr(sql_text,1,30), address, hash_value from v$sql where sql_text like 'select ''This is a test%'; SUBSTR(SQL_TEXT,1,30) ADDRESS HASH_VALUE ------------------------------ -------- ---------- select 'This is a test.' from 79CE4B40 3102535539 SQL> exec sys.dbms_shared_pool.unkeep('79CE4B40, 3102535539', 'C') PL/SQL procedure successfully completed. SQL> select substr(sql_text,1,30), address, hash_value from v$sql where sql_text like 'select ''This is a test%'; SUBSTR(SQL_TEXT,1,30) ADDRESS HASH_VALUE ------------------------------ -------- ---------- select 'This is a test.' from 79CE4B40 3102535539 SQL> alter system flush shared_pool; System altered. SQL> select substr(sql_text,1,30), address, hash_value from v$sql where sql_text like 'select ''This is a test%'; no rows selected Note: A kept cursor (or any library cache object) has v$db_object_cache.kept='YES'. Additional notes: For obvious reason, objects being used can't be flushed either. If you run select 'abcd' from dual; in one session and don't do anything else, then *in another session*, flush shared pool, then that line still shows up in v$sql. This is because that first session still holds a null mode (mode 1) kgl (library cache) lock (a.k.a. breakable parse lock) on the cursor, visible in select * from dba_kgllock where kgllkhdl = (select address from v$sql where sql_text like '%abcd%') If you want to flush that cursor, simply do something trivial in the first session such as desc mytable (but not something purely client side such as set pagesize 100), then the null mode lock is released. Then you can flush it. Even if an object is marked as kept, it may still be reloaded because it may be invalidated. See section 7 of A of Note:311689.1.