Wednesday, March 21, 2012

Saving .mdf database

Hello,
I use SQL Server 2005 Express and I would like
to save on db of mine...
Have I only to save the .mdf and .ldf data file
or I need to stop some service or other programs?
Can I use some utility to schedule this?
Thanks
M.Maury (maurizio.alberti_TOGLI_@.gmail.com) writes:
> I use SQL Server 2005 Express and I would like
> to save on db of mine...
> Have I only to save the .mdf and .ldf data file
> or I need to stop some service or other programs?
> Can I use some utility to schedule this?

I'm not sure that I understand. What would the purpose be for this
operation? It sounds to like you are looking for the BACKUP command.
Which will not save your .mdf and .ldf files, but save a consistent
backup of the database.

Normally, you should leave the .mdf and .ldf files alone.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||I agree with Erland, you could either make a *hot* backup which can be
done via the BACKUP command, or you can use a *cold* backup, wih
stopping the services of SQL Server and copying the files somewhere on
your backup storage. Stopping the services puts up the need to have a
maintainance window, because noone will be able to access the database
during this time. Otherwise its a bit faster to just save away your
data.

HTH, jens Suessmeyer.

--
http://www.sqlserver2005.de
--|||"Maury" <maurizio.alberti_TOGLI_@.gmail.com> wrote in message
news:gCn_f.75203$PR2.1228292@.twister2.libero.it...
> Hello,
> I use SQL Server 2005 Express and I would like
> to save on db of mine...
> Have I only to save the .mdf and .ldf data file
> or I need to stop some service or other programs?
> Can I use some utility to schedule this?

Most likely you want to issue a command like:

BACKUP DATABASE <dbname> to disk='x:=\backups\dbname_yyyymmdd.bak'

Look up details in Books Online.

If you really want to take the DB off line, do a NET STOP command and then
back up the files followed by NET START.

(I'm not sure of the SQL Server Express service name since I can't get it to
install on my desktop.)

> Thanks
> M.|||Thanks for these three answers,
I found all very useful.
I thank you very much for your help

Bye
M.

No comments:

Post a Comment