简体   繁体   English

SQL SSMS复制数据库向导失败

[英]SQL SSMS Copy Database Wizard Fails

I am trying to copy a database from one server to another using the Copy Database Wizard included in SSMS. 我正在尝试使用SSMS中包含的“复制数据库向导”将数据库从一台服务器复制到另一台服务器。 It always fails with : 它总是失败:

ERROR : errorCode=-1073548784 description=Executing the query " CREATE CLUSTERED INDEX [IX_CO_Summary_PostDate] ..." failed with the following error: "CREATE INDEX failed because the following SET options have incorrect settings: 'ANSI_PADDING'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations.". 错误:errorCode = -1073548784 description =执行查询“ CREATE CLUSTERED INDEX [IX_CO_Summary_PostDate] ...”失败,并出现以下错误:“ CREATE INDEX失败,因为以下SET选项的设置不正确:'ANSI_PADDING'。验证SET选项是否正确。正确使用计算列上的索引视图和/或索引和/或过滤后的索引和/或查询通知和/或XML数据类型方法和/或空间索引操作。” Possible failure reasons: Problems with the query "ResultSet" property not set correctly parameters not set correctly or connection not established correctly.` 可能的失败原因:查询“ ResultSet”属性的问题设置不正确参数未正确设置或连接未正确建立。

Can anybody dissect this and help me figure out where I went wrong? 有人可以剖析这件事并帮助我弄清楚我哪里出了问题吗? Both SQL servers are SQL Server 2008 R2, I connect with SQL Server authentication, and use the SQL Server Management Object method since I require the original database to stay live in production. 这两个SQL Server均为SQL Server 2008 R2,我通过SQL Server身份验证进行连接,并使用SQL Server管理对象方法,因为我需要原始数据库保持在生产环境中。

The complete error log is here: 完整的错误日志在这里:

Date,Source,Severity,Step ID,Server,Job Name,Step Name,Notifications,Message,Duration,Sql Severity,Sql Message ID,Operator Emailed,Operator Net sent,Operator Paged,Retries Attempted 11/12/2013 08:46:36,CDW_FEZ_FUNDEZ_E-MDS_0,Error,0,E-MDS,CDW_FEZ_FUNDEZ_E-MDS_0,(Job outcome),,The job failed. 日期,源,严重性,步骤ID,服务器,作业名称,步骤名称,通知,消息,持续时间,SQL严重性,SQL消息ID,向操作员发送电子邮件,向操作员发送网络,向操作员发送分页,尝试重试11/12/2013 08:46 :36,CDW_FEZ_FUNDEZ_E-MDS_0,错误,0,E-MDS,CDW_FEZ_FUNDEZ_E-MDS_0,(作业结果),,作业失败。 The Job was invoked by User sa. 作业由用户sa调用。 The last step to run was step 1 (CDW_FEZ_FUNDEZ_E-MDS_0_Step).,00:02:08,0,0,,,,0 11/12/2013 08:46:36,CDW_FEZ_FUNDEZ_E-MDS_0,Error,1,E-MDS,CDW_FEZ_FUNDEZ_E-MDS_0,CDW_FEZ_FUNDEZ_E-MDS_0_Step,,Executed as user: E-MDS\\SYSTEM. 运行的最后一步是步骤1(CDW_FEZ_FUNDEZ_E-MDS_0_Step)。,00:02:08,0,0 ,,, 0 11/12/2013 08:46:36,CDW_FEZ_FUNDEZ_E-MDS_0,Error,1,E- MDS,CDW_FEZ_FUNDEZ_E-MDS_0,CDW_FEZ_FUNDEZ_E-MDS_0_Step,以用户身份执行:E-MDS \\ SYSTEM。 Microsoft (R) SQL Server Execute Package Utility Version 10.0.5500.0 for 64-bit Copyright (C) Microsoft Corp 1984-2005. 适用于64位的Microsoft(R)SQL Server执行软件包实用程序版本10.0.5500.0(C)Microsoft Corp 1984-2005。 All rights reserved. 版权所有。 Started: 8:46:36 AM Progress: 2013-11-12 08:46:37.18 Source: FEZ_FUNDEZ_E-MDS_Transfer Objects Task Task just started the execution.: 0% complete End Progress Error: 2013-11-12 08:48:42.79 Code: 0x00000000 Source: FEZ_FUNDEZ_E-MDS_Transfer Objects Task Description: ERROR : errorCode=-1073548784 description=Executing the query " CREATE CLUSTERED INDEX [IX_CO_Summary_PostDate] ..." failed with the following error: "CREATE INDEX failed because the following SET options have incorrect settings: 'ANSI_PADDING'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations.". 已开始:8:46:36 AM进度:2013-11-12 08:46:37.18来源:FEZ_FUNDEZ_E-MDS_Transfer Objects Task Task开始执行。:0%完成结束进度错误:2013-11-12 08:48: 42.79代码:0x00000000源:FEZ_FUNDEZ_E-MDS_Transfer对象任务说明:错误:errorCode = -1073548784 description =执行查询“ CREATE CLUSTERED INDEX [IX_CO_Summary_PostDate] ...”失败,并出现以下错误:“ CREATE INDEX失败,因为以下设置选项设置错误:'ANSI_PADDING'。验证SET选项是否正确用于索引视图和/或计算列上的索引和/或过滤后的索引和/或查询通知和/或XML数据类型方法和/或空间索引操作。 ”。 Possible failure reasons: Problems with the query "ResultSet" property not set correctly parameters not set correctly or connection not established correctly. 可能的失败原因:查询“ ResultSet”属性设置不正确的问题参数设置不正确或连接建立不正确。 helpFile= helpContext=0 idofInterfaceWithError={C81DFC5A-3B22-4DA3-BD3B-10BF861A7F9C} StackTrace: at Microsoft.SqlServer.Management.Dts.DtsTransferProvider.ExecuteTransfer() at Microsoft.SqlServer.Management.Smo.Transfer.TransferData() at Microsoft.SqlServer.Dts.Tasks.TransferObjectsTask.TransferObjectsTask.TransferDatabasesUsingSMOTransfer() End Error Progress: 2013-11-12 08:48:42.82 Source: FEZ_FUNDEZ_E-MDS_Transfer Objects Task Database transfer failed for 1 database(s).: 0% complete End Progress Progress: 2013-11-12 08:48:42.82 Source: FEZ_FUNDEZ_E-MDS_Transfer Objects Task Transfer objects finished execution.: 100% complete End Progress Warning: 2013-11-12 08:48:42.82 Code: 0x80019002 Source: CDW_FEZ_FUNDEZ_E-MDS_0 Description: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. helpFile = helpContext = 0 idofInterfaceWithError = {C81DFC5A-3B22-4DA3-BD3B-10BF861A7F9C} StackTrace:位于Microsoft.SqlServer.Management.Dts.DtsTransferProvider.ExecuteTransfer()位于Microsoft.SqlServer.Management.Smo.Transfer.TransferData() .SqlServer.Dts.Tasks.TransferObjectsTask.TransferObjectsTask.TransferDatabasesUsingSMOTransfer()结束错误进度:2013-11-12 08:48:42.82源:FEZ_FUNDEZ_E-MDS_Transfer对象任务1个数据库的数据库传输失败。:0%完成进度进度:2013-11-12 08:48:42.82来源:FEZ_FUNDEZ_E-MDS_Transfer Objects任务传输对象完成执行。:100%完成结束进度警告:2013-11-12 08:48:42.82代码:0x80019002来源:CDW_FEZ_FUNDEZ_E- MDS_0说明:SSIS警告代码DTS_W_MAXIMUMERRORCOUNTREACHED。 The Execution method succeeded but the number of errors raised (1) reached the maximum allowed (1); 执行方法成功,但是引发的错误数(1)达到了允许的最大值(1); resulting in failure. 导致失败。 This occurs when the number of errors reaches the number specified in MaximumErrorCount. 错误数量达到MaximumErrorCount中指定的数量时,会发生这种情况。 Change the MaximumErrorCount or fix the errors. 更改MaximumErrorCount或修复错误。 End Warning DTExec: The package execution returned DTSER_FAILURE (1). 结束警告DTExec:程序包执行返回DTSER_FAILURE(1)。 Started: 8:46:36 AM Finished: 8:48:42 AM Elapsed: 126.142 seconds. 开始:8:46:36 AM完成:8:48:42 AM经过:126.142秒。 The package execution failed. 程序包执行失败。 The step failed.,00:02:08,0,0,,,,0 该步骤失败。,00:02:08,0,0 ,,,, 0

Goal is to schedule a copy of this "production" system to an analysis server for reporting periodically (once per week) so that the reporting function does not interact with the live system. 目标是计划将此“生产”系统的副本安排到分析服务器以定期(每周一次)进行报告,以使报告功能不会与实时系统交互。

The Copy Database wizard kept failing for me. 复制数据库向导对我来说一直失败。 I was also unable to export the schema and data scripts as the database was too large. 由于数据库太大,我也无法导出模式和数据脚本。 Additionally I was also unable to do a backup to my local machine since the server was on a hosted environment and did not have access. 另外,由于服务器位于托管环境中并且没有访问权限,因此我也无法备份到本地计算机。 This doesn't set any auto Identity columns though. 但是,这不会设置任何自动标识列。 My solution was: 我的解决方案是:

  1. Create the a new blank local database. 创建一个新的空白本地数据库。
  2. Use the Import wizard, right click on database. 使用导入向导,右键单击数据库。 Tasks->Import Data 任务->导入数据
  3. Use the Sql Server Native Client and set the Source and Destination. 使用Sql Server本机客户端并设置“源”和“目标”。 This will import the tables / data but will not import the indexes / constraints. 这将导入表/数据,但不会导入索引/约束。
  4. Use the scripts below to get the indexes / constraints and foreign key from your source and run them on your local database. 使用下面的脚本从源中获取索引/约束和外键,然后在本地数据库上运行它们。 https://www.mssqltips.com/sqlservertip/3443/script-all-primary-keys-unique-constraints-and-foreign-keys-in-a-sql-server-database-using-tsql/ https://www.mssqltips.com/sqlservertip/3443/script-all-primary-keys-unique-constraints-and-foreign-keys-in-a-sql-server-database-using-tsql/
CREATE CLUSTERED INDEX [IX_CO_Summary_PostDate] ...

failed with the following error: 失败,出现以下错误:

CREATE INDEX failed because the following SET options have incorrect settings: 'ANSI_PADDING'. CREATE INDEX失败,因为以下SET选项的设置不正确:“ ANSI_PADDING”。

You have an indexed view in you database. 您的数据库中有一个索引视图。 The wizard tries to recreate the index but your session doesn't have the proper settings. 该向导尝试重新创建索引,但是您的会话没有正确的设置。 Try to remove this object from the objects copied by the wizard and recreate the view and its index manually afterwards. 尝试从向导复制的对象中删除该对象,然后手动重新创建视图及其索引。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM