-
Notifications
You must be signed in to change notification settings - Fork 997
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
sp_DatabaseRestore - Not all commands are logged to table #2700
Comments
I've adjusted the code, ready to test. |
#2700 sp_DatabaseRestore added CommandExecute
Thanks for the code! I've merged it into the dev branch, and it'll be in the December release with credit to you in the release notes. |
@BrentOzar @fvanderhaegen - when I run this with Ola's latest version of CommandExecute, it requires a parameter called DatabaseContext which is not supplied in sp_DatabaseRestore. Happy to try and fix it, but if we go down this route then you are strongly coupling sp_DatabaseRestore to Ola's CommandExecute which may not be desirable if he changes the parameters again. Thoughts? |
That's a great question. I've tried asking him to make new parameters default to null, and he hasn't been responsive to that. I agree that strongly coupling it is a problem, but I think it's a great idea too, given how useful it would be to have the logging. How do you feel about it? |
I'm ok with it, but we need to make sure that we're on the current version of Ola's script. I'm working on some changes at the moment to sp_DatabaseRestore, should I just fix it while I'm in here? |
Perfect, sounds good! Thanks sir! |
I thought about this a bit more overnight, and I'm less ok with it than I was. I think if you're going to take on a dependency like this, then you need to make it easy to find the right (supported) version of Ola's script, ideally have it install with this script. The problem with that though, is that if sp_DatabaseRestore isn't depending on the same version of Ola's scripts as I'm using for backups, then I can't use Ola's scripts for backups and sp_DatabaseRestore for restores on the same server. To highlight the problem, my change last night has now forced @fvanderhaegen to upgrade Ola's scripts to use sp_DatabaseRestore...maybe they don't want to, maybe they can't find the time to test it, maybe some management process means they can't easily update it. Whatever the case, sp_DatabaseRestore is now unworkable until they upgrade their backup process. My final thought is that I have sp_DatabaseRestore as part of a DR run-sheet. If everything burns down and we're restoring from tape, then sp_DatabaseRestore is the easiest way to get our backups running on a new server. There's no an extra dependency I need to install. I'm happy to update my run sheet now I know about it, but if I found that problem in the middle of the night during a disaster then I'd be less happy about it. The logging is great, and I want to keep it for that reason, but it's a fundamental change that could go very wrong. That's just my opinion, happy for you to disagree. |
There was already a dependency with Ola's script before my change. |
In sp_DatabaseRestore not all commands are executed with [dbo].[CommandExecute]. So if something goes wrong nothing gets logged.
I'll adjust the code
The text was updated successfully, but these errors were encountered: