Reply to post:

We've found it... the last shred of human decency in an IT director – all for a poxy Unix engineer

CujoDeSoque

A simple "create table as select"[1] is all you need to do first. At that point truncate or drop doesn't matter unless you're in an HA/DR or replication setting. If you don't want the backup table in your database, you can use datapump to export it to a file.

Truncate is helpful is the case of a table that you don't care if you recover and is very large or allocates a lot of space. In some cases the space claimed by a table is many empty extents while the actual space used is minimal. "Drop table including contents" will allow you to recover. "Delete from table" will not reclaim the space.

All of this presupposes the table had no constraints.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

SUBSCRIBE TO OUR WEEKLY TECH NEWSLETTER

Biting the hand that feeds IT © 1998–2020