TRUNCATE TABLE Order(tableName)

来源:互联网 发布:淘宝买iphone7靠谱吗 编辑:程序博客网 时间:2024/05/18 03:44

TRUNCATE TABLE Order(tableName)

 

TRUNCATE TABLE 在功能上与不带 WHERE 子句的 DELETE 语句相同:二者均删除表中的全部行。
但 TRUNCATE TABLE 比 DELETE 速度快,且使用的系统和事务日志资源少。
 
 

--【建表参数含义】:                                            

-- 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 --最大区段无限制                           
);                                                              
-----------------------------------------------------------------

pctfree 很重要,但对于查询系统基本上可以设置为0

 

 

实例:

drop table bd_operation_dictionary cascade constraints;

/*==============================================================*/
/* Table: "bd_operation_dictionary"                             */
/*==============================================================*/
create table bd_operation_dictionary
(
   ID                   VARCHAR(32)          default sys_guid() not null,
   DICTIONARY_CODE      VARCHAR(32),
   OPERATION_NAME       VARCHAR(80),
   PROPERTY             VARCHAR(32),
   FLAG                 CHAR(1),
   constraint PK_BD_OPERATION_DICTIONARY primary key (ID)
)
tablespace RMDB
  pctfree 10
  initrans 1
  maxtrans 255;

comment on table bd_operation_dictionary is
'手术字典';

comment on column bd_operation_dictionary.ID is
'主键ID32位随机码';

 

 

 

 

0 0