Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1753880
  • 博文数量: 787
  • 博客积分: 10000
  • 博客等级: 上将
  • 技术积分: 5015
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-22 15:17
文章分类

全部博文(787)

文章存档

2008年(787)

我的朋友

分类:

2008-09-25 16:07:12

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      
--------------------next---------------------

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