Using Ola Hallengren's backup solution - Can't exclude databases [closed]
-
28-02-2021 - |
Вопрос
I am using the newest version of Ola's scripts. When backing-up databases, I'm experiencing an issue with excluding certain databases. The website states, if you want to backup all User database except X use the following for @Databases:
USER_DATABASES, -Db1
So, I'm running the following:
EXECUTE Maintdb.[dbo].[DatabaseBackup]
@Databases = 'USER_DATABASES,-AdventureWorks2014 -Sandbox',
@Directory = 'G:\Bckps',
@BackupType = 'FULL',
@Verify = 'Y',
@CleanupTime = '36',
@CleanupMode = 'AFTER_BACKUP',
@CheckSum = 'Y',
@LogToTable = 'Y'
The issue is, all User databases get backed-up. Output is:
The following databases in the @Databases parameter do not exist: [AdventureWorks2014 -Sandbox].
Решение
As @LowlyDBA noted, your @Databases
parameter is incorrect. It's a CSV list of database names (or database name patterns) and you've omitted a necessary comma.
It should be:
@Databases = 'USER_DATABASES,-AdventureWorks2014, -Sandbox'
Не связан с dba.stackexchange