db2 load pending how to reset
https://www.ibm.com/support/pages/db2-how-reset-load-pending-state
Question
I cannot access a table due to SQL0668N error RC=3, which indicates the table is in LOAD PENDING state. How can I reset the LOAD PENDING state ?
SQL0668N Operation not allowed for reason code "3" on table "<table-name>".
Cause
The table may be placed in LOAD PENDING state if the LOAD operation for the table failed or was terminated in the middle. For example, due to FORCE APPLICATION issued for the application running the LOAD operation.
Answer
You can reset LOAD PENDING state by any of the following methods.
- Terminate the LOAD operation by specifying the TERMINATE option in the LOAD command.
The target table name must match the one specified in the original LOAD command invocation.
db2 "load from test.del of del messages msg.txt terminate into tab1" - Restart the LOAD operation by specifying the RESTART option in the LOAD command.
db2 "load from test.del of del messages msg.txt restart into tab1" - Run a LOAD REPLACE operation for the table in LOAD PENDING state.
db2 "load from test.del of del messages msg.txt replace into tab1 copy yes to /work" - Restore the tablespace containing the table from the latest database or tablespace backup image, then rollforward to the point you would like to recover.
db2 "restore db sample from /work taken at 20110815131050"
db2 rollforward db sample to end of logs and stop
You can find out which table is in LOAD PENDING state by using ADMINTABINFO administration view.
$ db2 "SELECT VARCHAR(TABSCHEMA,30) TABSCHEMA,VARCHAR(TABNAME,30) TABNAME, LOAD_STATUS, NO_LOAD_RESTART FROM SYSIBMADM.ADMINTABINFO WHERE LOAD_STATUS <> 'NULL'"
TABSCHEMA TABNAME LOAD_STATUS NO_LOAD_RESTART
----------- ---------- ------------ ---------------
DB2INST1 TAB1 PENDING N
TABSCHEMA TABNAME LOAD_STATUS NO_LOAD_RESTART
----------- ---------- ------------ ---------------
DB2INST1 TAB1 PENDING N
コメント
コメントを投稿