Microsoft.SqlServer.Management.Smo.Backup未找到增量

时间:2017-12-06 18:16:21

标签: sql-server powershell database-backups

尝试使用Powershell脚本备份SQL SErver 2008 R2数据库。完整备份和日志备份脚本工作正常。现在我在尝试增量时遇到错误。

$backup = New-Object Microsoft.SqlServer.Management.Smo.Backup
echo $backup
$backpup.Incremental = $TRUE

这是输出:

Action                      : Database
BackupSetDescription        : 
BackupSetName               : 
ExpirationDate              : 1/1/0001 12:00:00 AM
FormatMedia                 : False
Initialize                  : False
MediaDescription            : 
RetainDays                  : -1
SkipTapeHeader              : False
LogTruncation               : Truncate
CopyOnly                    : False
Incremental                 : False
Mirrors                     : {Microsoft.SqlServer.Management.Smo.BackupDeviceList, Microsoft.SqlServer.Management.Smo.BackupDeviceList, Microsoft.SqlServer.Management.Smo.BackupDeviceList}
UndoFileName                : 
CompressionOption           : Default
BlockSize                   : -1
BufferCount                 : -1
MaxTransferSize             : -1
AsyncStatus                 : Microsoft.SqlServer.Management.Smo.AsyncStatus
Devices                     : {}
DatabaseFiles               : {}
DatabaseFileGroups          : {}
Database                    : 
Checksum                    : False
ContinueAfterError          : False
MediaName                   : 
NoRewind                    : False
PercentCompleteNotification : 10
Restart                     : False
UnloadTapeAfter             : False
NoRecovery                  : False

The property 'Incremental' cannot be found on this object. Verify that the property exists and can be set.
At line:3 char:2
+  $backpup.Incremental = $TRUE
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

我对此一无所知,谷歌也找不到类似的案例。

感谢任何评论。

0 个答案:

没有答案