Oracle笔记五

No.1
创建表:create table hr.employess(id number(6),hiredate DATEDEFAULT SYSDATE) tablespace one;在HR用户下创建表。
手动分配表所占的区:alter table hr.employees allocate extent (size 500k datafile 'e:\oradata\one.dbf');
非分区表的重组:alter table hr.employees move tablespace two;
截取表:truncate table hr.employees;截取表将删除表中所有的记录并释放所占用的空间,相应的索引也被截取
删除表:drop table hr.employees cascade constraints;
查询表信息:dba_tables,dba_objects
No.2
Oracle中索引分B-TREE和BITMAP,前者对于包含OR操作符的查询是低效的,适用于OLTP,后者对于包含OR操作符的查询是高效的,且适用于决策支持系统
create index hr.employees_lastfld_idx on hr.employees(lastfld) tablespace indx;
create bitmap  hr.employees_lastfld_idx on hr.employees(lastfld) tablespace indx;
分配索引:alter index orders_region_idx allocate extent(size 200k datafile 'e:\oradata\indx.dbf');
释放索引:alter index orders_region_idx deallocate unused;
重建索引:alter index orders_region_idx tablespace one;(重建索引可以将索引移到别的表空间)
删除索引:drop index orders_region_idx ;(在数据作大量装载前先删除索引之后再重建索引)
监视索引的使用:alter index orders_region_idx monitoring(unmonitoring ) usage开始(停止)监视索引使用
原文地址:https://www.cnblogs.com/emily_fly/p/1531367.html