1.在实例用户用户下执行
db2 create database CPM on /home/db2inst1/CPM using codeset UTF-8 territory CN pagesize 32768
2.对smart用户进行赋权
db2 connect to CPM
db2 grant connect on database to user smart
db2 grant dbadm on database to user smart
3.创建schema
db2 create schema CPM authorization smart
4.创建缓存池
db2 CREATE BUFFERPOOL "CPMPOOL" IMMEDIATE SIZE 100000 NUMBLOCKPAGES 0 PAGESIZE 32 K;
5.创建临时表空间
db2 CREATE USER TEMPORARY TABLESPACE "TMPCPM" PAGESIZE 32K MANAGED BY automatic storage EXTENTSIZE 32 PREFETCHSIZE AUTOMATIC BUFFERPOOL "CPMPOOL" OVERHEAD 7.50 TRANSFERRATE 0.06 DROPPED TABLE RECOVERY OFF;
6.
db2 CREATE LARGE TABLESPACE "TSP_CPM" PAGESIZE 32K MANAGED BY automatic storage EXTENTSIZE 32 PREFETCHSIZE AUTOMATIC BUFFERPOOL "CPMPOOL" OVERHEAD 7.50 TRANSFERRATE 0.06 DROPPED TABLE RECOVERY On;
7.
db2 CREATE LARGE TABLESPACE "TSP_LOG" PAGESIZE 32K MANAGED BY automatic storage EXTENTSIZE 32 PREFETCHSIZE AUTOMATIC BUFFERPOOL "CPMPOOL" OVERHEAD 7.50 TRANSFERRATE 0.06 DROPPED TABLE RECOVERY ON;
8.
db2 CREATE LARGE TABLESPACE "TSP_INDEX" PAGESIZE 32K MANAGED BY automatic storage EXTENTSIZE 32 PREFETCHSIZE AUTOMATIC BUFFERPOOL "CPMPOOL" OVERHEAD 7.50 TRANSFERRATE 0.06 DROPPED TABLE RECOVERY ON;
导数据
db2 set current schema CPM;