请大家来跟贴,一人跟一贴,把日常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代码

 

  • =>create database test using codeset gbk territory cn
     


=>create database test using codeset gbk territory cn

2) 在连接数据的时候,报57017错误。如:
Sql代码
 

  • =>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代码

 

  • =>db2set db2codepage=1386
     


=>db2set db2codepage=1386

3) 在对数据库进行操作的时候,报55039错误。如:

Sql代码

 

  • =>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代码:

 

  • 备份数据库
  • =>db2 backup db
     


备份数据库=>db2 backup db

4) 在对数据库进行备份的时候,报57019错误。如:
Sql代码 :

 

  • =>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代码:

 

  • =>db2stop force
  • =>db2start
     


=>db2stop force=>db2start

5) 在对创建表空间的时候,报54047错误。如:
Sql代码

 

  • =>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

 

你可能感兴趣的:(db2,职场,错误,休闲)