Chinaunix首页 | 论坛 | 博客
  • 博客访问: 92607346
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-17 21:01:29

  来源:


 

10. 查看列

select SUBSTR(COLNAME,1,20) as 列名,TYPENAME as 类型,LENGTH as 长度

from columns

where tabname='ZJT_TABLES';

11. 查看表结构

db2 describe table user1.department

db2 describe select * from user.tables

12. 查看表的索引

db2 describe indexes for table user1.department

13. 查看视图

select viewname from views

where viewname='V_ZJT_TABLES';

14. 查看索引

select indname from indexes

where indname='I_ZTABLES_TABNAME';

15. 查看存贮过程

SELECT SUBSTR(PROCSCHEMA,1,15),SUBSTR(PROCNAME,1,15)

FROM SYSCAT.PROCEDURES;

16. 类型(cast)

ip datatype:varchar

select cast(ip as integer)+50 from log_comm_failed

17. 重新

connect reset

18. 中断数据库连接

disconnect db2_gcb

19. view application

LIST APPLICATION;

20. kill application

FORCE APPLICATION(0);

db2 force applications all (强迫所有程序从数据库断开)

21. lock table

lock table test in exclusive mode

22. 共享

lock table test in share mode

23. 显示当前用户所有表

list tables

24. 列出所有的系统表

list tables for system

 25. 显示当前数据库

list active databases

26. 查看命令选项

list command options

27. 系统数据库目录

LIST DATABASE DIRECTORY

28. 表空间

list tablespaces

29. 表空间容器

LIST TABLESPACE CONTAINERS FOR

Example: LIST TABLESPACE CONTAINERS FOR 1

30. 显示用户数据库的存取权限

GET AUTHORIZATIONS

31. 启动实例

DB2START

32. 停止实例

db2stop

阅读(668) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~