1:创建表空间
CREATE TABLESPACE ts_name DATAFILE '/dev/name1' SIZE 2000M, '/dev/name2' SIZE 2000M
DEFAULT STORAGE ( INITIAL 64K NEXT 64K MAXEXTENTS UNLIMITED PCTINCREASE 50 );
2:修改表空间
alter TABLESPACE ts_name add DATAFILE '/dev/name3' SIZE 2000M;
3:回滚段
CREATE ROLLBACK SEGMENT "RS01" TABLESPACE "TS_name"
STORAGE ( INITIAL 8M NEXT 8M MAXEXTENTS UNLIMITED);
4:创建用户和授权
CREATE USER tempuser IDENTIFIED BY tempuser
DEFAULT TABLESPACE TS_name1 TEMPORARY TABLESPACE TS_name2;
GRANT CONNECT TO tempuser;
GRANT DBA TO tempuser;
GRANT resource TO tempuser;
5:创建表
create table tablename
(
f1 NUMBER(10) not null,
f2 NUMBER(10) null ,
f3 NUMBER(3) defalut 0,
pt number(3) not null ,
constraint PK_tablename primary key (f1)
using index
tablespace ts_name
storage
(
initial 1m
next 1m
pctincrease 0
)
)
pctfree 10
tablespace ts_name
storage
(
initial 1m
next 1m
pctincrease 0
)
partition by range(pt)
(partition part000 values less than (1) tablespace ts_name,
partition part001 values less than (2) tablespace ts_name,
)
/
6:创建索引
create index i_tablename1 on tablename(f2)
tablespace ts_name
storage
(
initial 500k
next 500k
pctincrease 0
)