简体   繁体   English

在Sql Server 2005中将数据从一个表移动到另一个表

[英]Moving data from one table to another in Sql Server 2005

I am moving around 10 million data from one table to another in SQL Server 2005. The Purpose of Data transfer is to Offline the old data. 我在SQL Server 2005中将一千万个数据从一个表移动到另一个表。数据传输的目的是使旧数据脱机。

After some time it throws an error Description: "The LOG FILE FOR DATABASE 'tempdb' IS FULL." 一段时间后它会抛出一个error Description: "The LOG FILE FOR DATABASE 'tempdb' IS FULL." .

My tempdb and templog is placed in a drive (other than C drive) which has around 200 GB free. 我的tempdbtemplog放在一个驱动器(C驱动器除外)中,它有大约200 GB的可用空间。 Also my tempdb size in database is set to 25 GB . 我的tempdb大小也设置为25 GB

As per my understanding I will have to increase the size of tempdb from 25 GB to 50 GB and set the log file Auto growth portion to " unrestricted file growth (MB) ". 根据我的理解,我将不得不将tempdb的大小从25 GB增加到50 GB ,并将日志文件自动增长部分设置为“ unrestricted file growth (MB) ”。

Please let me know other factors and I cannot experiment much as I am working on Production database so can you please let me know if they changes will have some other impact. 请让我知道其他因素,因为我正在使用生产数据库,所以我无法进行多少实验。所以,如果他们的更改会产生一些其他影响,请告诉我。

Thanks in Advance. 提前致谢。

My guess is that you're trying to move all of the data in a single batch; 我的猜测是你试图在一个批次中移动所有数据; can you break it up into smaller batches, and commit fewer rows as you insert? 你可以将它分解成更小的批次,并在插入时减少行数吗? Also, as noted in the comments, you may be able to set your destination database to SIMPLE or BULK-INSERT mode. 此外,如注释中所述,您可以将目标数据库设置为SIMPLE或BULK-INSERT模式。

You know the solution. 你知道解决方案。 Seems you are just moving part of data to make your queries faster. 似乎您只是移动部分数据以加快查询速度。

I am agree with your solution 我同意你的解决方案

As per my understanding I will have to increase the size of tempdb from 25 GB to 50 GB and set the log file Auto growth portion to "unrestricted file growth (MB)". 根据我的理解,我将不得不将tempdb的大小从25 GB增加到50 GB,并将日志文件自动增长部分设置为“不受限制的文件增长(MB)”。

Go ahead 前进

Why are you using Log file at all? 你为什么要使用日志文件? Copy your data (Data and Logfile) then set the mode on SIMPLE and run the transfer again. 复制数据(数据和日志文件),然后在SIMPLE上设置模式并再次运行传输。

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

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