db2 錯誤小結-1
把這次資料遷移和修改表結構時遇到的問題小結下,做個參考:
1.對於執行中的報錯,可以在db2命令列下執行命令 : db2=>? SQLxxx 檢視對應的報錯原因及解決方法。
2. 錯誤小結:
1.對於執行中的報錯,可以在db2命令列下執行命令 : db2=>? SQLxxx 檢視對應的報錯原因及解決方法。
2. 錯誤小結:
- SQL0206N "SQL_COU_ALL" is not valid in the context where it is used. SQLSTATE=42703
SQL_COU_ALL不存在
SQL0668N Operation not allowed for reason code "7" on table "xxx.Z_BP_TMPBATCH_TB_HIS". SQLSTATE=57016
db2 => ? SQL0668N code 7
SQL0668N Operation not allowed for reason code "" on table
"".
Explanation:
Access to table "" is restricted. The cause is based on the
following reason codes "":
7
The table is in the reorg pending state. This can occur after
an ALTER TABLE statement containing a REORG-recommended
operation.
User response:
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
表處於pending state,需要重組該表。 - ALTER TABLE xxx.FM_BORRO ALTER COLUMN DOCUMENT_TYPE_1 SET NOT NULL
報錯: SQL20054N The table "xxx.FM_BORROW" is in an invalid state for the operation. Reason code="23". SQLSTATE=55019
db2 => ? SQL20054N
SQL20054N The table "" is in an invalid state for the
operation. Reason code="".
Explanation:
The table is in a state that does not allow the operation. The
"" indicates the state of the table that prevents the
operation.
23 The maximum number of REORG-recommended alters have been
performed. Up to three REORG-recommended operations are allowed
on a table before a reorg must be performed, to update the
tables rows to match the current schema.
User response:
23 Reorg the table using the reorg table command.
說明:當對錶結構進行更改時,也可能導致表狀態異常。比如,以下操作可能會導致表處於reorg-pending狀態。
(1) alter tablealter set data type
(2) alter tablealter set not null
(3) alter tabledrop column
(4) ……
出現reorg pending的根源是當表結構變化後影響了資料行中的資料格式,這時需要對錶做reorg。可能的錯誤號是:
01.SQL0668N Operation not allowed for reason code "7" on table "SDD.ST_INCRE008". SQLSTATE=57016
03.SQL20054N The table "" is in an invalid state for the operation. Reason code="7".
複製程式碼每一個表在不進行重組(Reorg)的前提下,只允許進行3次結構上的修改。三次更改後必須對錶進行重組。
REORG TABLE "xx"."FM_BORROW"
ALLOW NO ACCESS
KEEPDICTIONARY; - ALTER TABLE xxx.FAQ ALTER COLUMN FAQ_UNIT_NAME SET DATA TYPE VARCHAR(800)
報錯 SQL0670N The row length of the table exceeded a limit of "8101" bytes. (Table space "SHJD_DATA".) SQLSTATE=54010
SQL0670N The row length of the table exceeded a limit of ""
bytes. (Table space "".)
Explanation:
The row length of a table in the database manager cannot exceed:
* 4005 bytes in a table space with a 4K page size
* 8101 bytes in a table space with an 8K page size
* 16293 bytes in a table space with an 16K page size
* 32677 bytes in a table space with an 32K page size
The length is calculated by adding the internal lengths of the columns.
Details of internal column lengths can be found under CREATE TABLE in
the SQL Reference.
說明:該表所有欄位長度之和大於當前資料庫頁大小(8K) - ALTER TABLE xxx.BP_TMPDATA_1_TB_1903 ALTER COLUMN RATE SET DATA TYPE DECIMAL(6,4)
報錯 SQL0190N ALTER TABLE "BP_TMPDATA_1_TB_1903" specified attributes for column "RATE" that are not compatible with the existing column. SQLSTATE=42837
說明: BP_TMPDATA_1_TB_1903 現有資料的精度超過了 DECIMAL(6,4) ,比如100.00 - SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the error was detected: "10.0.0.200". Communication function detecting the error: "selectForConnectTimeout". Protocol specific error code(s): "0", "*", "*". SQLSTATE=08001
檢查伺服器的配置情況如下:
驗證存在的DB2資料庫
db2 list db directory
db2 list db directory show detail
驗證例項使用的通訊協議,檢視DB2COMM變數
db2set -all
檢視資料庫管理器的配置,檢視SVCENAME(特指tcpip協議)
db2 get dbm cfg
檢視/etc/services中,有無與上面對應SVCENAME的埠,例如:
db2cDB2 50000/tcp
驗證遠端伺服器例項配置
db2 list node directory
db2 list node directory show detail
ping hostname來驗證通訊
使用telnet hostname port來驗證是否能連到例項
db2 list node directory
db2 list node directory show detail
ping hostname來驗證通訊
使用telnet hostname port來驗證是否能連到例項
用DB2提供的PCT工具來檢測一下
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/241379/viewspace-753977/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle錯誤小結Oracle
- DB2 錯誤一覽DB2
- datastage與db2小結ASTDB2
- db2 -attribute of key are miss in result set . db2 錯誤DB2
- DB2錯誤資訊(按sqlcode排序)DB2SQL排序
- DB2 DDL操作引起的GoldenGate錯誤DB2Go
- db2 安裝過程小結DB2
- DB2 時間函式小結 .DB2函式
- php編譯小錯誤PHP編譯
- 問題小結:Linux下oracle常見安裝錯誤總結LinuxOracle
- 【DB2】在AIX 上安裝DB2 遇到空間不足的錯誤DB2AI
- DB2常用系統檢視小結DB2
- npm錯誤總結NPM
- PbootCMS錯誤提示:執行SQL發生錯誤!錯誤:no such column: def1bootSQL
- Linux環境下段錯誤的產生原因及除錯方法小結Linux除錯
- DB2匯出表結構、表資料小結DB2
- 小總結(1)
- DB2字符集,查詢中文錯誤DB2
- 常見DB2的錯誤的報告程式碼DB2
- DB2 -668 錯誤,sqlcode=-668 ,SQLSTATE=57016DB2SQL
- Java web錯誤總結~JavaWeb
- TimesTen錯誤總結
- PbootCMS執行SQL發生錯誤!錯誤:no such column: def1bootSQL
- jsp中的錯誤1JS
- 小程式錯誤:Component is not found in path
- 開發時犯得小錯誤
- 安裝RAC常見小錯誤
- DB2訪問遠端資料庫通訊錯誤DB2資料庫
- 1.HTML小結HTML
- Windows計劃任務出現0x1錯誤結果Windows
- Polar mask錯誤總結
- QT 學習錯誤總結QT
- mysql錯誤解決總結MySql
- Python部分錯誤總結Python
- db2 遠端連線伺服器 解決-668 錯誤DB2伺服器
- SQL0946N錯誤及DB2事務日誌SQLDB2
- db2 安裝後建立例項錯誤!高手指教(轉)DB2
- 微信小程式錯誤監控方法談微信小程式