Sep 022013
 
delete 
from   previously_large_table;

insert /*+ append */ 
into   previously_large_table (
  cannot_reuse_existing_space,
  so_when_you
)
  select more_data, to_put_in
  from   here_space_consumed_grows;

When you delete, Oracle doesn't deallocate the space that was used by the table. 
Inserts using the append hint (aka direct path loads) allocates new space to the 
table, rather than re-using what's there. Misunderstanding of this can lead to 
tables consuming vast amounts of space, yet having (relatively) few rows in them - 
particularly if this is a frequent wipe-and-load staging table

For a quick and dirty script showing how this works (vs. convential inserts), keep reading. For more detailed discussions, take a look at this oracle-base article or this asktom question.
Continue reading »

Aug 092013
 
delete databases
where  not exists (
  select a_recovery_strategy
  from   backups
  where  your_job_depends = on_it_working
  or     you_may_find_the_job = not_existing
);

Of course, it's a better strategy to put backups and a recovery plan in place than going 
around deleting databases without these. If you're not going to do this you'll save some
pain in the long term just getting rid of them now though!