db2 建库,建表空间,索引空间的一点参考


仅供参考




 mkdir /db/stable




db2iadm1 dasadm1


chown db2inst1:db2iadm1 stable


create database stable on /db/stable using codeset GBK TERRITORY CN;


db2 connect to stable




CREATE SCHEMA v5;


CREATE SCHEMA hds;




---- Create Buffer Pool
CREATE BUFFERPOOL V5_BUF_POOL  SIZE 3125 PAGESIZE 32768 NUMBLOCKPAGES 125 BLOCKSIZE 192;
CREATE BUFFERPOOL HDS_BUF_POOL  SIZE 3125 PAGESIZE 32768 NUMBLOCKPAGES 125 BLOCKSIZE 192;
CREATE BUFFERPOOL TEMP_BUF_POOL  SIZE 3125 PAGESIZE 32768 NUMBLOCKPAGES 125 BLOCKSIZE 192;




---- Create TBS
CREATE LARGE TABLESPACE V5_TBS IN DATABASE PARTITION GROUP IBMDEFAULTGROUP PAGESIZE 32K MANAGED BY DATABASE 
USING (file '/db/stable/V5_TBS' 1G)
EXTENTSIZE 32
PREFETCHSIZE AUTOMATIC
BUFFERPOOL V5_BUF_POOL
OVERHEAD 7.500000
TRANSFERRATE 0.060000 
FILE SYSTEM CACHING  
DROPPED TABLE RECOVERY ON;






CREATE LARGE TABLESPACE V5_INDEX_TS IN DATABASE PARTITION GROUP IBMDEFAULTGROUP PAGESIZE 32K MANAGED BY DATABASE 
USING (file '/db/stable/V5_INDEX_TS' 1G)
EXTENTSIZE 32
PREFETCHSIZE AUTOMATIC
BUFFERPOOL V5_BUF_POOL
OVERHEAD 7.500000
TRANSFERRATE 0.060000 
FILE SYSTEM CACHING  
DROPPED TABLE RECOVERY ON;




CREATE LARGE TABLESPACE HDS_TBS IN DATABASE PARTITION GROUP IBMDEFAULTGROUP PAGESIZE 32K MANAGED BY DATABASE 
USING (file '/db/stable/HDS_TBS' 2G)
EXTENTSIZE 32
PREFETCHSIZE AUTOMATIC
BUFFERPOOL HDS_BUF_POOL
OVERHEAD 7.500000
TRANSFERRATE 0.060000 
FILE SYSTEM CACHING  
DROPPED TABLE RECOVERY ON;


CREATE LARGE TABLESPACE HDS_INDEX_TS IN DATABASE PARTITION GROUP IBMDEFAULTGROUP PAGESIZE 32K MANAGED BY DATABASE 
USING (file '/db/stable/HDS_INDEX_TS' 1G)
EXTENTSIZE 32
PREFETCHSIZE AUTOMATIC
BUFFERPOOL HDS_BUF_POOL
OVERHEAD 7.500000
TRANSFERRATE 0.060000 
FILE SYSTEM CACHING  
DROPPED TABLE RECOVERY ON;
 

你可能感兴趣的:(DB2)