Wednesday 12 December 2007

How to restart DB after deleting datafiles.

The database will refuse to start if datafiles are removed from the os/storage without first removing them from within the DB. Dropping the table(s) stored on the datafiles won't cut it.

1. connect / as sysdba
2. startup mount
3. alter databsae drop datafile '/filename' offline drop;

The next part requires the DB to be open so...

4. alter database open;
5. drop tablespace including contents;

You can now recreate your datafiles, rebuild the tablespace and so on.

No comments: