If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 LOAD Problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-28-10, 02:39
nafox nafox is offline
Registered User
 
Join Date: Feb 2010
Posts: 2
DB2 LOAD Problem

Hi

Problem is that no data is dumped into the Table.

Informationtoken: "DB2 Express-C", "DB2 v9.7.100.177", "s091114", "IP23028" und FixPak "1".

I´m trying to dump a space-delimited text file into DB2 with following statement:

Code:
CONNECT TO DB2BENCH;
LOAD FROM "D:\DateSort.txt" OF DEL MODIFIED BY COLDELOx20 FASTPARSE NOROWWARNINGS 
USEDEFAULTS METHOD P (1, 2, 3, 4, 5, 6, 7) MESSAGES "D:\db2benchmark\Statusnachrichten" 
INSERT INTO RICHTER.DATESINFO (CALYEAR, CALMONTH, CALDAY, DAYHOUR, CALDATE, DAYOFWEEK, ID)
NONRECOVERABLE INDEXING MODE REBUILD LOCK WITH FORCE;
CONNECT RESET;
OS: Windows Server 2003

Table Datesinfo looks like this:
CREATE TABLE datesinfo (
calyear SMALLINT NOT NULL,
calmonth SMALLINT NOT NULL,
calday SMALLINT NOT NULL,
dayhour SMALLINT NOT NULL,
caldate date NOT NULL,
dayofweek SMALLINT NOT NULL,
id SMALLINT NOT NULL PRIMARY KEY );

Text file looks like this (Unix format):
20091201-00 2009 12 1 0 2009-12-01 2 1
20091201-01 2009 12 1 1 2009-12-01 2 2
20091201-02 2009 12 1 2 2009-12-01 2 3
..........

Getting following message:
SQL3501W Der oder die Tabellenbereiche, die die Tabelle enthalten, werden
nicht in den Status 'Backup anstehend' versetzt, da die aktualisierende
Recovery für die Datenbank nicht aktiviert wurde.

SQL3109N Das Dienstprogramm beginnt mit dem Laden von Daten aus der Datei
"D:\DateSort.txt".

SQL3500W Die Phase "LOAD" wird gestartet (Zeit: "2010-02-28
05.45.45.296927").

SQL3519W Synchronisationspunkt am Beginn des Ladevorgangs. Eingabesatzzähler:
"0".

SQL3520W Synchronisationspunkt für Ladevorgang erfolgreich.

SQL3110N Die Verarbeitung des Dienstprogramms ist abgeschlossen. Es wurden
"3" Zeile(n) aus der Eingabedatei gelesen.

SQL3519W Synchronisationspunkt am Beginn des Ladevorgangs. Eingabesatzzähler:
"3".

SQL3520W Synchronisationspunkt für Ladevorgang erfolgreich.

SQL3515W Die Phase "LOAD" wurde beendet (Zeit: "2010-02-28 05.45.45.326030").

SQL3500W Die Phase "BUILD" wird gestartet (Zeit: "2010-02-28
05.45.45.326907").

SQL3213I Der Indexierungsmodus ist "REBUILD".

SQL3515W Die Phase "BUILD" wurde beendet (Zeit: "2010-02-28
05.45.45.404151").

SQL3107W Die Nachrichtendatei enthält mindestens eine Warnung.


Anzahl gelesener Zeilen = 3
Anzahl übersprungener Zeilen = 0
Anzahl geladener Zeilen = 0
Anzahl zurückgewiesener Zeilen = 3
Anzahl gelöschter Zeilen = 0
Anzahl festgeschriebener Zeilen = 3

It´s kinda urgand so I would be really grateful if one could help me.

Last edited by nafox; 02-28-10 at 03:52.
Reply With Quote
  #2 (permalink)  
Old 02-28-10, 06:35
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
what is the warning in the message file ???
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 02-28-10, 09:15
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
"METHOD P (1, 2, 3, 4, 5, 6, 7)" specification does not seem appropriate for the input file you have provided.
Reply With Quote
  #4 (permalink)  
Old 03-01-10, 00:05
nafox nafox is offline
Registered User
 
Join Date: Feb 2010
Posts: 2
I have worked the whole night so sorry for overlooking that the massage file is in German.
The basic problem is that I canīt specify a white space as a delimiter.
The file I have looks like this (and not like the one above, sorry again):
2009 12 1 0 2009-12-01 2 1
2009 12 1 1 2009-12-01 2 2
2009 12 1 2 2009-12-01 2 3

So 7 values delimited by whitespace and line feed for new line (UNIX format).

I tried it with COLDEL0x20 and COLDELX'20' but both wonīt work. It seems like just the first character 0 respectively X is treaded as delimiter.

Does LOAD even support whitespace as delimiter?

Now all I want to know is how to get the text file into the datesinfo table (see first post)? Since itīs a large text file (~25 gb and 1100000000 rows) I thought LOAD is the right choice to dump it into the table.

Sorry if this is a newbie question but I normally working with postgres and I am rather new to db2.

Hope my english is understandable
Reply With Quote
  #5 (permalink)  
Old 03-01-10, 00:19
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
There is no such thing as "whitespace" in ASCII. It may be blank, or tab character, or some other unprintable character. In most cases you can specify the delimiter for DB2 use the use for the LOAD command (I assume you have a Command Reference manual to explain how to do that).
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #6 (permalink)  
Old 03-01-10, 04:09
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Blank space cannot be used as a delimiter in DEL files

Delimiter considerations for moving data

the options you have :
a) ask the data supplier to change the format to include a delimiter
b) process the input file before loading the data to add the delimiter
c) dump the data as a single string into a staging table column and then parse it to load into the target table.
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #7 (permalink)  
Old 03-01-10, 05:36
nvk@vhv nvk@vhv is offline
Registered User
 
Join Date: Jan 2010
Posts: 294
Hi,

if you start the setup.exe of DB2 with 'setup.exe /i EN', you can install the DB2 Server in English. Then you don't need to translate the error-messages.

Also in earlier Versions the translation of error-messages diddn't make sense and were misleading. (And my personal favorite is 'Pufferpools'.)

Offtopic, but it may help you in future.
Reply With Quote
  #8 (permalink)  
Old 03-01-10, 09:56
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
Get a manual as it is all in there

My table structure is from your ddl.

your data file
>cat 1.dat
2009 12 1 0 2009-12-01 2 1
2009 12 1 1 2009-12-01 2 2
2009 12 1 2 2009-12-01 2 3


db2 "load from 1.dat of asc method L (1 4, 6 7, 9 9, 11 11, 13 22, 24 24, 26 26) insert into xxxxxx.test (calyear, calmonth, calday, dayhour, caldate, dayofweek, id) NONRECOVERABLE"


Agent Type Node SQL Code Result
__________________________________________________ ____________________________
LOAD 000 +00000000 Success.
__________________________________________________ ____________________________
PRE_PARTITION 000 +00000000 Success.
__________________________________________________ ____________________________
RESULTS: 1 of 1 LOADs completed successfully.
__________________________________________________ ____________________________

Summary of LOAD Agents:
Number of rows read = 3
Number of rows skipped = 0
Number of rows loaded = 3
Number of rows rejected = 0
Number of rows deleted = 0
Number of rows committed = 3


db2 "select * from xxxxxxx.test"

CALYEAR CALMONTH CALDAY DAYHOUR CALDATE DAYOFWEEK ID
------- -------- ------ ------- ---------- --------- ------
2009 12 1 0 12/01/2009 2 1
2009 12 1 1 12/01/2009 2 2
2009 12 1 2 12/01/2009 2 3

3 record(s) selected.
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #9 (permalink)  
Old 03-01-10, 12:39
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Cougar, The month and day part of the file may be either one or two digits ... this is the reason i did not suggest the ASC approach ...

Let's see what the OP thinks ;-)
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #10 (permalink)  
Old 03-01-10, 16:55
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
Quote:
Originally Posted by sathyaram_s View Post
Cougar, The month and day part of the file may be either one or two digits ... this is the reason i did not suggest the ASC approach ...

Let's see what the OP thinks ;-)
That is true. In that case there are couple of other very simple solutions that can be implemented in order to get it to work. I am getting ready to pop a cold one and observe. Is it 4pm yet
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #11 (permalink)  
Old 03-01-10, 20:55
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Quote:
Originally Posted by Cougar8000 View Post
Is it 4pm yet
Still working "Late in, Early out"
Reply With Quote
  #12 (permalink)  
Old 03-02-10, 04:40
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
isn't that the norm??
Quote:
Originally Posted by db2girl View Post
Still working "Late in, Early out"
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #13 (permalink)  
Old 03-02-10, 11:43
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
Quote:
Originally Posted by db2girl View Post
Still working "Late in, Early out"
Damn it. Who turned the video monitor on
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On