Oracle

From Alessandro's Wiki
Jump to: navigation, search


  • check stats enabled:
SELECT DBMS_STATS.get_prefs('PUBLISH') FROM dual;
  • list of tables ordered by size
select segment_name,segment_type,bytes ,max_size  from user_segments  ORDER BY bytes DESC
  • disable constraint
alter table table_name  disable constraint <constraint>;
  • enable constraint
alter table table_name  enable constraint <constraint>;
  • empty table and release space
truncate table table_name DROP STORAGE;