- 浏览: 275680 次
- 性别:
- 来自: 广州
最新评论
-
Yiwu_zh:
步骤清晰,跟着来做,真搭建好了
不过用的是10.5版本,输出有 ...
搭建简单的DB2 HADR -
luogen33:
db2备份单个表 -
gthao:
1 楼正解。。如果schema里面有内容的话,就删除不了,会报 ...
db2建立schema -
znttql:
整理的太好了 非常感谢啊
DB2 日期 时间 -
alvin198761:
能根据schame备份数据库不??
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有多少个容器,只有其中一个满了,就这个表空间都满了
测试:
引用
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 redirect restore
2012-08-17 15:57 2804same machine online backup incl ... -
DB2删除冗余备份
2011-12-21 18:59 4364对于装在虚拟机上面的测试机,归档日志等备份文件往往会因为疏于管 ... -
DB2 DPF 测试环境搭建
2011-11-23 17:20 5840克服了无数小问题后,终于搭建起来测试环境了 总的教程: htt ... -
DB2 日期 时间
2011-10-27 13:46 6622/****************************** ... -
SQLSTAT -964 导致apply失败
2011-10-09 21:51 2334环境: apply运行在非target数据库上面 appl ... -
搭建简单的DB2 HADR
2011-09-17 09:52 2095简单的HADR,只用一台虚拟机,两个实例间搭建。工作量不大,一 ... -
TSM RC=0x0000006A=106
2011-09-02 23:40 1430DB2归档日志没有被TSM备份 a3inr2fb@b03c ... -
db2ilist不显示实例列表
2011-08-08 18:29 2851https://www-304.ibm.com/support ... -
更改DB2实例的fence用户的两种方法
2011-07-27 21:23 4812碰到有个DB2的实例居然实例用户和fence用户是一样的 做了 ... -
HWM小测
2011-07-12 17:16 0HWM是oracle和DB2都有的概念,概念很简单,测试一下 ... -
db2查找执行次数最多的sql
2011-06-23 21:50 3582用此方法同时能够得到cost最大的语句 --首先抓取sn ... -
migrate from win to linux(遇到的问题)
2011-06-15 21:30 2807之前写过一篇在自己虚拟机简单测试的步骤 http://guoy ... -
db2 错误查询
2011-06-14 19:00 2509关键字:DB2 SQLCODE 查看 在DB2数据库中执行S ... -
db2 恢复误删表
2011-06-03 19:02 5270oracle如果误删了表,可以很方便的flash back 最 ... -
migrate from win to linux(简单版)
2011-05-24 16:13 2172本文讲述最简单的从windows到linux的db2迁移 1. ... -
安装db2 fix pack
2011-04-20 21:45 41711.停数据库 [root@localhost univer ... -
db2 express-c 不支持fixpack
2011-04-20 20:31 1398要真的升级,就只能重装db2软件了 [root@local ... -
linux下unstalling db2
2011-04-20 17:26 1748由于enterprise版本又到期了,又不想改系统日期,所以重 ... -
被问到的问题,导出DDL(DB2)
2011-04-15 20:41 896Generate the DDL statements for ... -
与数据库同时建立的文件
2011-03-19 16:27 1055db2rhist.asc This file cont ...
相关推荐
- 可以通过`AUTORESIZE YES`参数让系统自动扩展容器大小,以便在需要时增加表空间的空间。 如果重定向恢复方法一不可行,还可以尝试方法二,直接在`RESTORE DATABASE`命令中指定新的数据库路径和存储文件路径。 总...
"DB2表空间不足及处理" DB2表空间不足是指数据库中可用空间不足,以致影响数据库的正常运行。在本文中,我们将介绍如何检查DB2表空间是否不足,以及如何处理这种情况。 什么是DB2表空间? 在DB2中,表空间是指...
使用`CREATE TABLESPACE`语句可以创建新表空间,指定类型(REGULAR、TEMPORARY或LARGE)、管理方式(SMS或DMS)、页面大小、预取大小、缓冲池以及I/O相关参数。创建SMS表空间时,需指定作为容器的路径名,而DMS表...
db2 "CREATE SYSTEM TEMPORARY TABLESPACE <表空间名> PAGESIZE <页面大小> MANAGED BY DATABASE USING (FILE '<文件路径>' <初始大小>) BUFFERPOOL IBMDEFAULTBP" ``` - **用户临时表空间**: ```sql db2 "CREATE...
3. **表空间管理**:`db2 create tablespace`创建表空间,用于存储数据库对象,`db2 alter tablespace`和`db2 drop tablespace`分别用于修改和删除表空间。 4. **用户和权限**:`db2 create user`创建数据库用户,`...
3. 创建库:使用以下命令创建库:`db2 create tablespace` Windows 安装步骤 4.1 解压数据库安装包 在 Windows 操作系统上安装 DB2 数据库 V9.7 需要按照以下步骤进行: 1. 解压数据库安装包:将 DB2 数据库安装...
根据管理方式的不同,DB2中的表空间主要分为两种类型:系统管理空间(System Management Space, SMS)与数据库管理空间(Database Management Space, DMS)。这两种表空间在创建、使用以及管理上存在一定的差异。 #### ...
- `db2CREATE REGULAR TABLESPACE ...` 创建表空间,指定页大小、管理方式、容器路径等参数。 - `db2BACKUP DATABASE 数据库别名 TABLESPACE 表空间名 ONLINE TO 介质名` 对表空间进行在线备份。 - `db2list ...
- `ALTER TABLESPACE` 用于调整表空间的大小或扩展已满的容器。 6. **数据库管理**: - `db2 CREATE db` 创建新的数据库。 - `db2 DROP db` 删除数据库。 - `db2 list db directory` 显示所有数据库的目录信息...
DB2中的表空间是用来存储表的数据和索引的逻辑容器。创建表空间的基本语法如下: ```sql CREATE TABLESPACE [表空间名称] IN DATABASE PARTITION GROUP [分区组] PAGESIZE [页面大小] MANAGED BY SYSTEM USING ('/...
* 创建数据库:#db2 create db 数据库名 alias 数据库别名 using codeset 字符集名 territory 语言环境名 pagesize 数据页大小 restrictive catalog tablespace managed by database using (file '路径文件名' 表...
- **步骤三**:使用`SET TABLESPACE CONTAINERS FOR`命令更新表空间容器的信息,将表空间指向新的物理位置。例如: ```sql db2 SET TABLESPACE CONTAINERS FOR 0 USING (path 'D:\DB2\NODE0000\FLM\T0000000') ...
- `$db2 list tablespace containers for 5 show detail`:列出 ID 为 5 的表空间容器详细信息。 ### 七、备份历史记录查询 - **查询备份历史记录:** - `$db2 list history backup all for dcold`:列出针对...
删除SMS表空间使用`DROP TABLESPACE`命令,但需要注意的是,这只会从DB2注册表中移除表空间,实际的磁盘文件需要手动删除。 DMS表空间的创建需要指定文件或设备,如下例所示: ```sql CREATE TABLESPACE RESOURCE ...
运行`db2sampl`命令来建立一个测试数据库,验证DB2 v9.1的安装配置是否正确。 #### 使用裸设备作为表空间 若计划使用裸设备存储表空间数据,需先创建裸设备并调整其属主与组权限,如`/dev/rdb2_data01`等,然后...
首先,DB2 中的基本架构由实例(Instance)、数据库(Database)、表空间(TableSpace)和容器(Container)组成。实例是DB2运行的逻辑单元,可以在同一操作系统上运行多个实例,每个实例都有自己的独立系统编目表。数据库则...
db2set tablespace containers for <tablespace_id> using ('<new_path>') ``` 其中`<tablespace_id>`是需要修改的表空间ID,`<new_path>`是新的物理路径。 ### 总结 DB2的数据库恢复不仅仅是一项技术操作,更是...
13. **列出容器的信息**:`db2 list tablespace containers for tbs_id show detail` 查看指定表空间`tbs_id`的容器详情。 14. **创建表**:`db2 create table tb1(id integer not null, name char(10))` 创建名为`...