MDF & LDF Backup Process

  • Hi,

    I need some guidance in the database files backup methodology. I want to backup the mdf and ldf files (both from the enterprise manager and query analyzer). I tried both but could not succeed. I tried the following statement from query analyzer:

    Backup Database Pubs

    File = 'D:\Data\pubs.mdf'

    to disk = 'G:\Share\pubs.mdf'

    I am getting the error as

    Logical file 'D:\Data\pubs.mdf' is not part of the database pubs. Use restore filelistonly to list the logical filenames.

    Backup database is terminating abnormally.

    Am i missing anything in the above statement.

    Any guidance on this area will be helpful for my learning.

  • You can't use Backup command to backup MDF/LDF alone. You have to backup the database as following.

    backup database pubs to disk = 'g:\share\pubs.bak'.

    If you really want to backup MDF and LDF files, you have to either shutdown SQL Server or detach the database, use Copy command to copy the MDF/LDF files to somewhere else.

    Some backup software comes with SQL Server Agent and open file manager component that allow you to backup the MDF/LDF files when they are in use.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply