我的oracle9i学习笔记
2007-05-10 12:15:19 来源:WEB开发网alter table user.table_name move tablespace new_tablespace_name;
create index index_name on user.table_name(column_name) tablespace users;
alter index index_name rebuild;
drop table table_name [CASCADE CONSTRAINTS];
alter table user.table_name drop column col_name [CASCADE CONSTRAINTS CHECKPOINT 1000];---drop column
/*给表中不用的列做标记*/
alter table user.table_name set unused column comments CASCADE CONSTRAINTS;
/*drop表中不用的做了标记列*/
alter table user.table_name drop unused columns checkpoint 1000;
/*当在drop col是出现异常,使用CONTINUE,防止重删前面的column*/
ALTER TABLE USER.TABLE_NAME DROP COLUMNS CONTINUE CHECKPOINT 1000;
select * from dba_tables/dba_objects;
######## managing indexes ##########
/*create index*/
example:
/*创建一般索引*/
create index index_name on table_name(column_name) tablespace tablespace_name;
/*创建位图索引*/
create bitmap index index_name on table_name(column_name1,column_name2) tablespace tablespace_name;
/*索引中不能用pctused*/
create [bitmap] index index_name on table_name(column_name) tablespace tablespace_name pctfree 20 storage(inital 100k next 100k) ;
/*大数据量的索引最好不要做日志*/
create [bitmap] index index_name table_name(column_name1,column_name2) tablespace_name pctfree 20 storage(inital 100k next 100k) nologging;
更多精彩
赞助商链接