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

SqlSetup: The resource should support the action REBUILDDATABASE #761

Open
ChrisLGardner opened this issue Aug 15, 2017 · 8 comments
Open
Labels
enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community.

Comments

@ChrisLGardner
Copy link
Contributor

If SQL is already installed on a machine (such as Azure images) then using xSqlServerSetup to change any of the other configurations other than Features doesn't do anything.

Should we extend xSqlServerSetup Test-TargetResource to include checking collation (and eventually all the other possible settings)?

Do we want to extend xSqlServerDatabase to also allow setting collation that isn't the same as the server level one.

I'm happy to work on a PR for the xSqlServerSetup section.

@johlju
Copy link
Member

johlju commented Aug 16, 2017

We had a discussion here where we discussed that if setup.exe can not do the change, then the resource xSQLServerSetup should not change those properties. This is open for debate, though. I don't want a new resource for every setting/property, so if changing collation for the server is not part of xSQLServerSetup, then maybe changing collation should be in a resource called something like xSQLServerSettings?

Sounds good extending xSQLServerDatabase to change collation for a database. Please open a separate issue for that though.

@johlju johlju added the enhancement The issue is an enhancement request. label Aug 16, 2017
@ChrisLGardner
Copy link
Contributor Author

The current method I'm using is a Script block that just calls Setup.exe and gives it the collation to use so I think it's appropriate for the xSQLServerSetup resource.

I'll look at how best to test the collation is correct as that should be the only change that's needed, the rest of the functionality is already there for applying the collation.

@johlju
Copy link
Member

johlju commented Aug 16, 2017

Cool. Sounds great. I label this as "in progress" then.

@johlju johlju added the in progress The issue is being actively worked on by someone. label Aug 16, 2017
@ChrisLGardner
Copy link
Contributor Author

I did some digging into this and it doesn't look like setup.exe can do it as expected. There is an alternate approach but that drops all other databases than the system ones so not really appropriate for this. I think this can be closed and I'll try to look at setting collation on individual databases in it's own resource or as a extension to another resource.

@johlju johlju removed the in progress The issue is being actively worked on by someone. label Sep 19, 2017
@johlju
Copy link
Member

johlju commented Sep 19, 2017

As mentioned above. Please submit a new issue to extend the xSQLServerDatabase resource. Looking forward to a PR for xSQLServerDatabase that supports changing collation! 😄

Closing this issue since this was related to server collation, and it seemed it wasn't practical to change it.

@johlju johlju closed this as completed Sep 19, 2017
@flouwers
Copy link

Changing the collation can be done by launching the setup.exe with "/REBUILDDATABASE" switch.
However, this command is not implemented in the DSC module. Could that be added in a future release ? (BTW I already implemented this workaround)

@johlju
Copy link
Member

johlju commented Oct 25, 2017

@flouwers That action will destroy any user databases currently on the system. But it do have the ability to Set or Change the Server Collation. If someone wants to implement this and send in a PR, then sure I'm happy to merge it so we get this functionality into a future release. 😄

@flouwers Are you up to extending xSQLServerSetup (with code and unit tests) it if you already have code for it? In the mean time I label this one as help wanted until someone wants to run with it. 😄

Changing and reopening this issue title to add support for action REBUILDDATABASE.

@johlju johlju changed the title Change Collation for Server/DB? xSQLServerSetup: The resource should support the action REBUILDDATABASE Oct 25, 2017
@johlju
Copy link
Member

johlju commented Oct 25, 2017

Reopening this issue with a new issue title since this will not only enable changing collation, but could potentially be used for other scenarios.

@johlju johlju reopened this Oct 25, 2017
@johlju johlju added the help wanted The issue is up for grabs for anyone in the community. label Oct 25, 2017
@johlju johlju changed the title xSQLServerSetup: The resource should support the action REBUILDDATABASE SqlSetup: The resource should support the action REBUILDDATABASE Dec 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community.
Projects
None yet
Development

No branches or pull requests

3 participants