{"action":"opened","number":3774,"pull_request":{"url":"https://api.github.com/repos/sqlcollaborative/dbatools/pulls/3774","id":199916769,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5OTE2NzY5","html_url":"https://github.com/sqlcollaborative/dbatools/pull/3774","diff_url":"https://github.com/sqlcollaborative/dbatools/pull/3774.diff","patch_url":"https://github.com/sqlcollaborative/dbatools/pull/3774.patch","issue_url":"https://api.github.com/repos/sqlcollaborative/dbatools/issues/3774","number":3774,"state":"open","locked":false,"title":"Clear single use ad-hoc plan for cache","user":{"login":"tboggiano","id":26776763,"node_id":"MDQ6VXNlcjI2Nzc2NzYz","avatar_url":"https://avatars0.githubusercontent.com/u/26776763?v=4","gravatar_id":"","url":"https://api.github.com/users/tboggiano","html_url":"https://github.com/tboggiano","followers_url":"https://api.github.com/users/tboggiano/followers","following_url":"https://api.github.com/users/tboggiano/following{/other_user}","gists_url":"https://api.github.com/users/tboggiano/gists{/gist_id}","starred_url":"https://api.github.com/users/tboggiano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tboggiano/subscriptions","organizations_url":"https://api.github.com/users/tboggiano/orgs","repos_url":"https://api.github.com/users/tboggiano/repos","events_url":"https://api.github.com/users/tboggiano/events{/privacy}","received_events_url":"https://api.github.com/users/tboggiano/received_events","type":"User","site_admin":false},"body":"Issue 2966\r\n\r\n<!-- Below information IS REQUIRED with every PR -->\r\n## Type of Change\r\n<!-- What type of change does your code introduce -->\r\n - [ ] Bug fix (non-breaking change, fixes #<enter issue number>)\r\n - [X] New feature (non-breaking change, adds functionality)\r\n - [ ] Breaking change (effects multiple commands or functionality)\r\n - [ ] Ran manual Pester test and has passed (`.\\tests\\manual.pester.ps1)\r\n - [ ] Adding code coverage to existing functionality\r\n - [ ] Pester test is included\r\n - [ ] Nunit test is included\r\n - [ ] Documentation\r\n - [ ] Build system\r\n \r\n<!-- Below this line you can erase anything that is not applicable -->\r\n### Purpose\r\nTo clear ad-hoc queries from the plan cache.\r\n### Approach\r\nUses T-SQL to execute DBCC FREESYSTEMCACHE(‘SQL Plans’) to clear plan cache when single used ad-hoc plans if over the defined threshold.  Also, included is a cmdlet juat check the single use ad-hoc plans usage on your SQL Server instances.\r\n### Commands to test\r\nCommands are in the help.\r\n\r\n### Learning\r\n\tInclude:\r\n\t - Notes can be found in issue 2966\r\n","created_at":"2018-07-07T22:50:40Z","updated_at":"2018-07-07T22:50:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sqlcollaborative/dbatools/pulls/3774/commits","review_comments_url":"https://api.github.com/repos/sqlcollaborative/dbatools/pulls/3774/comments","review_comment_url":"https://api.github.com/repos/sqlcollaborative/dbatools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sqlcollaborative/dbatools/issues/3774/comments","statuses_url":"https://api.github.com/repos/sqlcollaborative/dbatools/statuses/aa38a5ec102996639cb0dfee7c63d1c5be1e63a9","head":{"label":"tboggiano:clear-plancache","ref":"clear-plancache","sha":"aa38a5ec102996639cb0dfee7c63d1c5be1e63a9","user":{"login":"tboggiano","id":26776763,"node_id":"MDQ6VXNlcjI2Nzc2NzYz","avatar_url":"https://avatars0.githubusercontent.com/u/26776763?v=4","gravatar_id":"","url":"https://api.github.com/users/tboggiano","html_url":"https://github.com/tboggiano","followers_url":"https://api.github.com/users/tboggiano/followers","following_url":"https://api.github.com/users/tboggiano/following{/other_user}","gists_url":"https://api.github.com/users/tboggiano/gists{/gist_id}","starred_url":"https://api.github.com/users/tboggiano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tboggiano/subscriptions","organizations_url":"https://api.github.com/users/tboggiano/orgs","repos_url":"https://api.github.com/users/tboggiano/repos","events_url":"https://api.github.com/users/tboggiano/events{/privacy}","received_events_url":"https://api.github.com/users/tboggiano/received_events","type":"User","site_admin":false},"repo":{"id":139345847,"node_id":"MDEwOlJlcG9zaXRvcnkxMzkzNDU4NDc=","name":"dbatools","full_name":"tboggiano/dbatools","owner":{"login":"tboggiano","id":26776763,"node_id":"MDQ6VXNlcjI2Nzc2NzYz","avatar_url":"https://avatars0.githubusercontent.com/u/26776763?v=4","gravatar_id":"","url":"https://api.github.com/users/tboggiano","html_url":"https://github.com/tboggiano","followers_url":"https://api.github.com/users/tboggiano/followers","following_url":"https://api.github.com/users/tboggiano/following{/other_user}","gists_url":"https://api.github.com/users/tboggiano/gists{/gist_id}","starred_url":"https://api.github.com/users/tboggiano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tboggiano/subscriptions","organizations_url":"https://api.github.com/users/tboggiano/orgs","repos_url":"https://api.github.com/users/tboggiano/repos","events_url":"https://api.github.com/users/tboggiano/events{/privacy}","received_events_url":"https://api.github.com/users/tboggiano/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tboggiano/dbatools","description":"PowerShell module to help SQL Server Pros be more productive","fork":true,"url":"https://api.github.com/repos/tboggiano/dbatools","forks_url":"https://api.github.com/repos/tboggiano/dbatools/forks","keys_url":"https://api.github.com/repos/tboggiano/dbatools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tboggiano/dbatools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tboggiano/dbatools/teams","hooks_url":"https://api.github.com/repos/tboggiano/dbatools/hooks","issue_events_url":"https://api.github.com/repos/tboggiano/dbatools/issues/events{/number}","events_url":"https://api.github.com/repos/tboggiano/dbatools/events","assignees_url":"https://api.github.com/repos/tboggiano/dbatools/assignees{/user}","branches_url":"https://api.github.com/repos/tboggiano/dbatools/branches{/branch}","tags_url":"https://api.github.com/repos/tboggiano/dbatools/tags","blobs_url":"https://api.github.com/repos/tboggiano/dbatools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tboggiano/dbatools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tboggiano/dbatools/git/refs{/sha}","trees_url":"https://api.github.com/repos/tboggiano/dbatools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tboggiano/dbatools/statuses/{sha}","languages_url":"https://api.github.com/repos/tboggiano/dbatools/languages","stargazers_url":"https://api.github.com/repos/tboggiano/dbatools/stargazers","contributors_url":"https://api.github.com/repos/tboggiano/dbatools/contributors","subscribers_url":"https://api.github.com/repos/tboggiano/dbatools/subscribers","subscription_url":"https://api.github.com/repos/tboggiano/dbatools/subscription","commits_url":"https://api.github.com/repos/tboggiano/dbatools/commits{/sha}","git_commits_url":"https://api.github.com/repos/tboggiano/dbatools/git/commits{/sha}","comments_url":"https://api.github.com/repos/tboggiano/dbatools/comments{/number}","issue_comment_url":"https://api.github.com/repos/tboggiano/dbatools/issues/comments{/number}","contents_url":"https://api.github.com/repos/tboggiano/dbatools/contents/{+path}","compare_url":"https://api.github.com/repos/tboggiano/dbatools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tboggiano/dbatools/merges","archive_url":"https://api.github.com/repos/tboggiano/dbatools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tboggiano/dbatools/downloads","issues_url":"https://api.github.com/repos/tboggiano/dbatools/issues{/number}","pulls_url":"https://api.github.com/repos/tboggiano/dbatools/pulls{/number}","milestones_url":"https://api.github.com/repos/tboggiano/dbatools/milestones{/number}","notifications_url":"https://api.github.com/repos/tboggiano/dbatools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tboggiano/dbatools/labels{/name}","releases_url":"https://api.github.com/repos/tboggiano/dbatools/releases{/id}","deployments_url":"https://api.github.com/repos/tboggiano/dbatools/deployments","created_at":"2018-07-01T16:50:27Z","updated_at":"2018-07-01T16:50:33Z","pushed_at":"2018-07-07T22:43:04Z","git_url":"git://github.com/tboggiano/dbatools.git","ssh_url":"git@github.com:tboggiano/dbatools.git","clone_url":"https://github.com/tboggiano/dbatools.git","svn_url":"https://github.com/tboggiano/dbatools","homepage":"https://dbatools.io","size":91496,"stargazers_count":0,"watchers_count":0,"language":"PowerShell","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"development"}},"base":{"label":"sqlcollaborative:development","ref":"development","sha":"f835253cba62f30ca7fcacd9f556b12f2dda97fd","user":{"login":"sqlcollaborative","id":22203347,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMjAzMzQ3","avatar_url":"https://avatars3.githubusercontent.com/u/22203347?v=4","gravatar_id":"","url":"https://api.github.com/users/sqlcollaborative","html_url":"https://github.com/sqlcollaborative","followers_url":"https://api.github.com/users/sqlcollaborative/followers","following_url":"https://api.github.com/users/sqlcollaborative/following{/other_user}","gists_url":"https://api.github.com/users/sqlcollaborative/gists{/gist_id}","starred_url":"https://api.github.com/users/sqlcollaborative/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sqlcollaborative/subscriptions","organizations_url":"https://api.github.com/users/sqlcollaborative/orgs","repos_url":"https://api.github.com/users/sqlcollaborative/repos","events_url":"https://api.github.com/users/sqlcollaborative/events{/privacy}","received_events_url":"https://api.github.com/users/sqlcollaborative/received_events","type":"Organization","site_admin":false},"repo":{"id":30215226,"node_id":"MDEwOlJlcG9zaXRvcnkzMDIxNTIyNg==","name":"dbatools","full_name":"sqlcollaborative/dbatools","owner":{"login":"sqlcollaborative","id":22203347,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMjAzMzQ3","avatar_url":"https://avatars3.githubusercontent.com/u/22203347?v=4","gravatar_id":"","url":"https://api.github.com/users/sqlcollaborative","html_url":"https://github.com/sqlcollaborative","followers_url":"https://api.github.com/users/sqlcollaborative/followers","following_url":"https://api.github.com/users/sqlcollaborative/following{/other_user}","gists_url":"https://api.github.com/users/sqlcollaborative/gists{/gist_id}","starred_url":"https://api.github.com/users/sqlcollaborative/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sqlcollaborative/subscriptions","organizations_url":"https://api.github.com/users/sqlcollaborative/orgs","repos_url":"https://api.github.com/users/sqlcollaborative/repos","events_url":"https://api.github.com/users/sqlcollaborative/events{/privacy}","received_events_url":"https://api.github.com/users/sqlcollaborative/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sqlcollaborative/dbatools","description":"PowerShell module to help SQL Server Pros be more productive","fork":false,"url":"https://api.github.com/repos/sqlcollaborative/dbatools","forks_url":"https://api.github.com/repos/sqlcollaborative/dbatools/forks","keys_url":"https://api.github.com/repos/sqlcollaborative/dbatools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sqlcollaborative/dbatools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sqlcollaborative/dbatools/teams","hooks_url":"https://api.github.com/repos/sqlcollaborative/dbatools/hooks","issue_events_url":"https://api.github.com/repos/sqlcollaborative/dbatools/issues/events{/number}","events_url":"https://api.github.com/repos/sqlcollaborative/dbatools/events","assignees_url":"https://api.github.com/repos/sqlcollaborative/dbatools/assignees{/user}","branches_url":"https://api.github.com/repos/sqlcollaborative/dbatools/branches{/branch}","tags_url":"https://api.github.com/repos/sqlcollaborative/dbatools/tags","blobs_url":"https://api.github.com/repos/sqlcollaborative/dbatools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sqlcollaborative/dbatools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sqlcollaborative/dbatools/git/refs{/sha}","trees_url":"https://api.github.com/repos/sqlcollaborative/dbatools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sqlcollaborative/dbatools/statuses/{sha}","languages_url":"https://api.github.com/repos/sqlcollaborative/dbatools/languages","stargazers_url":"https://api.github.com/repos/sqlcollaborative/dbatools/stargazers","contributors_url":"https://api.github.com/repos/sqlcollaborative/dbatools/contributors","subscribers_url":"https://api.github.com/repos/sqlcollaborative/dbatools/subscribers","subscription_url":"https://api.github.com/repos/sqlcollaborative/dbatools/subscription","commits_url":"https://api.github.com/repos/sqlcollaborative/dbatools/commits{/sha}","git_commits_url":"https://api.github.com/repos/sqlcollaborative/dbatools/git/commits{/sha}","comments_url":"https://api.github.com/repos/sqlcollaborative/dbatools/comments{/number}","issue_comment_url":"https://api.github.com/repos/sqlcollaborative/dbatools/issues/comments{/number}","contents_url":"https://api.github.com/repos/sqlcollaborative/dbatools/contents/{+path}","compare_url":"https://api.github.com/repos/sqlcollaborative/dbatools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sqlcollaborative/dbatools/merges","archive_url":"https://api.github.com/repos/sqlcollaborative/dbatools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sqlcollaborative/dbatools/downloads","issues_url":"https://api.github.com/repos/sqlcollaborative/dbatools/issues{/number}","pulls_url":"https://api.github.com/repos/sqlcollaborative/dbatools/pulls{/number}","milestones_url":"https://api.github.com/repos/sqlcollaborative/dbatools/milestones{/number}","notifications_url":"https://api.github.com/repos/sqlcollaborative/dbatools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sqlcollaborative/dbatools/labels{/name}","releases_url":"https://api.github.com/repos/sqlcollaborative/dbatools/releases{/id}","deployments_url":"https://api.github.com/repos/sqlcollaborative/dbatools/deployments","created_at":"2015-02-02T23:50:31Z","updated_at":"2018-07-07T06:49:56Z","pushed_at":"2018-07-07T06:49:59Z","git_url":"git://github.com/sqlcollaborative/dbatools.git","ssh_url":"git@github.com:sqlcollaborative/dbatools.git","clone_url":"https://github.com/sqlcollaborative/dbatools.git","svn_url":"https://github.com/sqlcollaborative/dbatools","homepage":"https://dbatools.io","size":90884,"stargazers_count":607,"watchers_count":607,"language":"PowerShell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":336,"mirror_url":null,"archived":false,"open_issues_count":300,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":336,"open_issues":300,"watchers":607,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/sqlcollaborative/dbatools/pulls/3774"},"html":{"href":"https://github.com/sqlcollaborative/dbatools/pull/3774"},"issue":{"href":"https://api.github.com/repos/sqlcollaborative/dbatools/issues/3774"},"comments":{"href":"https://api.github.com/repos/sqlcollaborative/dbatools/issues/3774/comments"},"review_comments":{"href":"https://api.github.com/repos/sqlcollaborative/dbatools/pulls/3774/comments"},"review_comment":{"href":"https://api.github.com/repos/sqlcollaborative/dbatools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sqlcollaborative/dbatools/pulls/3774/commits"},"statuses":{"href":"https://api.github.com/repos/sqlcollaborative/dbatools/statuses/aa38a5ec102996639cb0dfee7c63d1c5be1e63a9"}},"author_association":"NONE","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":189,"deletions":0,"changed_files":2}}
{"actor":{"display_login":"tboggiano"}}