I work on a system that comprises of a SQL Server 2012 DB server that is queried frequently with complex queries. Sometimes these queries take more than 2 or 3 mins to return.
How can I record or log the execution plans for these queries when they run for more than a certain time ( configurable - say 1 mins etc ) ?