六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 59|回复: 0

db2常用命令

[复制链接]

升级  82%

140

主题

140

主题

140

主题

举人

Rank: 3Rank: 3

积分
446
 楼主| 发表于 2013-1-13 18:56:00 | 显示全部楼层 |阅读模式
1. 如何快速清除一个大表
    ALTER TABLE TABLE_NAME ACTIVE NOT LOGGED INITALLY WITH EMPTY TABLE

2. 如何查看存储过程
    SELECT * FROM SYSCAT.PROCEDURES

3. 导出数据
   export to c:\user.ixf of ixf select * from user

4. 缓冲区关联
  create bufferpool size [pagesize 4096] {[not] EXTENDED STORAGE}
  alter bufferpool size {[not] EXTENDED STORAGE}
  drop bufferpool

   如果缓冲区大小设置为-1 表示缓冲池的页面数目由数据库配置参数buffpage 决定
   注意:数据库配置参数buffpage仅对缓冲区大小设置为 -1 的缓冲池起作用。

5. 如何快速清除一个大表
   ALTER TABLE TABLE_NAME ACTIVE NOT LOGGED INITALLY WITH EMPTY TABLE

6. terminate 退出db2 consol。

7.  查看表结构:
    describe select * from student

8.  查看外键
    select * from syscat.references ;

9. 删除外键
    alter table student
      drop CONSTRAINT  SQL090115130135660


10.查看表结构
    describe select * from test

11. 查看索引
    describe indexes for table test

12. 所有的表
    select * from syscat.tables

13.模式下所有的表
    list tables for schema xx;

14. list application
    list application show detail

15. force applications all
    kill application(handle)

16.显示当前活动数据库
    list active databases
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表