Saving .mdf database

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Maury

    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.
  • Erland Sommarskog

    #2
    Re: Saving .mdf database

    Maury (maurizio.alber ti_TOGLI_@gmail .com) writes:[color=blue]
    > 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?[/color]

    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@sommarsk og.se

    Books Online for SQL Server 2005 at

    Books Online for SQL Server 2000 at

    Comment

    • Jens

      #3
      Re: Saving .mdf database

      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.

      ---

      ---

      Comment

      • Greg D. Moore \(Strider\)

        #4
        Re: Saving .mdf database


        "Maury" <maurizio.alber ti_TOGLI_@gmail .com> wrote in message
        news:gCn_f.7520 3$PR2.1228292@t wister2.libero. it...[color=blue]
        > 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?[/color]

        Most likely you want to issue a command like:

        BACKUP DATABASE <dbname> to disk='x:=\backu ps\dbname_yyyym mdd.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.)

        [color=blue]
        > Thanks
        > M.[/color]


        Comment

        • Maury

          #5
          Re: Saving .mdf database

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

          Bye
          M.

          Comment

          Working...