문제

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'

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 dba.stackexchange
scroll top