建表时的一些参数pctfree initrans maxtrans storage的含义

yangtaoorange 2010-01-07 08:42:47
-- Create table
create table X_SMALL_AREA
(
SMALL_AREA_ID NUMBER(10) not null
)
tablespace TBSL_SDDQ
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64
minextents 1
maxextents unlimited
);

请教各位指点一下,其中pctfree initrans maxtrans storage的属性的含义解释一下,谢谢
...全文
1209 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
weng_sq2010 2012-03-19
  • 打赏
  • 举报
回复
领教了。。
Chen_Weihappy_love 2011-12-01
  • 打赏
  • 举报
回复
楼上 解释请具体 谢了
wh62592855 2010-01-08
  • 打赏
  • 举报
回复
[Quote=引用楼主 yangtaoorange 的回复:]
-- Create table
create table X_SMALL_AREA
(
  SMALL_AREA_ID  NUMBER(10) not null
)
tablespace TBSL_SDDQ
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64
    minextents 1
    maxextents unlimited
  );

请教各位指点一下,其中pctfree initrans  maxtrans storage的属性的含义解释一下,谢谢   
[/Quote]
pctfree 指定一个百分比 比如说20% 那么当某个数据块使用率超过百分之80的时候系统就会停止往这个数据块里插入新的数据 剩下百分之20空间留给将来对数据的更新使用 这样可以防止迁移行和链接行的出现

initrans指定一个数据块上初始有多少个事务槽 也就是说有多少个事务能同时对此数据块操作

maxtrans 指定最多有多少个事务可以并发操作此数据块

storage 指定一些表的存储参数 就拿你那个例子来说吧

storage
(
initial 64 --初始大小64
minextents 1 --至少有一个区
maxextents unlimited --可分配给该表无限制个区
);
crazylaa 2010-01-07
  • 打赏
  • 举报
回复
tangren 2010-01-07
  • 打赏
  • 举报
回复
表空间包含段
段里包含区段
区段包含数据块

块上的事务槽是对影响该块的事务进行登记使用的

这儿有一些概念http://blog.csdn.net/CYHJRX/archive/2009/02/11/3877369.aspx
tangren 2010-01-07
  • 打赏
  • 举报
回复
-- Create table
create table X_SMALL_AREA
(
SMALL_AREA_ID NUMBER(10) not null
)
tablespace TBSL_SDDQ --表段X_SMALL_AREA放在表空间TBSL_SDDQ中
pctfree 10 --块保留10%的空间留给更新该块数据使用
initrans 1 --初始化事务槽的个数
maxtrans 255 --最大事务槽的个数
storage --存储参数
(
initial 64k --区段(extent)一次扩展64k
minextents 1 --最小区段数
maxextents unlimited --最大区段无限制
);
yangtaoorange 2010-01-07
  • 打赏
  • 举报
回复
各位高手啊,快帮帮忙啊
数据库创建代码: 1:用户表:(users) userid(主键),username(用户名),password(密码),sex(性别),head(头像),regdate(注册日期) 2:类别表:(types) tid(主键),type 3:技术表:(technic) teid(主键),tename(技术名),tsum(拥有帖子数量),tid(引用类别表主键) 4:帖子表:(card) cid(主键),title(标题),content(内容),outtime(发帖间),uptime(修改帖子的间),csum(回帖数量),tename(属于哪个技术), userid(引用用户表外键) 5:回帖表:(restore) rid(主键),rtitle(标题),rcontent(内容),routtime(发帖间),ruptime(修改帖子的间),tename(属于哪个技术), userid(引用用户表外键),cid(引用帖子表主键) --用户表:(users) -- Create table create table USERS ( USERID INTEGER not null, USERNAME VARCHAR2(20) not null, PASSWORD VARCHAR2(20) not null, SEX VARCHAR2(20) not null, HEAD VARCHAR2(20) not null, REGDATE DATE not null ) tablespace SYSTEM pctfree 10 pctused 40 initrans 1 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited ); -- Create/Recreate primary, unique and foreign key constraints alter table USERS add constraint PK_USERID primary key (USERID) using index tablespace SYSTEM pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited ); --类别表:(types) -- Create table create table TYPES ( TID INTEGER not null, TYPE VARCHAR2(20) not null ) tablespace SYSTEM pctfree 10 pctused 40 initrans 1 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited ); -- Create/Recreate primary, unique and foreign key constraints alter table TYPES add constraint PK_TID primary key (TID) using index tablespace SYSTEM pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited ); --技术表:(technic) -- Create table create table TECHNIC ( TEID INTEGER not null, TENAME VARCHAR2(20) not null, TSUM INTEGER not null, TID INTEGER not null ) tablespace SYSTEM pctfree 10 pctused 40 initrans 1 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited ); -- Create/Recreate primary, unique and foreign key constraints alter table TECHNIC add constraint PK_TEID primary key (TEID) using index tablespace SYSTEM pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited ); alter table TECHNIC add constraint FK_TID foreign key (TID) references TYPES (TID); --帖子表:(card) -- Create table create table CARD ( CID INTEGER not null, TITLE VARCHAR2(20) not null, CONTENT VARCHAR2(100) not null, OUTTIME DATE not null, UPTIME DATE not null, CSUM INTEGER not null, TENAME VARCHAR2(20) not null, USERID INTEGER ) tablespace SYSTEM pctfree 10 pctused 40 initrans 1 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited ); -- Create/Recreate primary, unique and foreign key constraints alter table CARD add constraint PK_CID primary key (CID) using index tablespace SYSTEM pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited ); alter table CARD add constraint FK_USERID foreign key (USERID) references USERS (USERID); --回帖表:(restore) -- Create table create table RESTORE ( RID INTEGER not null, RTITLE VARCHAR2(20) not null, RCONTENT VARCHAR2(100) not null, ROUTTIME DATE not null, RUPTIME DATE not null, TENAME VARCHAR2(20) not null, USERID INTEGER not null, CID INTEGER not null ) tablespace SYSTEM pctfree 10 pctused 40 initrans 1 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited ); -- Create/Recreate primary, unique and foreign key constraints alter table RESTORE add constraint PK_RID primary key (RID) using index tablespace SYSTEM pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited ); alter table RESTORE add constraint FK_CID foreign key (CID) references CARD (CID); alter table RESTORE add constraint FK_UID foreign key (USERID) references USERS (USERID); --序列号 -- Create sequence create sequence SEQ_CID minvalue 1 maxvalue 9999999999 start with 1 increment by 1 cache 20 order; --seq_userid -- Create sequence create sequence SEQ_USERID minvalue 1 maxvalue 9999991 start with 1 increment by 1 cache 20 order; --seq_tid -- Create sequence create sequence SEQ_TID minvalue 1 maxvalue 99999 start with 1 increment by 1 cache 20 order; --seq_teid -- Create sequence create sequence SEQ_TEID minvalue 1 maxvalue 999999 start with 1 increment by 1 cache 20 order; --seq_rid -- Create sequence create sequence SEQ_RID minvalue 1 maxvalue 99999 start with 1 increment by 1 cache 20 order;

17,140

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧