DB2 Non-recoverable Bulk Load (Table in check pending state)

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
brupun
Premium Member
Premium Member
Posts: 16
Joined: Thu Jun 14, 2012 10:10 am

DB2 Non-recoverable Bulk Load (Table in check pending state)

Post by brupun »

I tried to load data into a Db2 table using DB2 Bulk Load utility on Datastage. Non-recoverable option was set to true. Load finished successfully but left the table in a 'check pending state'. The table has referential constraints on it. I tried to bulk load a table with no referential constraints, the load finished successfully leaving the table in Normal state. Does anybody know how to bring back the table to Normal state after the load finishes in Datastage?

Thanks for your help!
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Your DBA.
-craig

"You can never have too many knives" -- Logan Nine Fingers
brupun
Premium Member
Premium Member
Posts: 16
Joined: Thu Jun 14, 2012 10:10 am

Post by brupun »

How can I Bulk Load tables with referential constraint, using Datatsage without leaving them in a check pending state?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The same way you would outside of DataStage.

I would provide specifics if I could but I've never touched DB2 in my life. However, from hanging out here and reading the documentation (are you using the DB2 Connector?) it seems like DB2 always leaves a bulk loaded table with check constraints or referential integrity constraints in that 'check pending' state. Your only option there is if you want that on any descendant tables as well - i.e. DEFERRED v. IMMEDIATE.

Hence my suggestion to ask your DBA. What DB2 steps are required to get the table out of that state? Perhaps they would be candidates for the 'After SQL' property.

And a very quick google shows that "To remove the check pending state, use the SET INTEGRITY statement. The SET INTEGRITY statement checks a table for constraints violations, and takes the table out of check pending state."
-craig

"You can never have too many knives" -- Logan Nine Fingers
brupun
Premium Member
Premium Member
Posts: 16
Joined: Thu Jun 14, 2012 10:10 am

Post by brupun »

My DBA said they cannot give DBA privileges to the User ID to perform SET Integrity in After-SQL property. He said in order to avoid tables with refential Integrity getting in check-pending state after bulk load, I need to load the whole hierarchy , because when you load just a child table DB2 puts that table in check pending mode. Any thoughts on how to load the whole hierarchy?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Nope but I'd wager others with DB2 and DataStage experience do.

What about whatever passes for a 'stored procedure' in DB2? A typical workaround would be to craft a procedure is owned by the table owner that performs the function in question and then your ETL functional user would be granted the ability to execute it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
brupun
Premium Member
Premium Member
Posts: 16
Joined: Thu Jun 14, 2012 10:10 am

Post by brupun »

chulett wrote:Nope but I'd wager others with DB2 and DataStage experience do.

What about whatever passes for a 'stored procedure' in DB2? A typical workaround would be to craft a procedure is owned by the table owner that performs the function in question and then your ETL functional user would be granted the ability to execute it.
Thanks for your suggestion. We did create a stored procedure and called it in After-SQL property of the DB2 connector. It works!
Post Reply