Copy MDF and LDF files while SQL running?

Posted on 2007-03-30
Last Modified: 2011-10-03
As a backup precaution, can we just copy all our SQL MDF and LDF files to another computer on the network periodically?

Can you copy these files without shutting down SQL  (ie while they are still Attached Databases).
Question by:Volibrawl
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
  • 3
  • 2
  • 2
  • +3
LVL 20

Accepted Solution

Sirees earned 150 total points
ID: 18825663
<< (ie while they are still Attached Databases).>>


You can perform backups and store them.

LVL 13

Expert Comment

ID: 18825704
Sirees is correct. Your best solution is to schedule a daily backup. If this is a critical application you need to run frequent log file backups. The more frequent your log file backups the less data you will loose in a disaster.

Author Comment

ID: 18825941
Where / how do you schedule daily backups and "frequent" log backups.  I am a novice at this ...   Is there a backup scheduling Wizard or something?

We have 2005 Management Studio.

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

LVL 13

Assisted Solution

Atlanta_Mike earned 100 total points
ID: 18826047
Easiest way is to right mouse click on the database, select the options you want (i.e. Overwrite all existincg backups etc...)

Click the Script button. Copy the script.

Go to Management > SQL Server Agent > Jobs -- Right click on Jobs, select New Job
Enter name, select category (just informational)
Select Steps, New... > Name the step
Type should be T-SQL
Paste Backup job script in command screen and select OK
Select Schedules > add New... > configure your schedule...

That should get you where you need to be.

Take advantage of Books On Line (Help) ... its very good.

Expert Comment

ID: 18827145
Nop, you can do a Maintenance Plan without more problems, with that wizard, you'll get all the jobs that you need.

Expert Comment

ID: 18827151
Well, I think that you must do a full backup of your database daily and differential backups during the day, of course, for each full backup you'll need a backup of your log and for each differential backup you'll need a log backup.
LVL 75

Expert Comment

by:Anthony Perkins
ID: 18827488
>>We have 2005 Management Studio.<<
Which Edition of SQL Server 2005 are you using?  Enterprise, Standard, Developer, Express, ...?

Author Comment

ID: 18835525

Expert Comment

ID: 21570952
try this...

CopySharp is a GUI tool for copying open/inprocess/lock files. It is inspired by robocopy and vshadow.

CopySharp V1.0 requires .Net Framework 3.5 and VC++ 2005 Runtime. CopySharp V1.0 requires Microsoft® Windows® Server 2003, Microsoft® Windows® XP.

For Example:
1. Try to backup/copy your .pst file(s), while your outlook is open.
2. Try to backup/copy your .mdf/.ldf (SQL Server) files, while your SQL Server is running.  

Locate it at:

Author Comment

ID: 21589330
Thanks  for responding  .. although I have already adopted a different backup strategy, which works fine, I appreciate the advice.

Your utilities look great ... thanks for developing them.

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

705 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