Clear procedure cache (execution plan)

For SQLServer:
— Clears all the procedure cache (works on SQLServer 2005 and SQLServer 2008)

— On SQL Server 2008 one can clear cache for a specific plan/sql by specifying the handle
[ ( { plan_handle | sql_handle | pool_name } ) ]
DBCC FREEPROCCACHE [ ( { plan_handle | sql_handle ) ]

For Oracle
Shared pool is where the execution plan of SQL statements are stored. Shared pool also contains parsed SQL statements, packages which will get cleared too.
SQL> alter system flush shared_pool;

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.