调用sys.fn_dump_dblog

时间:2018-09-05 10:18:35

标签: sql-server amazon-web-services cdc dms

AWS DMS正在从SQL Server 2014 Standard Edition复制。将任务简化为一张简单的表。所有表都有主键,并且服务器上已启用复制。

该任务正在开始不恢复,尝试启动时失败,日志中包含以下内容:

[SOURCE_CAPTURE ]D: Going to execute: ', select top 1 [Current LSN], from sys.fn_dump_dblog (NULL, NULL,NULL, 0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), where operation='LOP_BEGIN_XACT', and [Begin Time]>= cast('2018-09-05T09:47:08' as datetime), ' (sqlserver_log_queries.c:4172)

[SOURCE_CAPTURE ]D: Failed to execute statement: '' [1022502] (ar_odbc_stmt.c:2478)'

[SOURCE_CAPTURE ]D: RetCode: SQL_ERROR SqlState: 22007 NativeError: 242 Message: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]The conversion of a nvarchar data type to a datetime data type resulted in an out-of-range value. Line: 1 Column: -1 [1022502] (ar_odbc_stmt.c:2484)

如果我将查询重新创建为:

select top 1 [Current LSN], * from sys.fn_dump_dblog (NULL, NULL,NULL, 0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL) where operation='LOP_BEGIN_XACT' and [Begin Time]>= cast('2018-09-05T09:47:08' as datetime)

,然后在SSMS中运行它,它运行但不返回值。

基于错误; “将nvarchar数据类型转换为日期时间数据类型导致值超出范围”,这使我认为问题与“ [开始时间]> = cast('2018-09-05T09 :47:08'作为日期时间)'

以前有人遇到过吗?

它特定于SQL Server版本吗?

在复制任务的配置中我可以做些什么吗?

我可以对SQL Server的复制分发进行更改吗?

1 个答案:

答案 0 :(得分:1)

找到了解决方案。 我以为与“ cast”有关

更改用户使用us_english的语言

.dat