zoukankan      html  css  js  c++  java
  • db2 表空间扩容

    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,但如果表空间建立在裸设备上,则要扩冲裸设备空间。

  • 相关阅读:
    阿里云ECS linux通过rinetd 端口转发来访问内网服务
    阿里云ECS linux通过iptables 配置SNAT代理网关,实现局域网上网
    适用于CentOS6.x系统的15项优化脚本
    ELK学习笔记
    MAC OSX环境下cordova+Ionic的安装配置
    Windows下 VM12虚拟机安装OS X 10.11 和VM TOOLS
    cordova 下载更新
    android adb常用命令
    ionic实现双击返回键退出功能
    ionic ngCordova插件安装
  • 原文地址:https://www.cnblogs.com/dahaoran/p/9254763.html
Copyright © 2011-2022 走看看