日期:2014-05-17  浏览次数:20713 次

请帮忙解释一段oracle代码,
我在不懂的语句后面打了问号,请帮忙解释一下,刚学oracle
CREATE   TABLESPACE   "CUSTDATA1 "//比如这句意思是说创建一个表空间且名字叫CUSTDAT1
          LOGGING//?
          DATAFILE   'D:\oracle\oradata\test\CUSTDATA1INFO.ora '   SIZE   512M//?
          EXTENT   MANAGEMENT   LOCAL;//?
//上面这段我知道是创建了一个表空间,
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   CUSTDATA1
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,//?
)


没分了所以就只能给2分

------解决方案--------------------
尝试帮助别人是一件快乐的事情. :)

CREATE TABLESPACE "CUSTDATA1 "//比如这句意思是说创建一个表空间且名字叫CUSTDAT1
LOGGING//logging 模式
DATAFILE 'D:\oracle\oradata\test\CUSTDATA1INFO.ora ' SIZE 512M//指定的data file位置
EXTENT MANAGEMENT LOCAL;//设置本地自动表空间管理

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)//建立PK的约束
using index//使用指定的PK的索引表空间
tablespace CUSTDATA1
storage//看看一些基本概念吧,如block,segment,tablespace等.
(
initial 1m//?
next 1m//?
pctincrease 0//?
)
)
pctfree 10//参考一下关于pctfree和pctused的用法以及HWM的问题,深入一点是关于行链接和行迁移的发生过程.
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,//?
)