dbTalk Databases Forums  

Help! Importing a large txt file hanging...

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Help! Importing a large txt file hanging... in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
A.K.
 
Posts: n/a

Default Help! Importing a large txt file hanging... - 07-21-2004 , 12:53 PM






Hi:

Any help with this would be appreciated. Thanks in
advance.

Environment:
SQL 2000 SP3 all up to date on Win2K Server SP4 all up to
date.

Issue:
Trying to import a very large text file (12GB) into a db
table where the data was originally from. The data was
exported based on a selective query (with a WHERE clause),
then the table was truncated, and I am in the process of
reimporting the data. The idea was to delete a bunch of
rows as fast as possible.

The export of the text file took about an hour, the import
is taking six hours and still running.

When I looked at the performance counters, it seemed to be
writing and reading to the drive that holds the tempdb. I
assumed that its writing the data to the tempdb db for the
single shot insert - mind you I did not optimize the
package by tweaking the switch in the package properties
pages.

I am now running out of time, I have to have the data in
by ...hmmm.. half an hour ago. Would it be worth the
while to wait for it or restart the whole thing with
optimized package options for this type of import (which I
have no idea at this point how to do, BOL maybe)?

Thank you for your help.
If you could CC me zebdi (AT) hotmail (DOT) com

A.K.

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Help! Importing a large txt file hanging... - 07-21-2004 , 01:14 PM






I presume you are in the .dts NG because you are using DTS?
Which Task?
Why not use TSQL's BULK INSERT command

Does the destination table have
1. Indexes
2. Triggers

Is the destination DB in at most BULK LOGGED mode?

re you doing this in batches

BULK INSERT (BatchSize =)

What about bcp?



--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know


"A.K." <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi:

Any help with this would be appreciated. Thanks in
advance.

Environment:
SQL 2000 SP3 all up to date on Win2K Server SP4 all up to
date.

Issue:
Trying to import a very large text file (12GB) into a db
table where the data was originally from. The data was
exported based on a selective query (with a WHERE clause),
then the table was truncated, and I am in the process of
reimporting the data. The idea was to delete a bunch of
rows as fast as possible.

The export of the text file took about an hour, the import
is taking six hours and still running.

When I looked at the performance counters, it seemed to be
writing and reading to the drive that holds the tempdb. I
assumed that its writing the data to the tempdb db for the
single shot insert - mind you I did not optimize the
package by tweaking the switch in the package properties
pages.

I am now running out of time, I have to have the data in
by ...hmmm.. half an hour ago. Would it be worth the
while to wait for it or restart the whole thing with
optimized package options for this type of import (which I
have no idea at this point how to do, BOL maybe)?

Thank you for your help.
If you could CC me zebdi (AT) hotmail (DOT) com

A.K.



Reply With Quote
  #3  
Old   
A.K.
 
Posts: n/a

Default Re: Help! Importing a large txt file hanging... - 07-21-2004 , 01:42 PM



Thank you for the response:
Quote:
Which Task?
Transform data task.


Quote:
Why not use TSQL's BULK INSERT command
No idea wether this would be faster than DTS...

Quote:
Does the destination table have
1. Indexes Yes, clustered only.
2. Triggers None.

Is the destination DB in at most BULK LOGGED mode?
the db is in Simple mode, I'm guessing it's not bulk
logged.


Quote:
re you doing this in batches
BULK INSERT (BatchSize =)
Nope, straight usage of the DTS package (db connection,
txt file connection and Transform Data Task in between)

Quote:
What about bcp?
I thought this is the same engine used by DTS?!

Quote:


Quote:
Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know
Thanks again Allan.

Quote:
"A.K." <anonymous (AT) discussions (DOT) microsoft.com> wrote in
message
news:176a01c46f4b$97257020$a601280a (AT) phx (DOT) gbl...
Hi:

Any help with this would be appreciated. Thanks in
advance.

Environment:
SQL 2000 SP3 all up to date on Win2K Server SP4 all up
to
date.

Issue:
Trying to import a very large text file (12GB) into a db
table where the data was originally from. The data was
exported based on a selective query (with a WHERE
clause),
then the table was truncated, and I am in the process of
reimporting the data. The idea was to delete a bunch of
rows as fast as possible.

The export of the text file took about an hour, the
import
is taking six hours and still running.

When I looked at the performance counters, it seemed to
be
writing and reading to the drive that holds the
tempdb. I
assumed that its writing the data to the tempdb db for
the
single shot insert - mind you I did not optimize the
package by tweaking the switch in the package properties
pages.

I am now running out of time, I have to have the data in
by ...hmmm.. half an hour ago. Would it be worth the
while to wait for it or restart the whole thing with
optimized package options for this type of import
(which I
have no idea at this point how to do, BOL maybe)?

Thank you for your help.
If you could CC me zebdi (AT) hotmail (DOT) com

A.K.


.


Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Help! Importing a large txt file hanging... - 07-21-2004 , 01:54 PM



TSQL's BULK INSERT and the BULK INSERT TASK are the same.

mk:@MSITStore:C:\Program%20Files\Microsoft%20SQL%2 0Server\80\Tools\Books\dts
sql.chm::/dts_elemtsk2_5m0b.htm

The transform data task with table lock on uses IRowsetFastLoad(BULK COPY
rowsets) which is the same as bcp.

mk:@MSITStore:C:\Program%20Files\Microsoft%20SQL%2 0Server\80\Tools\Books\adm
insql.chm::/ad_impt_bcp_8wc2.htm

I personally would use BULK INSERT and I would use batches.

Otherwise the data is going to be inserted in one big lump and that lump
must be stored somewhere first.



--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know


"A.K." <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Thank you for the response:
Which Task?
Transform data task.


Why not use TSQL's BULK INSERT command
No idea wether this would be faster than DTS...

Does the destination table have
1. Indexes Yes, clustered only.
2. Triggers None.

Is the destination DB in at most BULK LOGGED mode?
the db is in Simple mode, I'm guessing it's not bulk
logged.


re you doing this in batches
BULK INSERT (BatchSize =)
Nope, straight usage of the DTS package (db connection,
txt file connection and Transform Data Task in between)

What about bcp?
I thought this is the same engine used by DTS?!





Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know

Thanks again Allan.


"A.K." <anonymous (AT) discussions (DOT) microsoft.com> wrote in
message
news:176a01c46f4b$97257020$a601280a (AT) phx (DOT) gbl...
Hi:

Any help with this would be appreciated. Thanks in
advance.

Environment:
SQL 2000 SP3 all up to date on Win2K Server SP4 all up
to
date.

Issue:
Trying to import a very large text file (12GB) into a db
table where the data was originally from. The data was
exported based on a selective query (with a WHERE
clause),
then the table was truncated, and I am in the process of
reimporting the data. The idea was to delete a bunch of
rows as fast as possible.

The export of the text file took about an hour, the
import
is taking six hours and still running.

When I looked at the performance counters, it seemed to
be
writing and reading to the drive that holds the
tempdb. I
assumed that its writing the data to the tempdb db for
the
single shot insert - mind you I did not optimize the
package by tweaking the switch in the package properties
pages.

I am now running out of time, I have to have the data in
by ...hmmm.. half an hour ago. Would it be worth the
while to wait for it or restart the whole thing with
optimized package options for this type of import
(which I
have no idea at this point how to do, BOL maybe)?

Thank you for your help.
If you could CC me zebdi (AT) hotmail (DOT) com

A.K.


.




Reply With Quote
  #5  
Old   
A.K.
 
Posts: n/a

Default Re: Help! Importing a large txt file hanging... - 07-21-2004 , 05:51 PM



A follow-up question is wether exporting to a txt file we
would like to keep, truncating the whole table, then
reimporting the text file is faster than inserting into a
new table the data to keep, deleting the old table, then
renaming the new one. For the second scenario the db will
be switched to bulk-logged mode.

Thank you again.

Quote:
-----Original Message-----
TSQL's BULK INSERT and the BULK INSERT TASK are the same.

mk:@MSITStore:C:\Program%20Files\Microsoft%20SQL%
20Server\80\Tools\Books\dts
sql.chm::/dts_elemtsk2_5m0b.htm

The transform data task with table lock on uses
IRowsetFastLoad(BULK COPY
rowsets) which is the same as bcp.

mk:@MSITStore:C:\Program%20Files\Microsoft%20SQL%
20Server\80\Tools\Books\adm
insql.chm::/ad_impt_bcp_8wc2.htm

I personally would use BULK INSERT and I would use
batches.

Otherwise the data is going to be inserted in one big
lump and that lump
must be stored somewhere first.



--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know


"A.K." <anonymous (AT) discussions (DOT) microsoft.com> wrote in
message
news:174201c46f52$893379b0$a401280a (AT) phx (DOT) gbl...
Thank you for the response:
Which Task?
Transform data task.


Why not use TSQL's BULK INSERT command
No idea wether this would be faster than DTS...

Does the destination table have
1. Indexes Yes, clustered only.
2. Triggers None.

Is the destination DB in at most BULK LOGGED mode?
the db is in Simple mode, I'm guessing it's not bulk
logged.


re you doing this in batches
BULK INSERT (BatchSize =)
Nope, straight usage of the DTS package (db connection,
txt file connection and Transform Data Task in between)

What about bcp?
I thought this is the same engine used by DTS?!





Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know

Thanks again Allan.


"A.K." <anonymous (AT) discussions (DOT) microsoft.com> wrote in
message
news:176a01c46f4b$97257020$a601280a (AT) phx (DOT) gbl...
Hi:

Any help with this would be appreciated. Thanks in
advance.

Environment:
SQL 2000 SP3 all up to date on Win2K Server SP4 all
up
to
date.

Issue:
Trying to import a very large text file (12GB) into
a db
table where the data was originally from. The data
was
exported based on a selective query (with a WHERE
clause),
then the table was truncated, and I am in the
process of
reimporting the data. The idea was to delete a
bunch of
rows as fast as possible.

The export of the text file took about an hour, the
import
is taking six hours and still running.

When I looked at the performance counters, it seemed
to
be
writing and reading to the drive that holds the
tempdb. I
assumed that its writing the data to the tempdb db
for
the
single shot insert - mind you I did not optimize the
package by tweaking the switch in the package
properties
pages.

I am now running out of time, I have to have the
data in
by ...hmmm.. half an hour ago. Would it be worth the
while to wait for it or restart the whole thing with
optimized package options for this type of import
(which I
have no idea at this point how to do, BOL maybe)?

Thank you for your help.
If you could CC me zebdi (AT) hotmail (DOT) com

A.K.


.



.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.