Solved

How can I backup an entire database in MS SQL Server Express 2005?

Posted on 2008-06-25
6
227 Views
Last Modified: 2010-04-21
I have a copy of MS SQL Server 2005 Express Edition that is running on database engine at this time.

Included in this instance is about 100 seperate databases.  I need to automate a way to back these databases on a nightly basis and because I am using SQL Express I do not have access to SQL Server Agent to automate this.

Any help is appreciated.
0
Comment
Question by:hyphenpipe
  • 3
  • 2
6 Comments
 
LVL 6

Author Comment

by:hyphenpipe
ID: 21865078
I did find this article which looks promising:

http://www.mssqltips.com/tip.asp?tip=1174

But I need to backup about 100 databases and I am adding more all the time so I need it to be dynamic without me having to go an modify the SQL command every time I add a new database.

Also, I am am unsure as to how this tutorial handles attached databases that may have open connections to them.

Can anyone clear that up for me?
0
 
LVL 7

Expert Comment

by:dineesh
ID: 21865095
hi,

is there a time when you can stop the SQL services for some time depending on your database size?

in that case you can write a vbscript to stop the sql service and copy the physical files from the data folder into another path.

else try this too..

use ntbackup - Start -> Programs -> Accessiories -> System Tools -> Backup

and backup the data folder, that does a volume shadow copy, once you have a backup, try to restore on another system with SQL Express and Attach the database and point it to the data files.

if that works then you can automate it from scheduler.
0
 
LVL 60

Expert Comment

by:chapmandew
ID: 21865126
try this:

exec sp_MSforeachdb 'BACKUP DATABASE [?] TO DISK
=N''d:\mssqldata\MSSQL\BACKUP\[?]_Backup.bak'', INIT'
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 6

Author Comment

by:hyphenpipe
ID: 21865231
I just realized I only need to back up one database in the instance.  The other databases just contain views that point the this one.

If there was a way to do this while users are online, that would be sweet.
0
 
LVL 60

Accepted Solution

by:
chapmandew earned 500 total points
ID: 21865238
sure...you can backup w/ users online:

backup database yourdbname
to disk = 'c:\backupfile.bak' with init
0
 
LVL 6

Author Closing Comment

by:hyphenpipe
ID: 31470945
Thanks for clearing that up.  Wasn;t sure if I could back it up with users online, but it works fine.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now