`
guoyanxi
  • 浏览: 272165 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

DB2 SMS tablespace 容器大小不等测试

    博客分类:
  • db2
阅读更多
看到官方文档有这句:
引用

When all space in a single container in an SMS table space is allocated to tables, the table space is considered full, even if space remains in other containers。
The SMS table space is full as soon as any one of its containers is full. Thus, it is important to have the same amount of space available to each container.


就是说,无论SMS有多少个容器,只有其中一个满了,就这个表空间都满了

测试:
--建立两个大小不一的文件系统
[root@localhost mnt]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/tmp/test1_s.img      4.9M   22K  4.6M   1% /mnt/test1_s
/tmp/test1_big.img    9.7M  1.1M  8.1M  12% /mnt/test1_big

--建立SMS表空间
db2 => create tablespace SMSFULLTEST managed by system USING ('/mnt/test1_s/','/mnt/test1_big/') 
DB20000I  The SQL command completed successfully.

--表空间信息
[db2inst2@localhost db2dump]$ db2pd -alldbs -tablespace 4

Database Partition 0 -- Database SAMPLE -- Active -- Up 0 days 00:46:48 -- Date 04/28/2011 04:20:45

Tablespace 4 Configuration:
Address    Type Content PageSz ExtentSz Auto Prefetch BufID BufIDDisk FSC NumCntrs MaxStripe  LastConsecPg Name
0x9D140B50 SMS  Regular 4096   32       Yes  64       1     1         Off 2        0          31           SMSFULLTEST

Tablespace 4 Statistics:
Address    TotalPgs   UsablePgs  UsedPgs    PndFreePgs FreePgs    HWM        Max HWM    State      MinRecTime NQuiescers PathsDropped
0x9D140B50 2308       2308       2308       0          0          0          0          0x00000000 1303934864 0          No          

Tablespace 4 Autoresize Statistics:
Address    AS  AR  InitSize    IncSize     IIP MaxSize     LastResize                 LRF
0x9D140B50 No  No  0           0           No  0                    None                       No  

Containers:
Address    ContainNum Type    TotalPgs   UseablePgs PathID     StripeSet  Container 
0x9D0EE960 0          Path    1155       1155       -          0          /mnt/test1_s
0x9D0EEB60 1          Path    1153       1153       -          0          /mnt/test1_big


--向里面塞入数据
db2 => create table SMSFULL1 as (select * from syscat.tables) definition only in SMSFULLTEST
DB20000I  The SQL command completed successfully.
db2 => insert into SMSFULL1 select * from syscat.tables
DB20000I  The SQL command completed successfully.
db2 => insert into SMSFULL1 select * from SMSFULL1
DB20000I  The SQL command completed successfully.
db2 => insert into SMSFULL1 select * from SMSFULL1
DB20000I  The SQL command completed successfully.

--省略

db2 => insert into SMSFULL1 select * from SMSFULL1
DB21034E  The command was processed as an SQL statement because it was not a 
valid Command Line Processor command.  During SQL processing it returned:
SQL0968C  The file system is full.  SQLSTATE=57011

--表空间很快满了

--文件系统情况,看到其中一个100%
[root@localhost test1_big]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/tmp/test1_s.img      4.9M  4.7M     0 100% /mnt/test1_s
/tmp/test1_big.img    9.7M  5.7M  3.6M  62% /mnt/test1_big


--再看看两个目录下的文件情况
[root@localhost test1_big]# du -sh *
4.6M    SQL00002.DAT
1.0K    SQLTAG.NAM
[root@localhost test1_big]# cd -
/mnt/test1_s
[root@localhost test1_s]# du -sh *
4.6M    SQL00002.DAT
8.0K    SQL00002.LB
8.0K    SQL00002.LBA
1.0K    SQLTAG.NAM

--可以看到SMS是平均的吧数据分配到每个容器当中




--附上diag log信息
2011-04-28-04.10.14.243363+480 E1389098G1271      LEVEL: Error (OS)
PID     : 7398                 TID  : 1983900560  PROC : db2sysc 0
INSTANCE: db2inst2             NODE : 000         DB   : SAMPLE
APPHDL  : 0-7620               APPID: *LOCAL.db2inst2.110427193357
AUTHID  : DB2INST2
EDUID   : 1453                 EDUNAME: db2agent (SAMPLE) 0
FUNCTION: DB2 UDB, oper system services, sqloseekwrite64, probe:40
MESSAGE : ZRC=0x850F000C=-2062614516=SQLO_DISK "Disk full."
          DIA8312C Disk was full.
CALLED  : OS, -, pwrite                           OSERR: ENOSPC (28)
DATA #1 : File handle, PD_TYPE_SQO_FILE_HDL, 8 bytes
  File Handle              = 26
  File System Block Size   = 1024 bytes
  File System Type         = ext3
  File Handle Flags :
    Require Sector Align   = No
    DIO/CIO Mode           = Yes
    Raw Block Device       = No
    Reserved Handle        = No
    Flush On Close         = No
    Thread-Level Lock      = No
    Write-through Mode     = Yes
    File Not Tracked       = Yes
DATA #2 : unsigned integer, 4 bytes
131072
DATA #3 : signed integer, 8 bytes
4718592
DATA #4 : signed integer, 4 bytes
-1
DATA #5 : String, 105 bytes
Search for ossError*Analysis probe point after this log entry for further
self-diagnosis of this problem.

2011-04-28-04.10.14.371039+480 I1390370G2589      LEVEL: Error (OS)
PID     : 7398                 TID  : 1983900560  PROC : db2sysc 0
INSTANCE: db2inst2             NODE : 000         DB   : SAMPLE
APPHDL  : 0-7620               APPID: *LOCAL.db2inst2.110427193357
AUTHID  : DB2INST2
EDUID   : 1453                 EDUNAME: db2agent (SAMPLE) 0
FUNCTION: DB2 Common, OSSe, ossErrorIOAnalysis, probe:100
CALLED  : OS, -, pwrite                           OSERR: ENOSPC (28)
DATA #1 : String, 146 bytes
A total of 5 analysis will be performed :
 - User info
 - ulimit info
 - Target file info
 - I/O attempt
 - File system

 Target file handle = 26
DATA #2 : String, 184 bytes
  Real user ID of current process       = 503
  Effective user ID of current process  = 503
  Real group ID of current process      = 500
  Effective group ID of current process = 500
DATA #3 : String, 370 bytes
Current process limits (unit in bytes except for nofiles) :
  mem     (S/H) = unlimited / unlimited
  core    (S/H) = unlimited / unlimited
  cpu     (S/H) = unlimited / unlimited
  data    (S/H) = unlimited / unlimited
  fsize   (S/H) = unlimited / unlimited
  nofiles (S/H) = 65534 / 65534
  stack   (S/H) = 10485760 / unlimited
  rss     (S/H) = unlimited / unlimited
DATA #4 : String, 260 bytes
Target File Information :
  Size               = 4718592
  Link               = No
  Reference path     = N/A
  Type               = 0x8000
  Permissions        = rw-------
  UID                = 503
  GID                = 500
  Last modified time = 1303935014
  DATA #5 : String, 33 bytes
I/O attempt not implemented yet.
DATA #6 : String, 372 bytes
File System Information of the target file :
  Block size        = 1024 bytes
  Total size        = 5073920 bytes
  Free size         = 0 bytes
  Total # of inodes = 1280
  FS name           = /dev/loop0
  Mount point       = /mnt/test1_s
  FSID              = 1792
  FS type name      = ext2
  DIO/CIO mount opt = None
  Device type       = N/A
  FS type           = 0xe
CALLSTCK:
  [0] 0xB322C481 /home/db2inst2/sqllib/lib32/libdb2osse.so.1 + 0xB8481
  [1] 0xB322C3B5 ossLogSysRC + 0x97
  [2] 0xB321E6D9 /home/db2inst2/sqllib/lib32/libdb2osse.so.1 + 0xAA6D9
  [3] 0xB321D1D8 ossErrorAnalysis + 0x28
  [4] 0xB5D48928 sqloSystemErrorHandler + 0x61C
  [5] 0xB4AB5E29 sqloseekwrite64 + 0x46B
  [6] 0xB4AB578C sqloWriteBlocks + 0xBC
  [7] 0xB466AB72 _Z15sqlbWriteBlocksP16SqlbOpenFileInfoPvxjjPjP12SQLB_GLOBALS + 0x40
  [8] 0xB51149C0 _Z18sqlbSMSDirectWriteP20SQLB_DIRECT_WRITE_CB + 0x284
  [9] 0xB515DB15 _Z15sqlbDirectWriteP20SQLB_DIRECT_WRITE_CB + 0x109

2011-04-28-04.10.14.376525+480 E1392960G804       LEVEL: Error
PID     : 7398                 TID  : 1983900560  PROC : db2sysc 0
INSTANCE: db2inst2             NODE : 000         DB   : SAMPLE
APPHDL  : 0-7620               APPID: *LOCAL.db2inst2.110427193357
AUTHID  : DB2INST2
EDUID   : 1453                 EDUNAME: db2agent (SAMPLE) 0
FUNCTION: DB2 UDB, buffer pool services, sqlbSMSDirectWrite, probe:99
MESSAGE : ADM6017E  The table space "SMSFULLTEST" (ID "4") is full. Detected on
          container "/mnt/test1_s" (ID "0").  The underlying file system is
          full or the maximum allowed space usage for the file system has been
          reached. It is also possible that there are user limits in place with
          respect to maximum file size and these limits have been reached.

2011-04-28-04.10.14.377416+480 I1393765G505       LEVEL: Error
PID     : 7398                 TID  : 1983900560  PROC : db2sysc 0
INSTANCE: db2inst2             NODE : 000         DB   : SAMPLE
APPHDL  : 0-7620               APPID: *LOCAL.db2inst2.110427193357
AUTHID  : DB2INST2
EDUID   : 1453                 EDUNAME: db2agent (SAMPLE) 0
FUNCTION: DB2 UDB, buffer pool services, sqlbSMSDirectWrite, probe:825
MESSAGE : ZRC=0x850F000C=-2062614516=SQLO_DISK "Disk full."
          DIA8312C Disk was full.
分享到:
评论

相关推荐

    db2表空间不足及处理

    检查db2表空间是否不足已经处理的方法,具体怎么查看表空间是否已经被占满已经具体的解决方法在文档中都有说明。。

    CREATE TABLESPACE命令详解

    CREATE TABLESPACE命令详解 CREATE TABLESPACE命令详解

    DB2学习笔记

    * 创建表空间:db2 CREATE REGULAR TABLESPACE tp_name PAGESIZE 4K MANAGED BY AUTOMATIC STORAGE BUFFERPOOL bp_name * 授予表空间权限:GRANT U 本学习笔记旨在帮助用户快速掌握 DB2 的基本操作命令和概念,但这...

    Linux系统重启db2数据库命令实例详解.docx

    db2stop 查看数据库:db2 list db directory 查看数据库应用:db2 list applications 查看数据库应用和进程号:db2 list applications show detail 查看数据库表空间:db2pd -db <db_name> -tablespace 查看数据库...

    Mysql innodb tablespace 表空间实践

    Mysql innodb tablespace 表空间实践

    DB2常用语句

    修改数据库参数,查看当前数据库表空间分配状况,查看tablespace id=2使用容器所在目录,列出所有活动的数据库,列出当前数据库下所有的表,列出当前数据库中schema为btp的表,查看数据库字符集。

    Oracle_create_tablespace语法详解.docx

    Oracle Create Tablespace 语法详解 本文将对 Oracle Create Tablespace 语法进行详细的解释和分析,从 undo 表空间到表空间的创建,DATAFILE 的设置,MININUM EXTENT,BLOCKSIZE,logging clause,FORCE LOGGING,...

    rlv方式增加oracle tablespace datafile

    rlv方式增加oracle tablespace datafile

    db2创建数据库实例

    CREATE DATABASE "iufo" ON '/home/db2inst1' ALIAS "iufo" USING CODESET GBK TERRITORY CN COLLATE USING System NUMSEGS 1 DFT_EXTENT_SZ 32 CATALOG TABLESPACE MANAGED BY SYSTEM USING('/home/db2inst1/...

    Linux系统怎么用命令重启db2数据库.docx

    db2 list db directory 查看数据库应用:db2 list applications 查看数据库应用和进程号:db2 list applications show detail 查看数据库表空间:db2pd -db -tablespace 查看数据库配置:db2 get db cfg for 连接...

    DB2数据库搭建记录(AIX).

    DB2数据库搭建记录(AIX). 1 初始化DB2环境变量 # su - db2inst1 $ cd sqllib $ . ./db2profile 2 创建数据库 db2 create db dzht alias dzht using codeset GBK territory CN 3 创建缓冲池 CREATE BUFFERPOOL ...

    Db2_SQL命令大全(完整版)

    DB2/SQL命令大全 连接数据库:  connect to [数据库名] user [操作用户名] using [密码] 创建缓冲池(8K):  create bufferpool ibmdefault8k IMMEDIATE SIZE 5000 PAGESIZE 8 K ; 创建缓冲池(16K)(OA_...

    1tablespace.sql

    1tablespace.sql

    CREATE TABLESPACE

    CREATE TABLESPACECREATE TABLESPACECREATE TABLESPACECREATE TABLESPACECREATE TABLESPACE

    RMAN测试演练即讲解

    RMAN学习测试整理1 20121219 by Apollo 一、 Oracle数据库的备份分为物理备份和逻辑备份。今天测试整理下物理备份Rman,也就是oracle的恢复管理器(Recovery Manager)。 毕竟逻辑备份是不能实现时间点恢复的,所以...

    oracle tablespace usage

    oracle tablespace usage

    get_tablespace_usage.sh

    get_tablespace_usage.sh

    查看表空间大小及已经使用的百分比

    查看表空间大小及已经使用的百分比 复制代码 select a.tablespace_name,a.bytes/1024/1024 "Sum MB",  (a.bytes-b.bytes)/1024/1024 "used MB",  b.bytes/1024/1024 "free MB",  round(((a.bytes-b.bytes)/a....

    DB2 内部培训(V1.0)

    2.2 增加tablespace的空间大小....................................................................................3 2.3 DMS和SMS表空间简介..................................................................

    Oracle_tablespace_(表空间)的创建、删除、修改、扩展及检查等

    Oracle 表空间(tablespace)的创建、删除、修改、扩展及检查等 Oracle 表空间是 Oracle 数据库中的一种逻辑存储结构,它决定数据库实体的空间分配、设置数据库用户的空间份额、控制数据库部分数据的可用性、分布...

Global site tag (gtag.js) - Google Analytics