DB2常用命令
Posted enet01
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了DB2常用命令相关的知识,希望对你有一定的参考价值。
★★创建数据库:EDMPDB 和SHAREDB
db2 create database EDMPDB using codeset UTF-8 territory cn [pagesize 8192]
db2 connect to EDMPDB
db2 create bufferpool bp32k size 1000 pagesize 32k
db2 create system temporary tablespace tempts32k pagesize 32k bufferpool bp32k
db2 create database SHAREDB using codeset UTF-8 territory cn [pagesize 8192]
db2 connect to SHAREDB
db2 create bufferpool bp32k size 1000 pagesize 32k
db2 create system temporary tablespace tempts32k pagesize 32k bufferpool bp32k
★★执行sql脚本
db2 connect to dbname
db2 -tvf *.sql //执行sql脚本
1 db2start
2 db2 catalog database zdb on /dbdata/sjzx
3 db2 connect to zdb
5 db2stop
7 db2 connect to zdb
13 db2 connect to zdb
16 db2 list tables
17 db2 drop zdb
18 db2 drop database zdb
19 db2 list tables
21 db2 list databases;
22 db2stop
24 db2 deactivate database
25 db2 deactivate database zdb
27 db2stop
29 db2start
30 db2 list active databases
31 db2 connect to zdb
32 db2 list active databases
37 db2status
40 db2start
41 db2 list active databases
42 db2 connect to zdb
43 db2 list active databases
44 db2start
46 db2stop
48 db2status
49 db2 connect zdb
50 db2start
51 db2 connect to zdb
以上是关于DB2常用命令的主要内容,如果未能解决你的问题,请参考以下文章