Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Why can't I truncate table?

Why can't I truncate table?

From: Bill Wine <biwine_at_vassar.edu>
Date: 14 Mar 1999 16:49:27 GMT
Message-ID: <7cgpan$jpj$1@news.vassar.edu>


I want to lock a table to prevent changes, do some read-only processing on rows in the table, then truncate the table, and commit, e.g.

  1. lock table xyz in exclusive mode;
  2. select ... from xyz;
  3. truncate table xyz;
  4. commit;

I find (Oracle 7.3.3.4) that if another user attempts to insert into xyz after step 1, but before step 3, the truncate fails with:

ORA-00054: resource busy and acquire with NOWAIT specified

The other user's insert then succeeds.

If I 'delete from xyz' instead of 'truncate xyz' it works as expected.

Why can't the process that locks the table in exclusive mode then do a truncate when another process is waiting to insert?

Thanks for your help.

Bill Received on Sun Mar 14 1999 - 10:49:27 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US