Chinaunix首页 | 论坛 | 博客
  • 博客访问: 330679
  • 博文数量: 76
  • 博客积分: 8291
  • 博客等级: 中将
  • 技术积分: 1540
  • 用 户 组: 普通用户
  • 注册时间: 2006-11-22 10:13
文章分类

全部博文(76)

文章存档

2009年(1)

2008年(75)

我的朋友

分类: Java

2008-05-08 17:45:57

1.create a table

sql> create table table_name (column datatype,column datatype]....)

sql> tablespace tablespace_name [pctfree integer] [pctused integer]

sql> [initrans integer] [maxtrans integer]

sql> storage(initial 200k next 200k pctincrease 0 maxextents 50)

sql> [logging|nologging] [cache|nocache]

 

2.copy an existing table

sql> create table table_name [logging|nologging] as subquery

 

3.create temporary table

sql> create global temporary table xay_temp as select * from xay;

on commit preserve rows/on commit delete rows

 

4.pctfree = (average row size - initial row size) *100 /average row size

pctused = 100-pctfree- (average row size*100/available data space)

 

5.change storage and block utilization parameter

sql> alter table table_name pctfree=30 pctused=50 storage(next 500k

sql> minextents 2 maxextents 100);

 

6.manually allocating extents

sql> alter table table_name allocate extent(size 500k datafile 'c:/oracle/data.dbf');

 

7.move tablespace

sql> alter table employee move tablespace users;

 

8.deallocate of unused space

sql> alter table table_name deallocate unused [keep integer]

 

9.truncate a table

sql> truncate table table_name;

 

10.drop a table

sql> drop table table_name [cascade constraints];

 

11.drop a column

sql> alter table table_name drop column comments cascade constraints checkpoint 1000;

alter table table_name drop columns continue;

 

12.mark a column as unused

sql> alter table table_name set unused column comments cascade constraints;

alter table table_name drop unused columns checkpoint 1000;

alter table orders drop columns continue checkpoint 1000

data_dictionary : dba_unused_col_tabs

阅读(402) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~