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

sp_DatabaseRestore : Expand functionality to accept multiple backup paths #2180

Open
CubsRep opened this issue Oct 29, 2019 · 2 comments
Open

sp_DatabaseRestore : Expand functionality to accept multiple backup paths #2180

CubsRep opened this issue Oct 29, 2019 · 2 comments
Assignees

Comments

@CubsRep
Copy link

@CubsRep CubsRep commented Oct 29, 2019

Is your feature request related to a problem? Please describe.
Server using multiple drives or Mount Points for backups are being stripped by default, if using Ola Hallengren it matches to the count of drives specified or @NumberOfFiles parameter value. sp_DatabaseRestore supports stripped files if all reside in single location or path notif there are separated drives or mount points
Eg:
EXEC dbo.sp_DatabaseRestore @Database = N'SampleTest' ,@BackupPathFull = N'Y:\BACKUP\FULL\SampleTest,Y:\BACKUP1\FULL\SampleTest' ,@BackupPathDiff = N'Y:\BACKUP\DIFF\SampleTest,Y:\BACKUP1\DIFF\SampleTest' ,@BackupPathLog = N'Y:\BACKUP\LOG\SampleTest,Y:\BACKUP1\LOG\SampleTest' ,@RestoreDiff = 1 ,@ContinueLogs = 0
Describe the solution you'd like
Split Full/Diff/Log Backup paths (only in CSV format). Iterate file loading into stage table thru loop. For RESTORE HEADERONLY and RESTORE FILELISTONLY statements pick one of the stripped back file as metadata will be similar across set. FULL and DIFF will use the most recent backup set available that itself serve as basepoint for LOG restores by comparing LSNs which the current proc does

Describe alternatives you've considered
Manually copying .bak files into single location and executing the proc

Are you ready to build the code for the feature?
i'd love to contribute. modified the proc to add this feature and it's in Testing phase

@CubsRep CubsRep changed the title sp_DatabaseRestore : Expand functionality to accept multiple backup paths if stripped sp_DatabaseRestore : Expand functionality to accept multiple backup paths Oct 29, 2019
@BrentOzar

This comment has been minimized.

Copy link
Member

@BrentOzar BrentOzar commented Oct 29, 2019

OK, cool, sounds good! Go ahead and hit the Contributing Guide (it's in the Documentation folder in the repo.) A couple of things people have been running into lately: make sure it works on a case-sensitive server, and make sure it works going back to SQL Server 2012. Thanks!

(Also forgot to mention - it shouldn't break existing functionality, but that's probably obvious. If someone has an Agent job set up to run sp_DatabaseRestore already with multiple files, it should continue to work as-is.)

CubsRep pushed a commit to CubsRep/SQL-Server-First-Responder-Kit that referenced this issue Nov 8, 2019
CubsRep pushed a commit to CubsRep/SQL-Server-First-Responder-Kit that referenced this issue Jan 9, 2020
@CubsRep

This comment has been minimized.

Copy link
Author

@CubsRep CubsRep commented Jan 10, 2020

Opened new PR #2241 for code review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.