ITPub博客

首页 > 数字化转型 > ERP > 创建表空间、回滚段、用户、表的详细语法信息(转)

创建表空间、回滚段、用户、表的详细语法信息(转)

原创 ERP 作者:Rounders 时间:2007-08-06 17:14:03 0 删除 编辑
创建表空间、回滚段、用户、表的详细语法信息[@more@]

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_t

ablename 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
)
/

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9417382/viewspace-932286/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    115
  • 访问量
    495286