Clear procedure cache (execution plan)

For SQLServer:
— Clears all the procedure cache (works on SQLServer 2005 and SQLServer 2008)
DBCC FREEPROCCACHE http://msdn.microsoft.com/en-us/library/ms174283%28v=SQL.90%29.aspx

— 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 ) ] http://msdn.microsoft.com/en-us/library/ms174283%28v=SQL.105%29.aspx

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:

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s