執行 TSQL 語法並透過 DMV 找出該執行計畫的 plan_handle
USE AdventrueWorks2016 GO SELECT * FROM Person.Person GO SELECT cap.plan_handle , cap.usecounts , cap.cacheobjtype , cap.objtype , st.text FROM sys.dm_exec_cached_plans AS cap CROSS APPLY sys.dm_exec_sql_text(cap.plan_handle) AS st WHERE st.text NOT LIKE '%sys%' AND st.text LIKE N'SELECT * FROM Person.Person%' GO
清除指定執行計畫
DBCC FREEPROCCACHE(0x06000900FB17592A9082C9015102000001000000000000000000000000000000000000000000000000000000)
沒有留言:
張貼留言