Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

trying to just copy the mdf and ldf

Posted on 2006-06-19
8
Medium Priority
?
1,005 Views
Last Modified: 2008-02-20
Im in windows explorer and im trying to just copy these to another directory so that i can delete the database in sql em....but i keep getting file in use....

How to keep copy of the mdf and ldf and delete from sql.

Detach first.........?
0
Comment
Question by:TRACEYMARY
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 93

Assisted Solution

by:Patrick Matthews
Patrick Matthews earned 400 total points
ID: 16936693
Hi TRACEYMARY,

Detach first.

Regards,

Patrick
0
 
LVL 7

Author Comment

by:TRACEYMARY
ID: 16936770
Thanks i do that ..............its ok to  reattach to any server i like in future?
0
 
LVL 9

Assisted Solution

by:sasapopovic
sasapopovic earned 800 total points
ID: 16936905
Yes, you can do the reattache from both the SQL Enterprise Manager or using stored procedure.
If you just want to copy those files to another location and use them for some other db server then you can also stop the SQL Server, copy files and start the server again.

I hope this will help you.
Regards,
Sasa
0
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 
LVL 50

Assisted Solution

by:Lowfatspread
Lowfatspread earned 400 total points
ID: 16940409
when you re-attach (particularly to a different server) you may have to sort out your user/login again...

check Books on line (BOL) for orphaned users...
0
 
LVL 4

Assisted Solution

by:csachdeva
csachdeva earned 400 total points
ID: 16940796
Tracymary,

You can use attach detach method. but there is a risk of deletionof database. So First of open Service manger from program files then Stop the services. and using operating system commands to copy the database and then start the service.

This is a safer method to take a backup of database. and then delete datbase from Enterprise manager.

Hope this will help you to sort down your problem.

Regards,
Chetan Sachdeva

0
 
LVL 7

Author Comment

by:TRACEYMARY
ID: 16941492
hmm thinking over here...which way to do this.
I got the bak files.........but i be keeping them for a long time could be a year or so...
and i am hoping i can restore from bak some day.............i wanted the mdf and ldf as i know their my physical files and i can just re attach.

I can't stop server live production........
So i just do detach ..............Copy mdf and ldf in windows explorer and then
do drop database mydatabase


Thats odd now i think about it i asked my network guy to take backup of the mdf and ldf files ...now if i cannot copy them cause they are on the server....how did he take a copy of them.....(maybe i go ask him for a printout of the tape he just gave me)...........
0
 
LVL 9

Accepted Solution

by:
sasapopovic earned 800 total points
ID: 16941806
But why don't you use backup files?
I use it always for moving database from one place to another and never use MDF & LDF combination. In my practice it showed as much better solution. You can hold that bak file for years and then restore it when you want.
The only thing that you will need to do is to remove all users from database after you restore it on other server and add those users again manually (but that is a few minutes work).

I would say: just go with the backup & restore option instead of using MDF & LDF.

btw, if one database was not accessed never from the last server start/restart then you can copy MDF and LDF files without detach or server stoping. Maybe that is how your friend did it.

I hope this will help you.
0
 
LVL 7

Author Comment

by:TRACEYMARY
ID: 16944964
Thanks...............im just going to delete it.................
the others here cannot even find the interface to access it.....

0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question