SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Copy a big table (250G) form one server to another


Copy a big table (250G) form one server to another

Author
Message
Minaz Amin
Minaz Amin
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2628 Visits: 1750
Jeff Moden (3/4/2013)
In that case, you might try what SQL Server itself uses for replication if you have the disk space. BCP in native format. Export the table to a file, then import it in half million (or less depending on the size of your rows) row chunks using the batch size setting. It will keep your log file from exploding.

As an alternative, you could have the infrastructure folks do what I believe is called a "SAN Snapshot" to copy the mdf and ldf files and then simply attach the database.


As jeff sugested , taking a SAN snapshot and then attaching the mdf / ldf file could save time and will be a good approach.

"More Green More Oxygen !! Plant a tree today"
Dung Dinh
Dung Dinh
SSChasing Mays
SSChasing Mays (639 reputation)SSChasing Mays (639 reputation)SSChasing Mays (639 reputation)SSChasing Mays (639 reputation)SSChasing Mays (639 reputation)SSChasing Mays (639 reputation)SSChasing Mays (639 reputation)SSChasing Mays (639 reputation)

Group: General Forum Members
Points: 639 Visits: 1233
I have some recommends here:
1-Choose the point time when your server does not work hard
2-Separate your table into smaller pieces (may be multiple files) and using a package to transform data
Sqlsavy
Sqlsavy
SSC Eights!
SSC Eights! (861 reputation)SSC Eights! (861 reputation)SSC Eights! (861 reputation)SSC Eights! (861 reputation)SSC Eights! (861 reputation)SSC Eights! (861 reputation)SSC Eights! (861 reputation)SSC Eights! (861 reputation)

Group: General Forum Members
Points: 861 Visits: 868
Did you try Import/export option of SQL when server is not too busy?
csalazar-607991
csalazar-607991
SSC-Enthusiastic
SSC-Enthusiastic (178 reputation)SSC-Enthusiastic (178 reputation)SSC-Enthusiastic (178 reputation)SSC-Enthusiastic (178 reputation)SSC-Enthusiastic (178 reputation)SSC-Enthusiastic (178 reputation)SSC-Enthusiastic (178 reputation)SSC-Enthusiastic (178 reputation)

Group: General Forum Members
Points: 178 Visits: 34
Hi,

We decided to insert the info using

BEGIN TRANSACTION

INSERT INTO DB2.dbo.Table
SELECT *
FROM DB1.dbo.Table
WHERE CodigoCaso < @cont and CodigoCaso > @ultimo

SET @ultimo = @cont
SET @cont = @cont + 1000

COMMIT TRANSACTION

In order to avoid a huge increase in the log file.

I will post the result

Thanks
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search