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

New-DcnImage: Allow specifying a Recovery Model #186

Open
lowlydba opened this issue Apr 14, 2022 · 2 comments
Open

New-DcnImage: Allow specifying a Recovery Model #186

lowlydba opened this issue Apr 14, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@lowlydba
Copy link
Contributor

Is your feature request related to a problem? Please describe.
I imagine most use cases will want a clone to be in simple recovery mode, so being able to change the model at image creation would be an ideal way to ensure this is passed down to clones.

@sanderstad
Copy link
Collaborator

That would be a nice feature but people do need to be aware to take caution when doing IO heavy stuff in the database because that could let the clone grow really large.

@sanderstad sanderstad added the enhancement New feature or request label Apr 19, 2022
@lowlydba
Copy link
Contributor Author

lowlydba commented May 9, 2022

Maybe an easier (and more helpful) approach would be changing the temp DB name to a parameter (defaulting to the value used now) that way one could reliably reference it by name in their SQL script/file executed during image creation. That'd make any last-minute customization of the database very easy.

# Setup the temporary database name
$tempDbName = "$($db.Name)-dbaclone"

To allow for something like

$database = 'MyClone'
$tempDb = '$database-Temp123'
New-DcnImage -TempDb $tempDb ...

$sqlScript = "USE [master];
ALTER DATABASE [$tempDb] SET RECOVERY SIMPLE;"

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

No branches or pull requests

2 participants