设为首页 收藏本站
查看: 1043|回复: 0

[经验分享] DB2

[复制链接]

尚未签到

发表于 2016-11-16 08:51:58 | 显示全部楼层 |阅读模式
[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.

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-300982-1-1.html 上篇帖子: DB2 分页查询方法,查询top N 条记录 下篇帖子: db2中获取某个表/索引占用空间的大小
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表