DB2表空间扩容

1 - Detect what tablespace has size issues

db2 list tablespaces show detail

2 - Check the percentage of use from the tablespace


db2 list tablespace containers for <tablespace_id>  show detail

3 - Calculating the size of free space needed

Now you are able to calculate the percentage of use from the tablespace. To get this number, do (Used Pages / Useable Pages) * 100 and then with this percentage you can continue calculating how many pages you need to increase to obtain the acceptable amount of free pages.

4 - Verifying the filesystem and the free space

Continuing, now you should check the total amount of free space at the fileystem. Do this typing

df -k <tablespace.path>

And you'll be able to verify if it's enough space to extend the tablespace. Remember you can check the page size in the output of "db2 list tablespaces show detail" command.

5 - Extending the tablespace

Finally, after all checked, you can execute the command to extend the pages of that tablespace. Do this using:

db2 "alter tablespace <tablespace_name> extend (all <page_numbers>)"

This will extend the size of your tablespace. Be careful when using EXTEND ALL clause when the tablespace has more than one container; in cases where the tablespace has more than one container, divide the total number of pages you intent to increase by the number of total containers.

Example:

db2 alter "tablespace IBMDB2SAMPLEREL extend (all 1000)"

Alternatively, if it's not possible to extend the actual containers, a possibility is to add new containers to the tablespace. For that, you should enter the following command:

db2 "alter tablespace <tablespace_name> add (FILE '<new_container_file>' <size>)"

Where size can be in pages (only using the numbers you want), in KBytes (using a K following the number), in MBytes (using a M following the number) or in GBytes (using a G following the number). Also, please note to use single quotes around the name of the file you'll use as a new container.

注意事项:(AIX)

1、hacmp 单点控制的lv操作,有时候出问题,建议在A 机直接扩lv, 在hacmp 切换到B机 hacmp自动importvg 会把lv 信息更新的。

2、扩容操作选择业务空闲时间进行,避免影响正常业务系统操作。

3、扩容前后确认数据库状态是否正常,日志有无报错,系统资源使用率是否正常,无异常报错。

4、表空间扩充还可以通过添加新容器或者改变当前容器大小两种方式来实现,加容器之后DB2会有一个自动balance的过程,可能会持续几个小时,而通过改变容器大小的方式不会触发balance,但如果表空间建立在裸设备上,则要扩冲裸设备空间。

db2 表空间扩容的更多相关文章

  1. db2 表空间容量

    Db2 connect to xxx Db2 “LIST TABLESPACES SHOW DETAIL” Tablespace ID = 7 Name = TSASNAA Type = Databa ...

  2. db2表空间及日志文件调整

    1.SQLState '57011' and errorCode '-964'  原因:数据库的日志文件已满  解决方法:修改日志文件大小(加大),增加日志文件个数,增加辅助日志文件个数(三个修改参数 ...

  3. DB2 表空间监控

    默认DB2 缓冲池信息监控是OFF, 需要开启(DB2表空间是由缓冲池分配的) CollBufferpool : ============ The CollBufferpool collector c ...

  4. oracle表空间扩容

    oracle在使用中会发现,表空间不足的情况:以下介绍了如何1.查询表空间使用率.剩余量:2.如何扩展表空间容量: 1.表空间容量指标查询 SELECT TABLESPACE_NAME "表 ...

  5. MySQL共享表空间扩容

    一.什么是共享表空间和独占表空间 共享表空间以及独占表空间都是针对数据的存储方式而言的. 共享表空间: 某一个数据库的所有的表数据,索引文件全部放在一个文件中,默认这个共享表空间的文件路径在data目 ...

  6. Oracle 表空间扩容

    1 系统表空间扩容 注:表空间监测或扩容方式很多,这里只提供一种方便使用的方法 1)查询SQL 注:需要输入百分比,如:90,就可查出使用率超过90%的表空间, with t as (select b ...

  7. oracle ORA-00060死锁查询、表空间扩容

    --查看被锁住的表 select b.owner,b.object_name,a.session_id,a.locked_mode from v$locked_object a,dba_objects ...

  8. oracle数据库表空间扩容方法

    1. 先查询表空间在物理磁盘上存放的位置,注意使用sysdba的账号登陆. SELECT tablespace_name, file_id, file_name, ), ) total_space F ...

  9. DB2 表空间和缓冲池

    简介 对于刚涉足 DB2 领域的 DBA 或未来的 DBA 而言,新数据库的设计和性能选择可能会很令人困惑.在本文中,我们将讨论 DBA 要做出重要选择的两个方面:表空间和缓冲池.表空间和缓冲池的设计 ...

随机推荐

  1. stingray中使用angularjs

    引入angularjs 手动启用angularjs 不使用ng-app, 在所有模块和controller定义后挂载启用angularjs function OnLoad() { scroll(0, ...

  2. 深入理解JS执行细节(写的很精辟)

    来源于:http://www.cnblogs.com/onepixel/p/5090799.html javascript从定义到执行,JS引擎在实现层做了很多初始化工作,因此在学习JS引擎工作机制之 ...

  3. Qt下多线程日之类

    刚google到了,晚上回去试一下! 代码地址 https://gitorious.org/cutelogger/cutelogger/source/e3c2745c6c5f38896f87472e0 ...

  4. mysql中TIMESTAMP设置默认时间为当前时间

    在我们保存数据进入到数据库中时多半会使用像php之类的脚本来获取一个时间保存到mysql中,其实在mysql可以直接使用TIMESTAMP 数据类型来实现默认类型了,下面一起来看看.   很多时候,为 ...

  5. easyui confirm提示框 调整显示位置

    方法一: $.messager.confirm("确认对话框","该客户已经存在!确定:查看该客户 ", function(r){ if(r){ alert(& ...

  6. export / import 温故而知新

    认知一: 导出的对象被修改,依然会影响原来的对象. 仔细想想这是理所当然的事(说明导出的依然是对象指向内存的地址,所以通常还需要结合深拷贝使用) /** export const state = { ...

  7. Atitit.mysql 5.0 5.5  5.6 5.7  新特性 新功能

    Atitit.mysql 5.0 5.5  5.6 5.7  新特性 新功能 1. MySQL  5.6    5 大新特性1 1.1. 优化器的改进1 1.2. InnoDB 改进1 1.3. 使用 ...

  8. [k8s]k8s-ceph-statefulsets-storageclass-nfs 有状态应用布署实践

    k8s stateful sets storageclass 有状态应用布署实践v2 Copyright 2017-05-22 xiaogang(172826370@qq.com) 参考 由于网上的文 ...

  9. Android Studio Prettify 插件

    1.功能:能够一键声明layout文件中的所有注明id的控件,节省时间 2.github地址 https://github.com/Haehnchen/idea-android-studio-plug ...

  10. 物联网架构成长之路(3)-EMQ消息服务器了解

    1. 了解 物联网最基础的就是通信了.通信协议,物联网协议好像有那么几个,以前各个协议都有优劣,最近一段时间,好像各大厂商都采用MQTT协议,所以我也不例外,不搞特殊,采用MQTT协议,选定了协议,接 ...