• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
studyingeveryday
要想改变世界,从改变自己开始!
博客园    首页    新随笔    联系   管理    订阅  订阅
SQL0668N Operation not allowed for reason code "3" on table "TEST". SQLSTATE=57016

问题描述:

查询,操作表都报如下错误

SQL0668N  Operation not allowed for reason code "3" on table "TEST".  SQLSTATE=57016

操作步骤:

第一:执行reorg解锁表,出现以下错误。

[test@TEST-DB1 ~]$ db2 "reorg table test"
SQL0668N Operation not allowed for reason code "3" on table "test". 
SQLSTATE=57016

第二:Load空文件对表进行terminate,出现以下错误。

[test@TEST-DB1 ~]$ db2 load from / of del terminate into test

Agent Type Node SQL Code Result
______________________________________________________________________________
LOAD 001 +00000000 Success.
______________________________________________________________________________
LOAD 002 -00027902 Init error. Table unchanged.
______________________________________________________________________________
LOAD 003 -00027902 Init error. Table unchanged.
______________________________________________________________________________
LOAD 004 -00027902 Init error. Table unchanged.
______________________________________________________________________________
LOAD 005 -00027902 Init error. Table unchanged.
______________________________________________________________________________
LOAD 006 +00000000 Success.
______________________________________________________________________________
LOAD 007 -00027902 Init error. Table unchanged.
______________________________________________________________________________
LOAD 008 -00027902 Init error. Table unchanged.
______________________________________________________________________________
LOAD 009 -00027902 Init error. Table unchanged.
______________________________________________________________________________
LOAD 010 -00027902 Init error. Table unchanged.
______________________________________________________________________________
LOAD 011 -00027902 Init error. Table unchanged.
______________________________________________________________________________
LOAD 012 -00027902 Init error. Table unchanged.
______________________________________________________________________________
LOAD 013 -00027902 Init error. Table unchanged.
______________________________________________________________________________
LOAD 014 -00027902 Init error. Table unchanged.
______________________________________________________________________________
LOAD 015 -00027902 Init error. Table unchanged.
______________________________________________________________________________
LOAD 016 -00027902 Init error. Table unchanged.
______________________________________________________________________________
RESULTS: 2 of 16 LOADs completed successfully.
______________________________________________________________________________

Summary of LOAD Agents:
Number of rows read = 0
Number of rows skipped = 0
Number of rows loaded = 0
Number of rows rejected = 0
Number of rows deleted = 0
Number of rows committed = 0

SQL27902N LOAD RESTART/TERMINATE is not allowed on a table that is not in 
LOAD PENDING state.

一般上面两步基本能解决表无法操作问题,不过也有的跟这次一样无法完成,

分析可能是部分分区没有进行terminate或者load时被强制杀了

第三:查询分区表状态

[test@TEST-DB1 ~]$ db2 -x "SELECT DBPARTITIONNUM FROM TABLE(SYSPROC.ADMIN_GET_TAB_INFO('TEST','TEST')) AS T where load_status='PENDING' "

挨个对上面查询出的分区号进行terminate处理

[test@TEST-DB1 ~]$db2 load from /dev/null of del terminate into TEST.TEST  partitioned db config OUTPUT_DBPARTNUMS('分区号')

执行完成!

posted on 2019-05-06 19:08  studyingeveryday  阅读(3446)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3