DB2数据库命令.doc

DB2数据库命令

DB2数据库命令 db2 表空间 状态 DB2_DBA的注意事项 作者:互联网 来源:互联网 点击数:298 更新时间:2010年08月03日   activate database dbname 显式地激活数据库.   deactivate database dbname 显式地使数据库失效.   用crontab,比如:   25 8 13 2 0 /home/vincent/poweroff   8:25 2月13日 星期日   C:\Program Files\FileZilla Client\resources\cyril\32x32\   3: /home/sybiq/data/irs/etlain.log:查看表空间情况   怎么查看哪张表被锁住了?   db2 update monitor switches using lock on   get snapshot for locks on 库   1,打开监控窗口   db2 update monitor switches using lock on   2,运行程序一段时间后   db2 get snapshot for locks on 数据库名称   即可查看到当前所有连接到该数据库的应用程序句柄,同时每一个连接下锁定的情况   ================================================== =========================   1. 启动实例(db2inst1):   db2start   2. 停止实例(db2inst1):   db2stop   3. 列出所有实例(db2inst1)   db2 list   5.列出当前实例:   db2 get instance   4. 察看示例配置文件:   db2 get dbm cfg|more   5. 更新数据库管理器参数信息:   db2 update dbm cfg using para_name para_value   6. 创建数据库:   db2 create db test   7. 察看数据库配置参数信息   db2 get db cfg for test|more   8. 更新数据库参数配置信息   db2 update db cfg for test using para_name para_value   10.删除数据库:   db2 drop db test   11.连接数据库   db2 connect to test   11.列出所有表空间的详细信息.   db2 list tablespaces show detail   12.列出容器的信息   db2 list tablespace containers for dbname show detail   13.创建表:   db2 ceate table tbname(id integer not null,name char(10))   14.列出所有表   db2 list tables   12.插入数据:   db2 insert into tb1 values(1,’sam’);   db2 insert into tb2 values(2,’smitty’);   13.查询数据:   db2 select * from tb1   14.数据:   db2 delete from tb1 where id=1   15.创建索引:   db2 create index idx1 on tb1(id);   16.创建视图:   db2 create view view1 as select id from tb1   17.查询视图:   db2 select * from view1   18.节点编目   db2 catalog tcpip node node_name remote server_ip server server_port   19.察看端口号   db2 get dbm cfg|grep SVCENAME   20.测试节点的附接   db2 attach to node_name   21.察看本地节点   db2 list node direcotry   22.节点反编目   db2 uncatalog node node_name   db2 uncatalog node NODE193   db2 catalog tcp

文档评论(0)

1亿VIP精品文档

相关文档