Forum OpenACS Q&A: Response to something like vacuum analyze or compact database for Oracle?

Jade and Don are right. There's no such thing as a "vacuum analyze" in Oracle.

As for Don's observation regarding the redo log, yes, Oracle's design means that readers asking for a row since modified by another user "read around" the altered row to get the original. However, the benefits far outweigh the expense: readers never wait for writers, and vice versa. This has a lot of implications, especially in that locks are no longer to be avoided as an "expense". One allows transactions to be as long or as short as they need to be, without worrying that you're blocking other users. For full details, see the Oracle 8i Concepts manual (the whole book is required reading for any Oracle developer). Alternatively, buy a copy of Thomas Kyte's Expert Oracle One-on-One. The latter is worth every cent.

Don is also right that big chunks of space resulting from a DELETE are not reclaimed. However, in a typical system, you'll be re-inserting those rows at some point. Trying to keep up with reclaiming excess space, only to watch it get allocated again later, is a pointless exercise in most shops. The underlying issue is that extents (the physical chunks of space allocated to a database object -- table, index, etc.), once allocated to an object (a.k.a. a segment), remain allocated, even if they're not used.

To get rid of those not-currently-used extents, you can either DROP or TRUNCATE the table to reclaim the space. So, one might try:

  CREATE TABLE my_temporary_holding_table AS SELECT * FROM mypurgedtable;
  
  TRUNCATE TABLE mypurgedtable;

  INSERT INTO mypurgedtabled SELECT * FROM my_temporary_holding_table;
 
  DROP my_temporary_holding_table;

If the purged table has is the parent table for any referential integrity constraints, you'll need to disable the constraints before the TRUNCATE and to reenable them following the INSERT. See the syntax for ALTER TABLE.

Finally, it is possible to resize a datafile in Oracle. (Any single tablespace is composed of one or more datafiles.) If memory serves, the syntax is ALTER DATABASE DATAFILE filename RESIZE newsize. This statement assumes the used extents in the datafile all fit in the new size. I don't do this very often, though.