免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 8170 | 回复: 8
打印 上一主题 下一主题

请教:关于SQL0286N [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-08-17 10:40 |只看该作者 |倒序浏览
我在创建数据库表的时候报了如下的错误
DB21034E  The command was processed as an SQL statement because it was not a valid Command Line Processor command.  During SQL processing it returned:
SQL0286N  A default table space could not be found with a page size of at least "8192" that authorization ID "DB2INST1" is authorized to use.SQLSTATE=42727
应该是默认表空间不足吧?
我的创建数据库的语句是这样的
create database dbtest USING CODESET GBK TERRITORY CN
USER TABLESPACE MANAGED BY SYSTEM USING ('/home/db2inst1/tabspace1' )
数据库已经创建成功了。可是就是没有办法建表,我的那个表有很多字段,应该怎么做?

论坛徽章:
0
2 [报告]
发表于 2004-08-18 02:40 |只看该作者

请教:关于SQL0286N

能不能看一下你的建表语句和你的"list tablespaces show detail"输出!

论坛徽章:
0
3 [报告]
发表于 2004-08-18 09:35 |只看该作者

请教:关于SQL0286N

建表语句太大了,不好贴,大概有300个字段的样子吧
db2 list tablespaces show detail

           Tablespaces for Current Database

Tablespace ID                        = 0
Name                                 = SYSCATSPACE
Type                                 = System managed space
Contents                             = Any data
State                                = 0x0000
   Detailed explanation:
     Normal
Total pages                          = 1609
Useable pages                        = 1609
Used pages                           = 1609
Free pages                           = Not applicable
High water mark (pages)              = Not applicable
Page size (bytes)                    = 4096
Extent size (pages)                  = 32
Prefetch size (pages)                = 32
Number of containers                 = 1

Tablespace ID                        = 1
Name                                 = TEMPSPACE1
Type                                 = System managed space
Contents                             = System Temporary data
State                                = 0x0000
   Detailed explanation:
     Normal
Total pages                          = 1
Useable pages                        = 1
Used pages                           = 1
Free pages                           = Not applicable
High water mark (pages)              = Not applicable
Page size (bytes)                    = 4096
Extent size (pages)                  = 32
Prefetch size (pages)                = 32
Number of containers                 = 1

Tablespace ID                        = 2
Name                                 = USERSPACE1
Type                                 = System managed space
Contents                             = Any data
State                                = 0x0000
   Detailed explanation:
     Normal
Total pages                          = 1
Useable pages                        = 1
Used pages                           = 1
Free pages                           = Not applicable
High water mark (pages)              = Not applicable
Page size (bytes)                    = 4096
Extent size (pages)                  = 32
Prefetch size (pages)                = 32
Number of containers                 = 1

论坛徽章:
0
4 [报告]
发表于 2004-08-19 09:11 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
5 [报告]
发表于 2004-08-19 16:12 |只看该作者

请教:关于SQL0286N

原帖由 "oprs"]字段太多,超出了默认页大小4k的限制,[/color 发表:


你可以新建个页大小为8k的userspace2表空间,将这个表建立在userspace2上

create table (.......) in userspace2



偶测试了一下,这个提示好像是sql0670,不过这个解决方法应该是正确的!

SQL0670N The row length of the table exceeded a limit of
          "<length>;" bytes.  (Table space
          "<tablespace-name>;".)

Explanation:  The row length of a table in the database manager
cannot exceed:

o   4005 bytes in a table space with a 4K page size

o   8101 bytes in a table space with an 8K page size

o   16293 bytes in a table space with an 16K page size

o   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.  

One of the following conditions can occur:

o   The row length for the table defined in the CREATE TABLE or   
    ALTER TABLE statement exceeds the limit for the page size of  
    the table space.  The regular table space name               
    "<tablespace-name>;" identifies the table space from     
    which the page size was used to determine the limit on the   
    row length.  

o   The row length for the table defined in the DECLARE GLOBAL   
    TEMPORARY TABLE statement exceeds the limit for the page size
    of the table space.  The user temporary table space name      
    "<tablespace-name>;" identifies the table space from     
    which the page size was used to determine the limit on the   
    row length.  



The statement cannot be processed.  

User Response:  Depending on the cause, do one of the following.  

o   In the case of CREATE TABLE, ALTER TABLE, or DECLARE GLOBAL   
    TEMPORARY TABLE, specify a table space with a larger pagesize,
     if possible.  

o   Otherwise, reduce the row length by eliminating one or more   
    columns or reducing the lengths of one or more columns.  



sqlcode:  -670

sqlstate:  54010

论坛徽章:
0
6 [报告]
发表于 2004-08-19 17:18 |只看该作者

请教:关于SQL0286N

page size最大可以到32k,考虑一下表的数据容量,最大512GB。

论坛徽章:
0
7 [报告]
发表于 2009-01-19 16:32 |只看该作者
db2 =>  list tablespaces show detail;

           Tablespaces for Current Database

Tablespace ID                        = 0
Name                                 = SYSCATSPACE
Type                                 = Database managed space
Contents                             = All permanent data. Regular table space.
State                                = 0x0000
   Detailed explanation:
     Normal
Total pages                          = 16384
Useable pages                        = 16380
Used pages                           = 10704
Free pages                           = 5676
High water mark (pages)              = 10704
Page size (bytes)                    = 4096
Extent size (pages)                  = 4
Prefetch size (pages)                = 4
Number of containers                 = 1

Tablespace ID                        = 1
Name                                 = TEMPSPACE1
Type                                 = System managed space
Contents                             = System Temporary data
State                                = 0x0000
   Detailed explanation:
     Normal
Total pages                          = 1
Useable pages                        = 1
Used pages                           = 1
Free pages                           = Not applicable
High water mark (pages)              = Not applicable
Page size (bytes)                    = 4096
Extent size (pages)                  = 32
Prefetch size (pages)                = 32
Number of containers                 = 1

Tablespace ID                        = 2
Name                                 = USERSPACE1
Type                                 = Database managed space
Contents                             = All permanent data. Large table space.
State                                = 0x0000
   Detailed explanation:
     Normal
Total pages                          = 8192
Useable pages                        = 8160
Used pages                           = 3168
Free pages                           = 4992
High water mark (pages)              = 3296
Page size (bytes)                    = 4096
Extent size (pages)                  = 32
Prefetch size (pages)                = 32
Number of containers                 = 1

Tablespace ID                        = 3
Name                                 = SYSTOOLSPACE
Type                                 = Database managed space
Contents                             = All permanent data. Large table space.
State                                = 0x0000
   Detailed explanation:
     Normal
Total pages                          = 8192
Useable pages                        = 8188
Used pages                           = 152
Free pages                           = 8036
High water mark (pages)              = 152
Page size (bytes)                    = 4096
Extent size (pages)                  = 4
Prefetch size (pages)                = 4
Number of containers                 = 1

db2 =>
db2 => CREATE TABLE user_secret_question
(
  id bigint NOT NULL,
  question varchar(1000) NOT NULL,
  answer varchar(10000) NOT NULL,
  owner  bigint NOT NULL,
  CONSTRAINT user_secret_question_pkey PRIMARY KEY (id)
);db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) =>
DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0286N  A default table space could not be found with a page size of at
least "16384" that authorization ID "MACAN" is authorized to use.
SQLSTATE=42727
db2 =>

我可以通过扩展来扩展USERSPACE1来达到目的么?
如何设置USERSPACE1使得它可以自动增长呢?

论坛徽章:
0
8 [报告]
发表于 2009-01-19 22:58 |只看该作者
你表空间的page size 全是4K的,建一个page size 32K的表空间,然后在上面建表

论坛徽章:
0
9 [报告]
发表于 2009-01-20 15:45 |只看该作者
可以扩展当前这个USERSPACE1的page size呢?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP