backup

  • My sql srver job for sql backup every time appending the backup file and 4 GB database size backup now is 108 GB.Please tell which option i can use for create another file daily , the backup file should not append or delete the first one,it should create another backup file daily.

  • You must change the backup file name in your BACKUP instruction.

    For example, add the date to the backup file name

  • Or use INIT and FORMAT with the backup command to make it always be a single file instead of a series of files stacked together.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • I use both of the above suggestions. The standard backup filename always contains the date and the SQL command that performs the backup contains WITH INIT to ensure the backup stands alone. I know this may not be applicable to all environments, but I like to keep things simple with one backup per file.

  • Hey Ed, make sure you use FORMAT in addition to the INIT statement. INIT doesn't rewrite the header, so if you ever do modify the backup being done in some fashion you could end up with a backup that can't be restored. I just found out about this one myself recently.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Grant Fritchey (1/21/2014)


    Hey Ed, make sure you use FORMAT in addition to the INIT statement. INIT doesn't rewrite the header, so if you ever do modify the backup being done in some fashion you could end up with a backup that can't be restored. I just found out about this one myself recently.

    Interesting...thank you, Grant. I read the MSDN descriptions of them and INIT replaces any backup sets, but preserves an existing media header on the device. FORMAT specifies that the media header should be rewritten.

    I'm interpreting this to mean that when I take a full backup of each database to its own unique file on disk and never share backup files, then there's never a media header to rewrite. Am I reading this correctly? Or did I miss something?

  • Ed Wagner (1/21/2014)


    Grant Fritchey (1/21/2014)


    Hey Ed, make sure you use FORMAT in addition to the INIT statement. INIT doesn't rewrite the header, so if you ever do modify the backup being done in some fashion you could end up with a backup that can't be restored. I just found out about this one myself recently.

    Interesting...thank you, Grant. I read the MSDN descriptions of them and INIT replaces any backup sets, but preserves an existing media header on the device. FORMAT specifies that the media header should be rewritten.

    I'm interpreting this to mean that when I take a full backup of each database to its own unique file on disk and never share backup files, then there's never a media header to rewrite. Am I reading this correctly? Or did I miss something?

    No, you didn't miss anything, but I'm a belts & suspenders kind of guy. Just because you're not rewriting the header doesn't mean you'll never rewrite the header and having it built right in doesn't hurt anything on a one-off backup... You're fine your way, but it's a good thing to know.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Grant Fritchey (1/21/2014)


    Ed Wagner (1/21/2014)


    Grant Fritchey (1/21/2014)


    Hey Ed, make sure you use FORMAT in addition to the INIT statement. INIT doesn't rewrite the header, so if you ever do modify the backup being done in some fashion you could end up with a backup that can't be restored. I just found out about this one myself recently.

    Interesting...thank you, Grant. I read the MSDN descriptions of them and INIT replaces any backup sets, but preserves an existing media header on the device. FORMAT specifies that the media header should be rewritten.

    I'm interpreting this to mean that when I take a full backup of each database to its own unique file on disk and never share backup files, then there's never a media header to rewrite. Am I reading this correctly? Or did I miss something?

    No, you didn't miss anything, but I'm a belts & suspenders kind of guy. Just because you're not rewriting the header doesn't mean you'll never rewrite the header and having it built right in doesn't hurt anything on a one-off backup... You're fine your way, but it's a good thing to know.

    Good deal. Thanks for the information; it never hurts to know more, until your brain hits critical mass anyway. 😛

Viewing 8 posts - 1 through 7 (of 7 total)

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