简体   繁体   English

如何在SQL Server 2014中解决System.OutOfMemoryException

[英]How to solve System.OutOfMemoryException in SQL Server 2014

My scenario is my live database is on Azure database name vlproduction and I am using SQL Server 2014 on my local machine, database name testvlproduction . 我的情况是我的活动数据库位于Azure数据库名称vlproduction并且我在本地计算机上使用SQL Server 2014,数据库名称为testvlproduction For some reason, my testvlproduction database was deleted. 由于某种原因,我的testvlproduction数据库已删除。

I want to generate testvlproduction to be the same as vlproduction but I found there is no way to take direct backup of live so I generate script with data but script is too big (300mb) whenever I'm trying to run script on my local it shows 我想生成与testvlproduction相同的vlproduction但是我发现无法直接进行实时备份,因此我生成包含数据的脚本,但是每次尝试在本地运行脚本时脚本都太大(300mb)表演

System.OutOfMemoryException System.OutOfMemoryException

Please tell me, what to do to fix this ? 请告诉我,该如何解决? or is there another way to generate database same as live on local 还是有另一种方式可以生成与本地本地相同的数据库

Is there already built any such functionality in SQL Server? SQL Server中是否已经构建了任何此类功能?

May be this question repeated but still I have no solution for my issue. 可能会重复这个问题,但仍然无法解决我的问题。

Fill free to ask any query. 请填写以询问任何查询。

Thanks 谢谢

This is a limitation of sql server,This happen because Management Studio is running out of memory, not the SQL Server service. 这是sql server的局限性,这是因为Management Studio内存不足,而不是SQL Server服务不足。 This is likely caused by the size of the result set that you are returning to Management Studio. 这很可能是由您返回到Management Studio的结果集的大小引起的。

See https://support.microsoft.com/en-in/kb/2874903 for more details. 有关更多详细信息,请参见https://support.microsoft.com/en-in/kb/2874903 For more sql-server-management-studio-cant-handle-large-files 有关更多的sql-server-management-studio-cant-handle-large-files

Since your SSMS runs out of memory you should try it with the a new release . 由于SSMS内存不足,因此应尝试使用新版本 It should be compatible with SQL Server 2014. 它应该与SQL Server 2014兼容。

If you have some idle time on your production database take a db backup and restore it locally - use Export Data Tier Application and select the proper version where you want to restore. 如果生产数据库上有一些空闲时间,请进行数据库备份并在本地还原它-使用“ 导出数据层应用程序”并选择要还原的正确版本。 If this is not an option for you I'd suggest to take @mohan111 's suggestion of committing your script in batches. 如果这不是您的选择,我建议采纳@ mohan111的建议,即分批提交脚本。

I believe you have two problems: 我相信您有两个问题:

  1. System out of memory exception - This usually happens while running big scripts in SSMS. 系统内存不足异常-通常在SSMS中运行大型脚本时发生。 One work around is to run it using command prompt using sqlcmd command (see the link - https://msdn.microsoft.com/en-us/library/ms180944.aspx ) 一个解决办法是使用命令提示符下使用SQLCMD命令它(见链接-运行https://msdn.microsoft.com/en-us/library/ms180944.aspx

  2. Creating Test Database with the same schema as that of production - You can make use of SSDT tool in Visual Studio. 使用与生产相同的架构创建测试数据库-您可以在Visual Studio中使用SSDT工具。 This will help you to create a database project which mimics the production database and you can use the publish functionality to create database where ever required which will have the same schema 这将帮助您创建一个模拟生产数据库的数据库项目,并且可以在需要的地方使用发布功能来创建具有相同架构的数据库

暂无
暂无

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

相关问题 增加最大服务器内存以处理SQL Server上的System.OutOfMemoryException - Increasing max server memory to deal with System.OutOfMemoryException on SQL Server SQL Server System.OutOfMemoryException +太多结果 - SQL Server System.OutOfMemoryException + too many outcomes 打开Sql Server文件时出现System.OutOfMemoryException错误 - System.OutOfMemoryException error when I open the Sql Server file 尝试运行由SQL Server Management Studio生成的创建表脚本时出现System.OutOfMemoryException - System.OutOfMemoryException when trying to run a create table script generated by SQL Server Management studio 将SQL Server 2016升级到版本13.0.15700.28后,经常发生System.OutOfMemoryException - System.OutOfMemoryException occurs frequently after Upgrading SQL Server 2016 to version 13.0.15700.28 “System.OutOfMemoryException: 'Out of memory.'”从 SQL 服务器读取图像时 - "System.OutOfMemoryException: 'Out of memory.'" when reading image from SQL Server 查询大型SQL表时出现System.OutOfMemoryException - System.OutOfMemoryException when querying large SQL table System.OutOfMemoryException:angularjs中抛出了类型'System.OutOfMemoryException'的异常 - System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown in angularjs 训练 ML.NET -- System.OutOfMemoryException - Training ML.NET -- System.OutOfMemoryException 使用localdb进行NUnit测试期间的System.OutOfMemoryException - System.OutOfMemoryException during NUnit tests with localdb
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM