Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBCC Console Commands and Tests #4698

Merged
merged 9 commits into from
Nov 29, 2018
Merged

DBCC Console Commands and Tests #4698

merged 9 commits into from
Nov 29, 2018

Conversation

sqllensman
Copy link
Contributor

@sqllensman sqllensman commented Nov 28, 2018

Type of Change

  • Bug fix (non-breaking change, fixes #)
  • New feature (non-breaking change, adds functionality)
  • Breaking change (effects multiple commands or functionality)
  • Ran manual Pester test and has passed (`.\tests\manual.pester.ps1)
  • Adding code coverage to existing functionality
  • Pester test is included
  • Nunit test is included
  • Documentation
  • Build system

Purpose

Implement the following DBCC Commands
DBCC HELP
DBCC FREEPROCCACHE
DBCC FREESESSIONCACHE
DBCC FREESYSTEMCACHE
DBCC MEMORYSTATUS
DBCC PROCCACHE
DBCC USEROPTIONS

Commands to test

Get-DbaDbccHelp
Get-DbaDbccMemoryStatus
Get-DbaDbccProcCache
Get-DbaDbccUserOptions
Invoke-DbaDbccFreeCache

Learning

Based on details in
https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-transact-sql?view=sql-server-2017

@potatoqualitee
Copy link
Member

Ohh this is beautiful 😍!! Thank you! Will do a quick review.

Copy link
Member

@potatoqualitee potatoqualitee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incredibly beautiful and better than I could have imagined doing myself, thank you so much!

.PARAMETER SqlCredential
Login to the target instance using alternative credentials. Windows and SQL Authentication supported. Accepts credential objects (Get-Credential)

.PARAMETER DbccStatement
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Dbcc will be implied - can you change this to just Statement

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Will update command and tests.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty!

functions/Get-DbaDbccMemoryStatus.ps1 Show resolved Hide resolved
functions/Get-DbaDbccMemoryStatus.ps1 Outdated Show resolved Hide resolved
functions/Get-DbaDbccProcCache.ps1 Outdated Show resolved Hide resolved
functions/Invoke-DbaDbccFreeCache.ps1 Outdated Show resolved Hide resolved
begin {
$stringBuilder = New-Object System.Text.StringBuilder
$null = $stringBuilder.Append("DBCC USEROPTIONS WITH NO_INFOMSGS")
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so sorry i just realized this is plural, can you make it Get-DbaDbccUserOption and add an Option param for filtering. Then it should probably be Option, Value and we'll be set. If you don't see this by my time tomorrow, ill merge and update

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should an Exclude option also be included?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, if i could go back in time, i'd only include Excludes in exports and copies

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I will make changes latter today and update the pull request

@potatoqualitee
Copy link
Member

truly awesome! thanks so much 🙇

@potatoqualitee potatoqualitee merged commit f48bee0 into dataplat:development Nov 29, 2018
@sqllensman
Copy link
Contributor Author

The new files are in the 0.9.535 release but the psd1 file is
(1) Missing reference to Invoke- DbaDbccFreeCache
(2) Still referring to Get- DbaDbccUserOptions rather than Get-DbaDbccUserOption

In the FunctionsToExport section

@potatoqualitee
Copy link
Member

my apologies. iwill fix this within the hour.

@potatoqualitee
Copy link
Member

fixed 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants