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 > Help using the DB2 Load command

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-09-11, 16:19
db2user24 db2user24 is offline
Registered User
 
Join Date: Nov 2007
Posts: 248
Help using the DB2 Load command

Hi,

I was experimenting with the load command and exported data from a small table to a del file, deleted everything from the table and then gave the load command to put the data back --

db2 load from tcontents.del of del "insert into tblname ( col1, col2)"

SQL3109N The utility is beginning to load data from file
"/home/db2inst1/tcontents.del".

SQL3500W The utility is beginning the "LOAD" phase at time "08/09/2011
20:01:44.080010".

SQL3519W Begin Load Consistency Point. Input record count = "0".

SQL3520W Load Consistency Point was successful.

SQL3110N The utility has completed processing. "10" rows were read from the
input file.

SQL3519W Begin Load Consistency Point. Input record count = "10".

SQL3520W Load Consistency Point was successful.

SQL3515W The utility has finished the "LOAD" phase at time "08/09/2011
20:01:44.637195".

SQL3500W The utility is beginning the "BUILD" phase at time "08/09/2011
20:01:44.640314".

SQL3213I The indexing mode is "REBUILD".

SQL3515W The utility has finished the "BUILD" phase at time "08/09/2011
20:01:44.687880".


Number of rows read = 10
Number of rows skipped = 0
Number of rows loaded = 10
Number of rows rejected = 0
Number of rows deleted = 0
Number of rows committed = 10



Then, if I try to select from the table-- I get this :

db2 "select * from tblname"

COL1 COL2
----------- -----------
SQL0668N Operation not allowed for reason code "1" on table
"db2inst1.tblname". SQLSTATE=57016


I looked up the error and found this --

The table is in the Set Integrity Pending No Access state. The integrity of the table is not enforced and the content of the table may be invalid. An operation on a parent table or an underlying table that is not in the Set Integrity Pending No Access state may also receive this error if a dependent table is in the Set Integrity Pending No Access state.

Execute the SET INTEGRITY statement with the IMMEDIATE CHECKED option on table table-name to bring the table out of the Set Integrity Pending No Access state. For a user maintained materialized query table, execute the statement with the IMMEDIATE UNCHECKED option instead of the IMMEDIATE CHECKED option.


So then I give this command to fix it --

db2 "set integrity for tblname IMMEDIATE CHECKED"
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0290N Table space access is not allowed. SQLSTATE=55039


What did I do wrong and how can i fix it? thanks!
Reply With Quote
  #2 (permalink)  
Old 08-09-11, 16:28
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Since the LOAD command is not logged, it places the affected tablespace into a BACKUP PENDING mode. You now must run a backup before you can access that tablespace.

For the future, you could use two options to avoid this:
- COPY YES - it will create a set of recovery data for the table (at the price of extra space and poorer performance) and the tablespace will not be placed into a BACKUP PENDING mode;
- NONRECOVERABLE - the tablespace will not be placed into a BACKUP PENDING mode, but you won't be able to recover the table if something goes wrong; you will have to drop and re-create it.
Reply With Quote
  #3 (permalink)  
Old 08-09-11, 16:38
db2user24 db2user24 is offline
Registered User
 
Join Date: Nov 2007
Posts: 248
thanks, the odd thing is that I can access other tables that are in that tablespace. is this expected?

also, what options do you typically use when giving the load command? thanks!
Reply With Quote
  #4 (permalink)  
Old 08-09-11, 17:02
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by db2user24 View Post
thanks, the odd thing is that I can access other tables that are in that tablespace. is this expected?
It is if by access you mean SELECT.

Quote:
Originally Posted by db2user24 View Post
also, what options do you typically use when giving the load command?
It depends.
Reply With Quote
  #5 (permalink)  
Old 08-09-11, 17:06
db2user24 db2user24 is offline
Registered User
 
Join Date: Nov 2007
Posts: 248
Thanks, I guess I was wondering if COPY and NONRECOVERABLE are options that are used regularly by others.. they both seem to have some major drawbacks.. but the state my tablespace is in right now is no good either.
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