請你們來跟貼,一人跟一貼,把平常DB2的錯誤及解決方法都貼出來....

1) 建立數據庫的時候,報42704錯誤。如:
Sql代碼

 數據庫

  • =>create database test
  • =>SQL0204N "SYSTEM_1386_US" is an undefined name. SQLSTATE=42704
     


=>create database test=>SQL0204N "SYSTEM_1386_US" is an undefined name. SQLSTATE=42704

解決辦法:
Sql代碼

 ide

  • =>create database test using codeset gbk territory cn
     


=>create database test using codeset gbk territory cn

2) 在鏈接數據的時候,報57017錯誤。如:
Sql代碼
 fetch

  • =>connect to test user test using test
  • =>SQL0332N Character conversion from the source code page "1386" to the target code page "819" is not supported. SQLSTATE=57017
     


=>connect to test user test using test=>SQL0332N Character conversion from the source code page "1386" to the target code page "819" is not supported. SQLSTATE=57017

解決辦法:
Sql代碼

 spa

  • =>db2set db2codepage=1386
     


=>db2set db2codepage=1386

3) 在對數據庫進行操做的時候,報55039錯誤。如:

Sql代碼

 code

  • =>db2 drop table t_base_acc_manageacc
  • =>SQL0290N Table space access is not allowed. SQLSTATE=55039
  •  
  • =>db2 list tablespaces show detail
  • Tablespace ID = 2
  • Name = USERSPACE1
  • Type = System managed space
  • Contents = Any data
  • State = 0x0020
  • Detailed explanation:
  • Backup pending
     


=>db2 drop table t_base_acc_manageacc=>SQL0290N Table space access is not allowed. SQLSTATE=55039=>db2 list tablespaces show detailTablespace ID = 2Name = USERSPACE1Type = System managed spaceContents = Any dataState = 0x0020Detailed explanation: Backup pending

緣由:在歸檔的數據庫作過load或者改了參數從新啓動了db

解決辦法:
Sql代碼:

 get

  • 備份數據庫
  • =>db2 backup db
     


備份數據庫=>db2 backup db

4) 在對數據庫進行備份的時候,報57019錯誤。如:
Sql代碼 :

 it

  • =>db2 backup database dbname to /xx/xx compress
  • =>SQL1035N The database is currently in use. SQLSTATE=57019
     


=>db2 backup database dbname to /xx/xx compress=>SQL1035N The database is currently in use. SQLSTATE=57019

解決辦法:

Sql代碼:

 io

  • =>db2stop force
  • =>db2start
     


=>db2stop force=>db2start

5) 在對建立表空間的時候,報54047錯誤。如:
Sql代碼

 table

  • =>create regular tablespace space1 pagesize 4 k managed by database using (device '/dev/dd' 25000000) prefetchsize automatic bufferpool bp1
  • =>SQL1139N The total size of the table space is too big. SQLSTATE=54047
     


=>create regular tablespace space1 pagesize 4 k managed by database using (device '/dev/dd' 25000000) prefetchsize automatic bufferpool bp1=>SQL1139N The total size of the table space is too big. SQLSTATE=54047

 class

相關文章
相關標籤/搜索