olahallengren / sql-server-maintenance-solution

SQL Server Maintenance Solution
https://ola.hallengren.com
MIT License
2.91k stars 756 forks source link

Issue 726 : BackupType - Option to use lower case in URL #745

Closed mdaniou closed 15 hours ago

mdaniou commented 1 year ago

Adding a bit of code to lowercase urls all the time. I hope this will answer this issue

sethmgray commented 2 months ago

I have similar requirement asking for ability to lower() the backup path. In our case we have Always On AGs that have databases that were not properly cased equivalently between restore operations by dbas and having ability to send at least the database name to lower or upper would help to guarantee the file has some consistent convention making its way to case sensitive systems (storage gateways and s3 in AWS in our case).

olahallengren commented 3 weeks ago

Would you like to have a parameter here to make the directory path lower case or upper case?

sethmgray commented 3 weeks ago

Would you like to have a parameter here to make the directory path lower case or upper case?

In our case it's best that the path and database name has separate params to put each to upper/lower, but the full path (including db name) would at least allow for predictable and repeatable casing

olahallengren commented 3 weeks ago

Another option could be to introduce new lower/upper case tokens in these parameters: https://ola.hallengren.com/sql-server-backup.html#DirectoryStructure https://ola.hallengren.com/sql-server-backup.html#FileName

sethmgray commented 3 weeks ago

I assume the addition of two casing versions of each token would be the most flexible and least/no impact to the procs arguments.

On Sun, Oct 27, 2024, 12:16 PM Ola Hallengren @.***> wrote:

Another option could be to introduce new lower/upper case tokens in these parameters: https://ola.hallengren.com/sql-server-backup.html#DirectoryStructure https://ola.hallengren.com/sql-server-backup.html#FileName

— Reply to this email directly, view it on GitHub https://github.com/olahallengren/sql-server-maintenance-solution/pull/745#issuecomment-2440142765, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHPICOYHTCGIHVZCLGVWVNTZ5UUZBAVCNFSM6AAAAABNMVNWQGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBQGE2DENZWGU . You are receiving this because you commented.Message ID: @.*** .com>

olahallengren commented 2 weeks ago

I assume the addition of two casing versions of each token would be the most flexible and least/no impact to the procs arguments.

It would be the most flexible, but also quite cumbersome to pass the parameters correctly, especially if you have both standalone databases and databases in availability groups.

The other option would be to introduce two new parameters, @DirectoryStructureCase and @FileNameCase, where NULL is the default (as today), but you could set them to LOWER and UPPER.

olahallengren commented 6 days ago

I have been doing some work on this. Please have a look at https://github.com/olahallengren/sql-server-maintenance-solution/pull/840.

olahallengren commented 15 hours ago

I have released this now. Here is the documentation: https://ola.hallengren.com/sql-server-backup.html#DirectoryStructureCase https://ola.hallengren.com/sql-server-backup.html#FileNameCase