I appreciate Ola Hallengren scripts. Being new to SQL Server, they've made my life so much easier. Thank you Mr. Hallengren.
I have 5 user databases that I need to back up at separate times, so instead of using USER_DATABASES
, I'm providing the database name. When I created the stored procedures with the script, I specified the Output File Directory as something like G:\Logs\Backups
. The log files are there, but it would be great to either have the database name in the logfile name, or pass the logfile path as a parameter.
I'm also logging to dbo.CommandLog
. It would be nice to identify the log file that I'm looking for without looking inside.
Is there a way to do this, without changing maintenance_solution.sql
?
I don't like the idea of modifying because when an update comes out, those would be gone. To me, the scripts are quite complicated, as I'm coming up-to-speed with MS SQL and T-SQL.
Any insights are appreciated.
Sherrie
Best Answer
Assuming you have separate jobs to backup each database, your best bet is to edit that manually.
Unfortunately, the way these tokens are implemented, you can only get the database name when it's raised in an alert.
All of the tokens that start with "A-" can't be called the way general information tokens can.
If they could, I'm sure they'd end up in Ola's code here:
If you try to tack
A-DBN
on to the string, the job will fail.Hope this helps!