October 16, 2015 at 12:31 pm
Hi,
I am wondering how can we use Ola Hallengren script to backup databases to sub folders. i.e. each database backup has to go each folder like we do using maintenance plan
EXECUTE dbo.DatabaseBackup
@databases = 'USER_DATABASES',
@Directory = 'C:\Backup',
@BackupType = 'FULL',
@Compress = 'Y',
@CleanupTime = 24
October 16, 2015 at 12:55 pm
We um-and-ah about having a subfolder for each database.
Whenever we need to port all the backups for all databases, and all log backups since the last FULL, to a different server having them all in one folder seems to make the job easier. But maybe there is a smart way to do that with sub-folders too.
Apart from the massive number of files in the (single) folder I've never had a problem with all-in-one. I never go into the folder, manually, as a Restore is based on some APP working out which files are needed in order to make a restore - given some start-point and determining the appropriate FULL and any DIFFs & LOGs thereafter.
All our backup file filenames start with the name of the database, so easy to do DIR MyDATABASE*.*
Would be interested to hear of any advantage of sub folders though.
October 16, 2015 at 2:38 pm
Ola's scripts create sub-folders by default.
From the documentation: https://ola.hallengren.com/sql-server-backup.html
DatabaseBackup creates a directory structure with server name, instance name, database name, and backup type under the backup root directory.
October 22, 2015 at 2:14 pm
Yes. I can see that. It created a folder with instance name and sub folders with each db name.
I gave path C:\backup and when I ran the job it created C:\backup\MYTest$Test\DB1 instead of that I want C:\backup\DB1. How can we do?
October 23, 2015 at 2:04 am
You will need to hack the script to remove the servername from the backup path.
November 9, 2015 at 4:37 pm
Even the db backup is including the servername
November 10, 2015 at 1:20 am
Yes, again if you don't want that to happen, hack the script to remove it.
Alternatively as your hacking the script, write your own script to backup the databases how you want them backing up.
Personally I like having a folder with the servername and the file prefixed with the servername. Adds that level of security to my piece of mind when restoring databases, I know which server they have come from.
November 16, 2015 at 11:03 am
Thanks
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply