I presume you're problems solved but here anyways
@db2 ? sql668
SQL0668N Operation not allowed for reason code
"<reason-code>" on table "<table-name>".
Explanation:
Access to table "<table-name>" is restricted. The cause is based
on the following reason codes "<reason-code>":
1 The table is in Check Pending 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 a check pending state may also receive this error
if a dependent table is in a check pending state.
2 The table is in No Data Movement state. When in this state,
operations that cause data movement are disallowed. Data movement
operations include REDISTRIBUTE, update of partitioning key,
update of multi-dimensional clustering key and REORG TABLE.
3 The table is in Load Pending state. A previous LOAD attempt on
this table resulted in failure. No access to the table is allowed
until the LOAD operation is restarted or terminated.
4 The table is Read Only state. This state can occur during
on-line LOAD processing (LOAD INSERT with the READ ACCESS option),
or after an on-line LOAD operation, but before all constraints
have been validated in the newly appended portion of the table
using the SET INTEGRITY statement. No update activity is allowed
on this table.
5 The table is in Load In Progress state. The LOAD utility is
currently operating on this table, no access is allowed until the
LOAD is finished.
6 Materialized query tables that reference a nickname cannot be
refreshed in ESE.
User Response:
1 Execute the SET INTEGRITY statement with the IMMEDIATE CHECKED
option on table "<table-name>" to bring the table out of the
Check Pending state. For a user maintained materialized
query table, execute the statement with the IMMEDIATE
UNCHECKED option instead of the IMMEDIATE CHECKED
option.
2 Execute REFRESH TABLE statement on the dependent immediate
materialized query tables and staging tables of table
"<table-name>". The contents of these dependent immediate
materialized query tables and staging tables can be incrementally
maintained from the appended data of "<table-name>" through
previous LOAD INSERT operations.
3 Restart or terminate the previously failed LOAD operation on
this table by issuing LOAD with the RESTART or TERMINATE option
respectively.
4 Issue the LOAD QUERY command to check whether the table is in
the process of being loaded. If yes, wait until the LOAD utility
has completed, or if necessary, restart or terminate previously
failed LOAD operation. If LOAD is currently not in progress,
issue the SET INTEGRITY command with the IMMEDIATE CHECKED option,
to validate constraints in the newly loaded portion of the
table.
5 Wait until the current LOAD operation has finished. You can
use the LOAD QUERY command to monitor the progress of load.
6 Define a materialized query table using the MAINTAIN BY USER
option. Then, use an INSERT statement with a subquery to populate
the materialized query table.
sqlcode : -668
sqlstate : 57016
@
Regards,
Anand
-----Original Message-----
From: Nair Krishna K.
[mailto:db2udbdba-ezmlmshield-x58284002.[Email address protected]
Sent: Thursday, April 26, 2007 6:25 PM
To: LazyDBA Discussion
Subject: RE: Database Error
DB2 SQL error: SQLCODE: -668, SQLSTATE: 57016, SQLERRMC: 1;<TableName>
Message: Operation not allowed for reason code "1" on table
"<TableName>".
Can someone shed some light on this?
-----Original Message-----
From: Sheuehua
[mailto:db2udbdba-ezmlmshield-x81185650.[Email address protected]
Sent: Thursday, April 26, 2007 8:53 AM
To: LazyDBA Discussion
Subject: How to rebuild primary key on same table
Hi,
I got a request to rebuild primary key on same table; one table
called "promotion_history", initial has 2 columns as
a primary key; now they want to rebuilt with adding addition one cloumn
(
client_name).
I select with group by to find any count > 1 within those 3 columns to
make
sure not duplicate records.
There is not FK constrants on this table; can I go ahead drop old
primary
key and rebuild the new primary key with 3 colums.
Do I have to copy the old table to a new table, in case of the bulding
failed?
Thanks for your help!!
Sue
**********************************************************************
This e-mail transmission and any attachments that accompany it may
contain information that is privileged, confidential or otherwise
exempt from disclosure under applicable law and is intended solely for
the use of the individual(s) to whom it was intended to be addressed.
If you have received this e-mail by mistake, or you are not the
intended recipient, any disclosure, dissemination, distribution,
copying or other use or retention of this communication or its
substance is prohibited. If you have received this communication in
error, please immediately reply to the author via e-mail that you
received this message by mistake and also permanently delete the
original and all copies of this e-mail and any attachments from your
computer. Thank you.
**********************************************************************
---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
DB2 & UDB email list listserv db2-l LazyDBA home page