1、创建数据库
CREATE DATABASE FRK
AUTOMATIC STORAGE NO ON '/home/data' USING CODESET gbkTERRITORY CN COLLATE
USING SYSTEM PAGESIZE 32768
CATALOG TABLESPACE MANAGED BY DATABASE
USING ( FILE '/home/data/sysspaces' 51200 )
USER TABLESPACE MANAGED BY DATABASE
USING ( FILE '/home/data/sysusertablespace' 51200 )
TEMPORARY TABLESPACE MANAGED BY DATABASE
USING ( FILE '/home/data/systemptablespace' 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 '/home/data/regtablespacedata' 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 '/home/data/systemtablespacedata' 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 '/home/data/usertemptablespacedata' 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 '/home/data/loggertablespacedata' 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;