Oracle Table Management

xiaoxiao2021-03-06  135

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

转载请注明原文地址:https://www.9cbs.com/read-99809.html

New Post(0)