Answer Posted / abhishek singh
1. When you use ALTER TABLE to add a check constraint to already populated tables, and CURRENT RULES special register is DB2®, the check constraint is added to the table description but its enforcement is deferred. Because there might be rows in the table that violate the check constraint, the table is placed in CHECK-pending status.
2. When a table is LOADed with ENFORCE NO option, then the table is left in CHECK PENDING status as DB2 bypasses referential integrity and check constraints
3. An index might be placed in CHECK-pending status if you recovered an index to a specific RBA or LRSN from a copy and applied the log records, but you did not recover the table space in the same list. The CHECK-pending status can also be set on an index if you specified the table space and the index, but the recovery point in time was not a point of consistency (QUIESCE or COPY SHRLEVEL REFERENCE).
To reset this status, run the CHECK DATA utility, which locates invalid data and, optionally, removes it. If CHECK DATA removes the invalid data, the remaining data satisfies all check and referential constraints and therefore, the CHECK-pending restriction is removed.
1. If a table space is in both REORG-pending and CHECK-pending status (or auxiliary CHECK-pending status), run the REORG TABLESPACE utility first and then run CHECK DATA to reset the respective states.
2.Run the CHECK INDEX utility on the index. If any errors are found, use the REBUILD INDEX utility to rebuild the index from existing data.
3.Use the REPAIR utility with the SET STATEMENT and NOCHECKPEND option.
Following jobs remove copy pending and recovery pending status from a table space and removes copy pending, recovery pending status and rebuild pending status from an index space
//STEPO1 EXEC PGM=DSNUTILB,REGIONM,
// PARM='DB2X,MIGRDAN, '
//STEPLIB DD DSN=XXX.XXXXX.SDSNLOAD,DISP=SHR
//SYSIN DD *
REPAIR SET TABLESPACE XXXXX.XXXXX NOCOPYPEND
REPAIR SET TABLESPACE XXXXX.XXXXX NORCVRPEND
REPAIR SET INDEX XXXXX.XXXXX NOCOPYPEND
REPAIR SET INDEX XXXXX.XXXXX NORCVRPEND
REPAIR SET INDEX XXXXX.XXXXX NORBDPEND
/*
//SYSPRINT DD SYSOUT=*
//UTPRINT DD SYSOUT=*
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Mention the different locking levels that are available in db2.
Name the lockable units in DB2?
What is the use of reorg in db2?
SET is the ANSI standard for variable assignment, SELECT is not. SET can only assign one variable at a time, SELECT can make multiple assignments at once. If assigning from a query, SET can only assign a scalar value. If the query returns multiple values/rows then SET will raise an error. SELECT will assign one of the values to the variable and hide the fact that multiple values were returned (so you'd likely never know why something was going wrong elsewhere - have fun troubleshooting that one) When assigning from a query if there is no value returned then SET will assign NULL, where SELECT will not make the assignment at all (so the variable will not be changed from it's previous value) As far as speed differences - there are no direct differences between SET and SELECT. However SELECT's ability to make multiple assignments in one shot does give it a slight speed advantage over SET.
Define sqlca.
Explain what are the various isolation levels possible?
Why do we need reorg in db2?
What r the comman abends in db2, jcl and cobol???????
How to view db2 table structure?
How to check sequence on a table in db2?
What is a bind in db2?
How many databases can be created inside an instance in db2 ?
How to find the number of rows in a db2 table?
Before you give the explain statement, what are the prerogatives?
Following a db2 update statement, what is the quickest way to compute the total number of updated rows?