Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: delete database file on server -> sharing violation
DA Morgan wrote:
> Tony Rogerson wrote:
>>> Given that this is Windows reboot the machine. Then delete the files. >> >> Totally clueless.
He probably chose not to post it, because a couple of adequate solutions have already been posted. However, they've been a bit scattered and lacking context, so here's a comprehensive answer:
The files are presumably in use by MS SQL. They may or may not be needed by the users. If not, then you can get rid of them in any of the following ways:
DROP DATABASE foobar
This requires knowing the name of the database, which is usually identical or at least similar to the filenames, e.g. database foobar may have filenames foobar.mdf and foobar.ldf 2) SQL GUI (Enterprise Manager or Management Studio) - find the database in the Explorer-style tree on the left, right-click and select "Delete Database". This deletes the physical files.
Detaching the database (via CHUI or GUI) does not delete the physical files, but makes SQL forget about the database until/unless you re-attach them. You can then delete the physical files in the usual fashion, which accomplishes the same as the above, but in a more roundabout fashion.
You can also delete the physical files in the usual fashion while the SQL service is stopped (or before it starts). Rebooting is insufficient if the service auto-starts. In addition, SQL will complain about the files being missing; this probably won't interfere with its other databases, but why do it the messy way when the clean way is easier? Received on Thu Oct 18 2007 - 22:15:20 CDT