【IBM DB2故障汇总】DB2常见错误及解决办法!

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:1043

IBM DB2常见错误及解决办法

转贴

1) 创建数据库的时候,报42704错误。如:
Sql代码

[list=1]
[*]=>[color=#7f0055]create [color=#7f0055]database test
[*]=>SQL0204N "SYSTEM_1386_US" [color=#7f0055]is an undefined [color=#7f0055]name. SQLSTATE=42704

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

解决办法:
Sql代码

[list=1]
[*]=>[color=#7f0055]create [color=#7f0055]database test using codeset gbk territory cn

=>create database test using codeset gbk territory cn

2) 在连接数据的时候,报57017错误。如:
Sql代码 [list=1]
[*]=>[color=#7f0055]connect [color=#7f0055]to test [color=#ff1493]user test using test
[*]=>SQL0332N [color=#7f0055]Character conversion [color=#7f0055]from the source code page "1386" [color=#7f0055]to the target code page "819" [color=#7f0055]is [color=#808080]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代码

[list=1]
[*]=>db2set db2codepage=1386

=>db2set db2codepage=1386

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

[list=1]
[*]=>db2 [color=#7f0055]drop [color=#7f0055]table t_base_acc_manageacc
[*]=>SQL0290N [color=#7f0055]Table [color=#ff1493]space access [color=#7f0055]is [color=#808080]not allowed. SQLSTATE=55039
[*]
[*]=>db2 list tablespaces show detail
[*]Tablespace ID = 2
[*][color=#7f0055]Name = USERSPACE1
[*]Type = System managed [color=#ff1493]space
[*]Contents = [color=#808080]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代码:

[list=1]
[*]备份数据库
[*]=>db2 backup db

备份数据库=>db2 backup db

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

[list=1]
[*]=>db2 backup [color=#7f0055]database dbname [color=#7f0055]to /xx/xx compress
[*]=>SQL1035N The [color=#7f0055]database [color=#7f0055]is currently [color=#808080]in use. SQLSTATE=57019

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

解决办法:

Sql代码:

[list=1]
[*]=>db2stop [color=#7f0055]force
[*]=>db2start

=>db2stop force=>db2start

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

[list=1]
[*]=>[color=#7f0055]create regular tablespace space1 pagesize 4 k managed [color=#7f0055]by [color=#7f0055]database using (device '/dev/dd' 25000000) prefetchsize automatic bufferpool bp1
[*]=>SQL1139N The total [color=#7f0055]size [color=#7f0055]of the [color=#7f0055]table [color=#ff1493]space [color=#7f0055]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

解决办法:
把表空间的大小改小点或者把regular(64G)换成large就ok了。

本文标签:
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】