我正在使用 将日志传送应用到数据库Invoke-DbaDbLogShipping,并且我正在遵循文档中的示例。创建了作业,并且从显示的内容在辅助服务器实例上恢复了数据库,但作业失败了。这是备份作业日志的状态:
备份事务日志。主数据库:“Test14”日志备份文件:“C:\Users...\Documents\DB Log Shipping\Backups\Local\Test14\Test14_20210822193000.trn”错误:无法记录历史记录/错误消息。(Microsoft.SqlServer. Management.LogShipping)错误:无法将参数值从 SqlGuid 转换为字符串。(System.Data)错误:对象必须实现 IConvertible。(mscorlib)第一次尝试将数据库“Test14”备份到文件“C:\Users.. .\Documents\DB Log Shipping\Backups\Local\Test14\Test14_20210822193000.trn' 失败,因为无法打开备份设备'C:\Users...\Documents\DB Log Shipping\Backups\Local\Test14\Test14_20210822193000.trn
为什么会失败?
这是我的脚本:
$params = @{
SourceSqlInstance = $PrimaryServerInstance
DestinationSqlInstance = $SecondaryServerInstance
Database = $DatabaseName
GenerateFullBackup = $true
BackupNetworkPath = $SharedPath
BackupLocalPath = $LocalPath
CompressBackup = $true
Standby = $true
BackupScheduleFrequencyType = 'daily'
BackupScheduleFrequencyInterval = 1
CopyScheduleFrequencyType = 'daily'
CopyScheduleFrequencyInterval = 1
RestoreScheduleFrequencyType = 'daily'
RestoreScheduleFrequencyInterval = 1
CopyDestinationFolder = $TransactionLogsCopyPath
Force = $true #Ignore some errors in the parameters and assume defaults. It will also remove the any present schedules with the same name for the specific job.
}
Invoke-DbaDbLogShipping @params