473,395 Members | 1,558 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Any advice about large size database transfer by c#?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

What i am tring to do is to transfer a database tabe SRC to another
database DEST. Actually it's not only simple transfer, but the row in
DEST is calculated by row in SRC.
For example:

We have a database table SRC, there are columns A, B, C. There are 5
million records in SRC, and totaly is about 500MB.
We have a database table - DEST, which has column AA, BB, CC, DD and
EE. AA, BB and CC is calculate by SRC.A and SRC.B by one go. DD and EE
is calculate by SRC.B and C by one go. you can run algorithm 3 time to
get AA, BB and CC seperatedly, but it will be 3 times slow, and should
not be happen. And the algorithm is complicated which means, should
not be implemented in store procedure.

We want to migrate the data from SRC to DEST. what is the best
solution to get smallest memory and disk cost?

I have tried simple way dataadapterSrc.Fill(datatableSrc) and then
foreach row in datatableSrc to calculate the result and add to
datatableDest table. But after fill, it almost cost my about 800MB
memory, and during my datatableDest.Rows.Add(row) operation. it run
out of memory. and stopped.

and I tried to use DataReader, it's better, but the situation of
datatableDest is same.

I tried to use pure SqlCommand to do the "Inser into " option. But
when I use Access database, the database size increasing dramatically.
and soon reach the 2GB size limits. But after my shrink the database,
it's actually only about 100MB. Maybe too many log in mdb, and too
many garbage space caused by single insert command, but I don't how to
prevent this happen.

I think the perfect solution is just like a pipeline, without keeping
any old records in memory and will not increase the database size
unreasonable, read 1 or 100 and save them, release the resouce and
read more.

Is there any better solution to solve the problem?

Thanks.

Dancefire
???
CCNA
http://www.dancefires.com/
http://blog.csdn.net/dancefire/
MSN: da*******@263.net
I am interested in Operating System, Embedded System and Network Security.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFDbpF6RS5AkKgtcCcRAgacAKCNBKSsWwcSdjwDIkITnL BRrjSIlACeJhcr
ofrFVQtgtieYyx8GQ7NWlzQ=
=FEJh
-----END PGP SIGNATURE-----
Nov 17 '05 #1
3 1934
it might be better 4 ya to consider transferring data in a way that specific
to the database implementation instead of resorting to c# (IMO)

1. replicate the data (simply clone) across to the target implementation

2. write a stored procedure in the target to preform the data calculation
alone with the transferring

hope this helps
Nov 17 '05 #2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ashura wrote:
it might be better 4 ya to consider transferring data in a way that
specific to the database implementation instead of resorting to c#
(IMO)

1. replicate the data (simply clone) across to the target
implementation

2. write a stored procedure in the target to preform the data
calculation alone with the transferring

hope this helps


Thanks, the two reason I don't want to use store procedure. first, the
algorithm of data processing is complicated, it's not suitable to use
store procedure to implemented; second, I can't fix the target
database platform, and store procedure is not portable, so I'd better
don't use store procedure.

Dancefire
- --
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFDbuHyRS5AkKgtcCcRAofUAKCVa3K7CzPjq/fcGS9e0akwPb8WbgCePOSR
f1vjM/cUx1/gmLyC3GJefh8=
=Bi0i
-----END PGP SIGNATURE-----
Nov 17 '05 #3
Well, as i reckon its pretty much like a database problem anyway.
Wud ya plz specify the database 4 the job to be done. prolly, we cud sort
this out technically.

cheers
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: CSN | last post by:
Is it possible to iterate over an array in plpgsql? Something like: function insert_stuff (rel_ids int) .... foreach rel_ids as id insert into table (rel_id, val) values (id, 5);
6
by: soren juhu | last post by:
Hi, I am developing a C Program for reading over a million files of size 1 kilobytes each and sending the contents to another program using some middle ware. I need some help on designing the...
1
by: Mark | last post by:
Hi, I've seen some postings on this but not exactly relating to this posting. I'm reading in a large mail message as a string. In the string is an xml attachment that I need to parse out and...
3
by: bardo | last post by:
Hello all, I want to make an application withs centers around 1 windowform. This form I want to give the same appearance as the Outlook. I have a listbox on the left-handside then a splitter....
9
by: Laban | last post by:
Hi, I find myself using static methods more than I probably should, so I am looking for some advice on a better approach. For example, I am writing an app that involves quite a bit of database...
6
by: Paul | last post by:
Hi there, When adding a "File Field" HTML control to an aspx page to facilitate file uploading, the following occurs: 1. You select a file that is larger than the allowed size limit. 2. Once...
20
by: Jim | last post by:
Hi, I am hoping that someone here can help me out. I am for the first time trying to implement a page design using only CSS instead of HTML tables. I've been able to get most of the page done...
7
by: =?Utf-8?B?TW9iaWxlTWFu?= | last post by:
Hello everyone: I am looking for everyone's thoughts on moving large amounts (actually, not very large, but large enough that I'm throwing exceptions using the default configurations). We're...
3
by: neovantage | last post by:
Hey all, I need to upload files which are large in size. Though there are 2 fuunction which set the max upload file size and increasing the execution time of the script at run time but is there any...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.