Unix Technical Forum

delete database file on server -> sharing violation

This is a discussion on delete database file on server -> sharing violation within the SQL Server forums, part of the Microsoft SQL Server category; --> On Oct 18, 4:42 am, "Greg D. Moore \(Strider\)" <mooregr_deletet...@greenms.com> wrote: > "DA Morgan" <damor...@psoug.org> wrote in message > ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #21 (permalink)  
Old 03-01-2008, 03:43 PM
joel garry
 
Posts: n/a
Default Re: delete database file on server -> sharing violation

On Oct 18, 4:42 am, "Greg D. Moore \(Strider\)"
<mooregr_deletet...@greenms.com> wrote:
> "DA Morgan" <damor...@psoug.org> wrote in message
>
> news:1192650569.162054@bubbleator.drizzle.com...
>
>
>
> > Given that this is Windows reboot the machine. Then delete the files.

>
> And what exactly is that supposed to do other than waste the poster's time?


Well, I would hope most chefs consider flies something to be deleted,
unless maybe they're trying to get in the new Michelin Guide for
Frogs.

So, why was it this was posted to cdos?

jg
--
@home.com is bogus.
"KRMTLGS" - vanity plate, couldn't see if driver was green.
http://www.amazon.com/Michelin-Guide.../dp/2067129902

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #22 (permalink)  
Old 03-01-2008, 03:43 PM
Erland Sommarskog
 
Posts: n/a
Default Re: delete database file on server -> sharing violation

DA Morgan (damorgan@psoug.org) writes:
> Fix the problem. Half the time, with Windows, the correct solution to a
> problem is a reboot. This is one of those times.


Maybe. If SQL Server is not set to auto-start it will work, in so far that
you will get rid of the files. But since the databases will still be in
master.sys.databases, it's not a very pretty solution. And in most cases,
SQL Server is set to auto-start, in which case rebooting the box is not
going to help at all.

But your answer is interesting. I take it that to get rid of database
files with Oracle, DROP DATABASE is not the way to go, or at least it is
not sufficient. But do you really have to reboot to get Oracle to let go
of the files?
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #23 (permalink)  
Old 03-01-2008, 03:43 PM
sybrandb@hccnet.nl
 
Posts: n/a
Default Re: delete database file on server -> sharing violation

On Thu, 18 Oct 2007 19:35:59 +0100, "Tony Rogerson"
<tonyrogerson@torver.net> wrote:

>
>Totally clueless.
>
>If you don't know then just keep quiet instead of posting totally misleading
>advice that may (probably) cause business outage to the OP.


It was crossposted to an Oracle Usenet group, was it.
By the way, if you are such an eminent sqlserver guru why don't you
just post the correct answer instead of this useless flame?
Could it be you don't know the correct answer?

Why sqlserver 'gurus' promote sqlserver by flaming Oracle users?
Is this the most recent Microsoft sqlserver promotion campaign, or is
this just the personal lack of ethics of an arrogant self-apporinted
sqlserver 'guru'?
Because on the other hand Oracle users aren't visiting sqlserver
Usenet groups to bash sqlserver!

--
Sybrand Bakker
Senior Oracle DBA
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #24 (permalink)  
Old 03-01-2008, 03:43 PM
sybrandb@hccnet.nl
 
Posts: n/a
Default Re: delete database file on server -> sharing violation

On Thu, 18 Oct 2007 13:25:45 -0400, "Greg D. Moore \(Strider\)"
<mooregr_deleteth1s@greenms.com> wrote:

>No, this is clearly one of those times when that would almost certainly NOT
>work.


If it doesn't work, acknowledging the OP crossposted this to a
sqlserver AND an Oracle forum. why flame an Oracle DBA instead of
posting the correct response?
Because you don't know the correct response?

--
Sybrand Bakker
Senior Oracle DBA
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #25 (permalink)  
Old 03-01-2008, 03:43 PM
sybrandb@hccnet.nl
 
Posts: n/a
Default Re: delete database file on server -> sharing violation

On Thu, 18 Oct 2007 21:15:21 +0000 (UTC), Erland Sommarskog
<esquel@sommarskog.se> wrote:

>But your answer is interesting. I take it that to get rid of database
>files with Oracle, DROP DATABASE is not the way to go, or at least it is
>not sufficient. But do you really have to reboot to get Oracle to let go
>of the files?


Unix (you know the OS people blinded by Microsoft know nothing about)
will keep the inode of the file open, even if you deleted the file.

--
Sybrand Bakker
Senior Oracle DBA
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #26 (permalink)  
Old 03-01-2008, 03:43 PM
DA Morgan
 
Posts: n/a
Default Re: delete database file on server -> sharing violation

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?
--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #27 (permalink)  
Old 03-01-2008, 03:43 PM
Ed Murphy
 
Posts: n/a
Default 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.

>
> 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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #28 (permalink)  
Old 03-01-2008, 03:43 PM
Tony Rogerson
 
Posts: n/a
Default Re: delete database file on server -> sharing violation

> By the way, if you are such an eminent sqlserver guru why don't you
> just post the correct answer instead of this useless flame?
> Could it be you don't know the correct answer?


I replied in the ms-sqlserver group and gave the correct reply to the OP
instead of this useless unprofessional diatribe.

--
Tony Rogerson, SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson
[Ramblings from the field from a SQL consultant]
http://sqlserverfaq.com
[UK SQL User Community]


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #29 (permalink)  
Old 03-01-2008, 03:43 PM
Tony Rogerson
 
Posts: n/a
Default Re: delete database file on server -> sharing violation

> I don't see you offering a solution to the original poster.

I posted the answer in the ms-sqlserver group where it belonged - go check.
FYI LDF/MDF's are related to the databases on a SQL Server instance and as
such he obviously has SQL Server running and a database using those files
that is online.

To solve the problem drop the database - there, wasn;t difficult being
polite was it.

A bit far from a reboot / warm start the OS which woudl do absolutely
nothing except ccost the OP's business outage while the box reboots and
things come back online, and he would still have the problem.

--
Tony Rogerson, SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson
[Ramblings from the field from a SQL consultant]
http://sqlserverfaq.com
[UK SQL User Community]

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #30 (permalink)  
Old 03-01-2008, 03:43 PM
pearl146@hotmail.com
 
Posts: n/a
Default Re: delete database file on server -> sharing violation

On 18 Okt., 18:23, sybra...@hccnet.nl wrote:
> On Thu, 18 Oct 2007 19:35:59 +0100, "Tony Rogerson"
>
> <tonyroger...@torver.net> wrote:
>
> >Totally clueless.

>
> >If you don't know then just keep quiet instead of posting totally misleading
> >advice that may (probably) cause business outage to the OP.

>
> It was crossposted to an Oracle Usenet group, was it.
> By the way, if you are such an eminent sqlserver guru why don't you
> just post the correct answer instead of this useless flame?
> Could it be you don't know the correct answer?
>
> Why sqlserver 'gurus' promote sqlserver by flaming Oracle users?
> Is this the most recent Microsoft sqlserver promotion campaign, or is
> this just the personal lack of ethics of an arrogant self-apporinted
> sqlserver 'guru'?
> Because on the other hand Oracle users aren't visiting sqlserver
> Usenet groups to bash sqlserver!
>
> --
> Sybrand Bakker
> Senior Oracle DBA



Thank you all for the various suggestions.
I decided not to delete the files.

And I am sorry for having posted my question in the oracle forum but I
just hoped someone at all could help me.

Regards
Pearl

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:43 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com