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;