1、创建数据库
CREATE DATABASE frk
AUTOMATIC STORAGE NO ON
'C:\' USING CODESET UTF-8 TERRITORY CN COLLATE
USING SYSTEM PAGESIZE 32768
CATALOG TABLESPACE MANAGED BY DATABASE
USING ( FILE 'E:\db2 data\frksysdectablespace' 51200 )
USER TABLESPACE MANAGED BY DATABASE
USING ( FILE 'E:\db2 data\frksysusertablespace' 51200 )
TEMPORARY TABLESPACE MANAGED BY DATABASE
USING ( FILE 'E:\db2 data\frksystemptablespace' 51200 ) ;
2、创建缓冲池
CONNECT TO FRK;
CREATE BUFFERPOOL BUFFER1 IMMEDIATE SIZE 250 PAGESIZE 32 K ;
CREATE BUFFERPOOL BUFFER2 IMMEDIATE SIZE 250 PAGESIZE 32 K ;
CREATE BUFFERPOOL BUFFER3 IMMEDIATE SIZE 250 PAGESIZE 32 K ;
CREATE BUFFERPOOL BUFFER4 IMMEDIATE SIZE 250 PAGESIZE 32 K ;
CONNECT RESET;
3、创建表空间
CONNECT TO FRK;
CREATE REGULAR TABLESPACE FRKREGTABLESPACE PAGESIZE 32 K MANAGED BY DATABASE USING ( FILE 'E:\db2 data\frkregtablespacedata' 16000 ) EXTENTSIZE 16 OVERHEAD 10.5 PREFETCHSIZE 16 TRANSFERRATE 0.14 BUFFERPOOL BUFFER1 DROPPED TABLE RECOVERY ON;
CREATE SYSTEM TEMPORARY TABLESPACE FRKSYSTEMPTSPACE PAGESIZE 32 K MANAGED BY DATABASE USING ( FILE 'E:\db2 data\frmsystemtablespacedata' 6400 ) EXTENTSIZE 16 OVERHEAD 10.5 PREFETCHSIZE 16 TRANSFERRATE 0.14 BUFFERPOOL BUFFER2 ;
CREATE USER TEMPORARY TABLESPACE FRKUSERTEMPTSPACE PAGESIZE 32 K MANAGED BY DATABASE USING ( FILE 'E:\db2 data\frkusertemptablespacedata' 6400 ) EXTENTSIZE 16 OVERHEAD 10.5 PREFETCHSIZE 16 TRANSFERRATE 0.14 BUFFERPOOL BUFFER3 ;
CREATE LARGE TABLESPACE FRKLAGGERTSPACE PAGESIZE 32 K MANAGED BY DATABASE USING ( FILE 'E:\db2 data\frkloggertablespacedata' 16000 ) EXTENTSIZE 16 OVERHEAD 10.5 PREFETCHSIZE 16 TRANSFERRATE 0.14 BUFFERPOOL BUFFER4 ;
CONNECT RESET;
4、创建表
CREATE TABLE abc(
id integer NOT NULL ,
name VARCHAR(180))
IN FRKREGTABLESPACE;