dbTalk Databases Forums  

delete database file on server -> sharing violation

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss delete database file on server -> sharing violation in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
pearl146@hotmail.com
 
Posts: n/a

Default delete database file on server -> sharing violation - 10-17-2007 , 01:36 PM






Hi,

I have some database files (.MDF, .LDF,...) on the server. When I try
to delete them, the warning "Cannot delete file: There has been a
sharing violation. The source or destination file may be in use."
appears.

Since I am new to the environment I don't know where the files come
from and where they might be used.

Can anybody tell me what to do to delete those files?

Thank you.


Reply With Quote
  #2  
Old   
Ed Murphy
 
Posts: n/a

Default Re: delete database file on server -> sharing violation - 10-17-2007 , 02:02 PM






pearl146 (AT) hotmail (DOT) com wrote:

Quote:
I have some database files (.MDF, .LDF,...) on the server. When I try
to delete them, the warning "Cannot delete file: There has been a
sharing violation. The source or destination file may be in use."
appears.

Since I am new to the environment I don't know where the files come
from and where they might be used.

Can anybody tell me what to do to delete those files?
Assuming this is MS SQL (I don't know what extensions Oracle uses), you
need to detach the database from SQL. Can be done via GUI or CHUI. For
a GUI, use Enterprise Manager (SQL 2000) or Management Studio (2005).


Reply With Quote
  #3  
Old   
astalavista
 
Posts: n/a

Default Re: delete database file on server -> sharing violation - 10-17-2007 , 02:49 PM



see sqlservr.exe

<pearl146 (AT) hotmail (DOT) com> a écrit dans le message de news:
1192646183.822289.234660 (AT) e34g20...oglegroups.com...
Quote:
Hi,

I have some database files (.MDF, .LDF,...) on the server. When I try
to delete them, the warning "Cannot delete file: There has been a
sharing violation. The source or destination file may be in use."
appears.

Since I am new to the environment I don't know where the files come
from and where they might be used.

Can anybody tell me what to do to delete those files?

Thank you.




Reply With Quote
  #4  
Old   
DA Morgan
 
Posts: n/a

Default Re: delete database file on server -> sharing violation - 10-17-2007 , 02:49 PM



pearl146 (AT) hotmail (DOT) com wrote:
Quote:
Hi,

I have some database files (.MDF, .LDF,...) on the server. When I try
to delete them, the warning "Cannot delete file: There has been a
sharing violation. The source or destination file may be in use."
appears.

Since I am new to the environment I don't know where the files come
from and where they might be used.

Can anybody tell me what to do to delete those files?

Thank you.
Oracle is not a Microsoft product.

Given that this is Windows reboot the machine. Then delete the files.
--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #5  
Old   
pearl146@hotmail.com
 
Posts: n/a

Default Re: delete database file on server -> sharing violation - 10-17-2007 , 03:18 PM



On Oct 17, 3:02 pm, Ed Murphy <emurph... (AT) socal (DOT) rr.com> wrote:
Quote:
pearl... (AT) hotmail (DOT) com wrote:
I have some database files (.MDF, .LDF,...) on the server. When I try
to delete them, the warning "Cannot delete file: There has been a
sharing violation. The source or destination file may be in use."
appears.

Since I am new to the environment I don't know where the files come
from and where they might be used.

Can anybody tell me what to do to delete those files?

Assuming this is MS SQL (I don't know what extensions Oracle uses), you
need to detach the database from SQL. Can be done via GUI or CHUI. For
a GUI, use Enterprise Manager (SQL 2000) or Management Studio (2005).
Thanks Ed,
but what do I need to do in Enterprise Manager? How can I delete the
file from there?



Reply With Quote
  #6  
Old   
EdStevens
 
Posts: n/a

Default Re: delete database file on server -> sharing violation - 10-17-2007 , 03:22 PM



On Oct 17, 1:36 pm, pearl... (AT) hotmail (DOT) com wrote:
Quote:
Hi,

I have some database files ... on the server. When I try
to delete them. . .

Since I am new to the environment I don't know where the files come
from and where they might be used.

snip

Let's see, you have files that you don't know where they come from,
you don't know where they might be used, and yet you are still trying
to delete them . . . .



Reply With Quote
  #7  
Old   
bdbafh
 
Posts: n/a

Default Re: delete database file on server -> sharing violation - 10-17-2007 , 04:05 PM




pearl... (AT) hotmail (DOT) com wrote:
Quote:
Hi,

I have some database files (.MDF, .LDF,...) on the server. When I try
to delete them, the warning "Cannot delete file: There has been a
sharing violation. The source or destination file may be in use."
appears.

Since I am new to the environment I don't know where the files come
from and where they might be used.

Can anybody tell me what to do to delete those files?

Thank you.
If you were running on Linux, the operating system would dutifully
obey your command.
The files would remain accessible to existing processes which already
had handles.
After the last handle on the file(s) has been released, the file(s)
would no longer exist.

Be glad that the OS that you are using has training wheels.

There are utilities from SysInternals (since acquired by Microsoft)
for locating processes holding handles on files. Handle.exe would be
one, process monitor is another.

try here:
http://www.microsoft.com/technet/sys...s/default.mspx
http://www.microsoft.com/technet/sys...t.svl=featured

You have backups of the databases of interest on this server, right?

hth.

-bdbafh



Reply With Quote
  #8  
Old   
pearl146@hotmail.com
 
Posts: n/a

Default Re: delete database file on server -> sharing violation - 10-17-2007 , 04:06 PM



On Oct 17, 4:22 pm, EdStevens <quetico_... (AT) yahoo (DOT) com> wrote:
Quote:
On Oct 17, 1:36 pm, pearl... (AT) hotmail (DOT) com wrote:> Hi,

I have some database files ... on the server. When I try
to delete them. . .

Since I am new to the environment I don't know where the files come
from and where they might be used.

snip

Let's see, you have files that you don't know where they come from,
you don't know where they might be used, and yet you are still trying
to delete them . . . .
Yes, because my chef wants me to delete them and I don't know how.



Reply With Quote
  #9  
Old   
pearl146@hotmail.com
 
Posts: n/a

Default Re: delete database file on server -> sharing violation - 10-17-2007 , 04:31 PM



On Oct 17, 5:05 pm, bdbafh <bdb... (AT) gmail (DOT) com> wrote:
Quote:
pearl... (AT) hotmail (DOT) com wrote:
Hi,

I have some database files (.MDF, .LDF,...) on the server. When I try
to delete them, the warning "Cannot delete file: There has been a
sharing violation. The source or destination file may be in use."
appears.

Since I am new to the environment I don't know where the files come
from and where they might be used.

Can anybody tell me what to do to delete those files?

Thank you.

If you were running on Linux, the operating system would dutifully
obey your command.
The files would remain accessible to existing processes which already
had handles.
After the last handle on the file(s) has been released, the file(s)
would no longer exist.

Be glad that the OS that you are using has training wheels.

There are utilities from SysInternals (since acquired by Microsoft)
for locating processes holding handles on files. Handle.exe would be
one, process monitor is another.

try here:http://www.microsoft.com/technet/sys...andthreadsutil...

You have backups of the databases of interest on this server, right?

hth.

-bdbafh
I don't know if there are backups.

Thanks, I will try Handle.exe.



Reply With Quote
  #10  
Old   
Ed Murphy
 
Posts: n/a

Default Re: delete database file on server -> sharing violation - 10-17-2007 , 04:34 PM



pearl146 (AT) hotmail (DOT) com wrote:

Quote:
On Oct 17, 3:02 pm, Ed Murphy <emurph... (AT) socal (DOT) rr.com> wrote:
pearl... (AT) hotmail (DOT) com wrote:
I have some database files (.MDF, .LDF,...) on the server. When I try
to delete them, the warning "Cannot delete file: There has been a
sharing violation. The source or destination file may be in use."
appears.
Since I am new to the environment I don't know where the files come
from and where they might be used.
Can anybody tell me what to do to delete those files?
Assuming this is MS SQL (I don't know what extensions Oracle uses), you
need to detach the database from SQL. Can be done via GUI or CHUI. For
a GUI, use Enterprise Manager (SQL 2000) or Management Studio (2005).

Thanks Ed,
but what do I need to do in Enterprise Manager? How can I delete the
file from there?
Find the database on the left-hand side, generally like so:

Console Root
+ Microsoft SQL Servers
+ SQL Server Group
+ (name of database server)
+ Databases
+ (name of database)

then right-click on the database -> All Tasks -> Detach Database

What is your company using SQL for? Is there anyone else there
who is familiar with it?


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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.