473,774 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

delete database file on server -> sharing violation

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.

Oct 17 '07 #1
36 5107
pe******@hotmai l.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).
Oct 17 '07 #2
pe******@hotmai l.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.
Oracle is not a Microsoft product.

Given that this is Windows reboot the machine. Then delete the files.
--
Daniel A. Morgan
University of Washington
da******@x.wash ington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Oct 17 '07 #3
see sqlservr.exe

<pe******@hotma il.coma écrit dans le message de news:
11************* *********@e34g2 00...legr oups.com...
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.

Oct 17 '07 #4
On Oct 17, 3:02 pm, Ed Murphy <emurph...@soca l.rr.comwrote:
pearl...@hotmai l.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?

Oct 17 '07 #5
On Oct 17, 1:36 pm, pearl...@hotmai l.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 . . . .

Oct 17 '07 #6

pearl...@hotmai l.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...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

Oct 17 '07 #7
On Oct 17, 4:22 pm, EdStevens <quetico_...@ya hoo.comwrote:
On Oct 17, 1:36 pm, pearl...@hotmai l.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.

Oct 17 '07 #8
On Oct 17, 5:05 pm, bdbafh <bdb...@gmail.c omwrote:
pearl...@hotmai l.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.

Oct 17 '07 #9
pe******@hotmai l.com wrote:
On Oct 17, 3:02 pm, Ed Murphy <emurph...@soca l.rr.comwrote:
>pearl...@hotma il.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?
Oct 17 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8905
by: Andrew DeFaria | last post by:
I created the following .sql file to demonstrate a problem I'm having. According to the manual: If |ON DELETE CASCADE| is specified, and a row in the parent table is deleted, then InnoDB automatically deletes also all those rows in the child table whose foreign key values are equal to the referenced key value in the parent row. However:
5
13276
by: Raj | last post by:
Hi all, Can anyone help me with a script which would delete files or move them to a different folder at some scheduled time..! Please.....!!! Thanks in advance...
2
8807
by: Ryan | last post by:
I have a table in my database on SQL Server which holds a file name that refers to a file that is stored on the server. I would like to create a trigger to delete this file from the server if the row in the table is deleted. I have been trying to use this command in a trigger (<filename> is the name and path of the file): xp_cmdshell "delete <filename>" If some one could please help I would appreciate it very much. I would love a...
16
17019
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums must be UPDATED, if not, they must be INSERTED. Logically then, I would like to SELECT * FROM <TABLE> WHERE ....<Values entered here>, and then IF FOUND UPDATE <TABLE> SET .... <Values entered here> ELSE INSERT INTO <TABLE> VALUES <Values...
6
2586
by: I am Sam | last post by:
I keep getting this error and I don't know why: The path is too long after being fully qualified. Make sure path is less than 260 characters. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.IO.PathTooLongException: The path is too long
3
2102
by: John Rivers | last post by:
Hello, I think this will apply to alot of web applications: users want the ability to delete a record in table x this record is related to records in other tables and those to others in other tables etc. in other words we must use cascade delete to do
1
2363
by: nasirmajor | last post by:
dear all, Please any urgent help regarding following code. i have the following code ================================================================= public void Delete(Object sender, DataGridCommandEventArgs e) { 1 int Sid2 = (int)l.DataKeys;
6
3858
by: polocar | last post by:
Hi, I'm writing a program in Visual C# 2005 Professional Edition. This program connects to a SQL Server 2005 database called "Generations" (in which there is only one table, called "Generations"), and it allows the user to add, edit and delete the various records of the table. "Generations" table has the following fields: "IDPerson", NamePerson", "AgePerson" and "IDParent". A record contains the information about a person (his name, his...
4
25181
by: Sailor1877 via AccessMonster.com | last post by:
I've been reading all the threads about problems with LDB files but my specific problem doesn't seem to be addressed. I have a back end database on a server that I'm unable to run Compact and Repair on because the LDB file is still present. It tells me it is being used by a user "Admin" on my machine (a fact that is echoed when I open the LDB file in Notepad.) Unfortunately there is no username "Admin" on the network. When I try to...
7
2530
by: marce1972 | last post by:
Hi to all, that's my question I have mysql database and a web page to upload files to my webpage, I know how to delete them from the database, but didnt find the code to delete them from the web server. Please help me with this code. Regards Marcelo Fabiani
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10040
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9914
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7463
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6717
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.