1.压缩存储数据时,create table 加上COMPRESS选项,向表插入数据时,要排序插入,这样相同数据就存放一次,节约空间提高I/O效率。弊端,经常UPDATE的话会影响DML性能

2.表字段的unused和查看

  1. alter table t1 set unused column column_name 
  2.  
  3. select obj#,col#,name from sys.col$ 
  4. where obj# = 'select object_id from dba_objects where object_name = 'T1';
  5. alter table t1 drop unused columns;

3.使用UTL_FILE包导出表为文本,适用大表导出

  1. declare 
  2. v_file utl_file.file_type; 
  3. begin 
  4. v_file:=utl_file.fopen('/u01','output.txt','w'); 
  5. utl_file.putf(v_file,'output date: %s\n',sysdate); 
  6. utl_file.new_line(v_file); 
  7. for i in(select * from scott.t1) loop 
  8. utl_file.putf(v_file,'%s,%s,%s\n',i.ename,i.empno,i.sal); 
  9. end loop; 
  10. utl_file.fclose(v_file); 
  11. end; 

 4. v$transaction 跟 v$session 使用v$transaction.addr = v$session.taddr关联