DB2 - 删除DATA CAPTURE字段的操作过程

 [timetrac@viper01 ~]$ db2 alter table role data capture off
 DB21034E  The command was processed as an SQL statement because it was not a
 valid Command Line Processor command.  During SQL processing it returned:
 SQL0104N  An unexpected token "off" was found following "le role data
 capture".  Expected tokens may include:  "NONE".  SQLSTATE=42601
 [timetrac@viper01 ~]$ db2 alter table role data capture none
 DB20000I  The SQL command completed successfully.
 [timetrac@viper01 ~]$ db2 alter table role drop column active
 DB20000I  The SQL command completed successfully.
 [timetrac@viper01 ~]$ db2 alter table role data capture changes
 DB20000I  The SQL command completed successfully.
 [timetrac@viper01 ~]$ db2 values current schema

 1
 ------------------------------------------------------------------------------------------
 TIMETRAC

   1 record(s) selected.

 [timetrac@viper01 ~]$ db2 'select * from role where id = 0'

 ID     NAME                                     SHORTNAME                      DESCRIPTION
 ------ ---------------------------------------- ------------------------------ -----------
 SQL0668N  Operation not allowed for reason code "7" on table "TIMETRAC.ROLE".
 SQLSTATE=57016
 
[timetrac@viper01 ~]$ db2 ? SQL0668N


 SQL0668N  Operation not allowed for reason code "" on table
       "".

 Explanation:

 Access to table "" is restricted. The cause is based on the
 following reason codes "":

 1

          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.


 2

          The table is in the No Data Movement state. When in this state,
          operations that cause data movement are disallowed. Data
          movement operations include REDISTRIBUTE, update of database
          partitioning key, update of multidimensional clustering key,
          update of range clustering key, update of table partitioning
          key and REORG TABLE.


 3

          The table is in the 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 the Read Access 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 the 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.

 7

          The table is in the reorg pending state. This can occur after
          an ALTER TABLE statement containing a REORG-recommended
          operation.
8 The table is in the alter pending state. This can occur when using the table in the same unit of work as an ALTER TABLE statement containing a REORG-recommended operation. 9 The table is in Redistribute Pending state. The REDISTRIBUTE utility is not completed on this table, no access is allowed until the REDISTRIBUTE is finished. 10 The table is the source table for an ongoing ADMIN_MOVE_TABLE operation. The attempted operation is restricted until the move is completed or canceled. User response: 1 Execute the SET INTEGRITY statement with the IMMEDIATE CHECKED option on table "" 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. 2 Execute REFRESH TABLE statement on the dependent immediate materialized query tables and staging tables of table "". The contents of these dependent immediate materialized query tables and staging tables can be incrementally maintained from the appended data of "" through previous LOAD INSERT operations and from the attached data of "" through previous ALTER TABLE statements with the ATTACH clause. 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 statement 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.
 7

          Reorganize the table using the REORG TABLE command.
For a table in the reorg pending state, note that the following clauses are not allowed when reorganizing the table: * The INPLACE REORG TABLE clause * The ON DATA PARTITION clause for a partitioned table when table has nonpartitioned indexes defined on the table 8 Complete the unit of work, and re-issue the command. 9 If the REDISTRIBUTE utility is working, wait until it finishes working on the current table. You can use the LIST UTILITIES command to monitor the progress of the REDISTRIBUTE utility. If a previous REDISTRIBUTE operation failed and left the table in this state, issue the REDISTRIBUTE utility again with the CONTINUE or ABORT option and let it finish on this table. 10 Complete or cancel the table move operation and reissue the command. You can query the SYSTOOLS.ADMIN_MOVE_TABLE table for information about the status of the move operation. sqlcode: -668 sqlstate: 57007 [timetrac@viper01 ~]$ db2 reorg table role DB20000I The REORG command completed successfully. [timetrac@viper01 ~]$ db2 'select * from role where id = 0' ID NAME SHORTNAME DESCRIPTION ------ ---------------------------------------- ------------------------------ ----------- 0 record(s) selected.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值