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 -> Re: delete database file on server -> sharing violation

Re: delete database file on server -> sharing violation

From: Ed Murphy <emurphy42_at_socal.rr.com>
Date: Thu, 18 Oct 2007 20:15:20 -0700
Message-ID: <47182175$0$32469$4c368faf@roadrunner.com>


DA Morgan wrote:

> Tony Rogerson wrote:

>>> Given that this is Windows reboot the machine. Then delete the files.
>>
>> Totally clueless.

>
> I don't see you offering a solution to the original poster.
>
> Go ahead ... here's your chance ... if you don't like my answer then
> by all means tell everyone, including the person asking for help how
> to solve the problem.
>
> I've never seen a Windows problem yet solved by cross-posting to an
> irrelevant usenet group followed up with an insult.
>
> If you have a solution ... why are you incapable of posting it?

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:

  1. SQL CHUI (Query Analyzer or Enterprise Manager for SQL 2000, Management Studio for SQL 2005) - execute a DROP DATABASE command, e.g.

        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

Original text of this message

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