Need Tutorial on Differential Backup

  • Seggerman-675349

    Hall of Fame

    Points: 3503

    I need to backup a SQL Server 2016 database weekly – and take incremental backups daily
    I found this snippet:
    — Create a full database backup first.
    BACKUP DATABASE MyAdvWorks
     TO MyAdvWorks_1
    WITH INIT
    GO

    — Time elapses.

    — Create a differential database backup, appending the backup
    — to the backup device containing the full database backup.

    BACKUP DATABASE MyAdvWorks
     TO MyAdvWorks_1
     WITH DIFFERENTIAL
    GO
    well, the database device still points to the same backup file, right?  so shouldn’t there be a step to remove MyAdvWorks_1 and point it to a different backup file each time?  everything is on disk – no tapes involved

    could someone help me with the missing steps?  much obliged
    also the production restore

    a newbie DBA, not by choice!

  • Alejandro Santana

    SSCommitted

    Points: 1574

    Hello there.

    I recommend using Ola Hallengren script tools for database backup.
    https://ola.hallengren.com/sql-server-backup.html

    There’s all the documentation you need.
    Including full, differentials and transaction log, you can tweak it to fit your needs too.

    To get where you want to go, you’ll need to tweak these scripts and make jobs exactly whenever you want them to execute.

    Of course you can build your own scripts too and even learn from Ola’s scripts.

  • AlexSQLForums

    SSChampion

    Points: 14234

    please follow this article
    https://www.red-gate.com/simple-talk/sql/backup-and-recovery/sql-server-2014-backup-basics/

    Alex S
  • Gail Shaw

    SSC Guru

    Points: 1004424

    I strongly recommend NOT appending backups to the same file. Makes it really easy to lose all your backups instead of one.
    Each one to its own file, preferably with the datetime as part of the file name

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Seggerman-675349

    Hall of Fame

    Points: 3503

    thanks folks but it doesn’t quite answer my question
    do I  create a full backup to a device – and set the device through T-SQL so the file name has a date as part of it
    drop the device and recreate with a new name the indicates it is a diff
    run a differential backup
    is this workable?
    if I create backups to disk will it automatically create a differential backup ?

    thanks

  • Gail Shaw

    SSC Guru

    Points: 1004424

    No. Backup to a file. Ignore devices.

    BACKUP DATABASE DBName
    TO DISK =  <file name here>

    The file name can be a variable, so you can build up the string with the  date.

    If you create backups to disk, it’ll create exactly the type of backup you specify. Want a differential, specify WITH DIFFERENTIAL

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Alejandro Santana

    SSCommitted

    Points: 1574

    Seggerman-675349 - Monday, February 26, 2018 1:04 PM

    thanks folks but it doesn't quite answer my question
    do I  create a full backup to a device - and set the device through T-SQL so the file name has a date as part of it
    drop the device and recreate with a new name the indicates it is a diff
    run a differential backup
    is this workable?
    if I create backups to disk will it automatically create a differential backup ?

    thanks

    This is a script i made using Adventure Works when i was learning.:
    First part is FULL Backup
    Second one is Differential backup – you can see WITH DIFFERENTIAL
    Third one is Log Backup it explicitly states that it is one.


    –This is the full backup part
    –Full backup, Keeps the changes of the database to a point in time
    backup database [AdventureWorks2012]
    TO DISK = N’E:\BACKUPS\AVWFULL181217.bak’–direccion donde se almacenara el full
    WITH NOFORMAT,
    NOINIT,
    NAME =N’ADVENTUREWORKS2012FULLDBBACKUP’,
    DESCRIPTION=’BACKUP AL DIA 18-12-2017′,
    SKIP,
    NOREWIND,
    NOUNLOAD,STATS=10
    GO
    –Differential backup, Keep the changes made to the database till the last full backup
    BACKUP DATABASE [AdventureWorks2012]
    TO DISK = N’E:\BACKUPS\AVWDIFF181217.bak’ –direccion donde se almacenara el differential
    WITH DIFFERENTIAL, –diciendo explicitamente que tipo de backup es, aqui podemos ver que es un diferencial
    NOFORMAT,
    NOINIT,
    NAME = N’AdventureWorks2012-Differential Database Backup’,
    SKIP,
    NOREWIND,
    NOUNLOAD,
    STATS = 10
    GO

    –Transaction log backup, Keeps the changes made to the database until the last differential
    BACKUP LOG [AdventureWorks2012]
    TO DISK = N’E:\BACKUPS\AVWLOG181217.bak’–direccion donde se almacenara el transaccional
    WITH NOFORMAT,
    NOINIT,
    NAME = N’AdventureWorks2012-Log Backup’,
    SKIP,
    NOREWIND,
    NOUNLOAD,
    STATS = 10
    GO

    Sorry for the spanish comments its my native language.

    As Gail said before you can also declare variables as backupdate as DATE and pass getdate() as result and build a script that creates name for your backup.
    Theres an example in the website below.
    https://solutioncenter.apexsql.com/create-daily-database-backups-with-unique-names-in-sql-server/

  • Seggerman-675349

    Hall of Fame

    Points: 3503

    yes, that is what I needed – thanks folks

  • Jeff Moden

    SSC Guru

    Points: 993401

    Seggerman-675349 - Monday, February 26, 2018 1:58 PM

    yes, that is what I needed - thanks folks

    Not quite.  It’s a good example of the 3 types of backups but you need to write it as dynamic SQL so that you can change the file names over time.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
    "If you think its expensive to hire a professional to do the job, wait until you hire an amateur."--Red Adair
    "Change is inevitable... change for the better is not."
    When you put the right degree of spin on it, the number 3|8 is also a glyph that describes the nature of a DBAs job. 😉

    Helpful Links:
    How to post code problems

  • Gail Shaw

    SSC Guru

    Points: 1004424

    Jeff Moden - Monday, February 26, 2018 4:07 PM

    Seggerman-675349 - Monday, February 26, 2018 1:58 PM

    yes, that is what I needed - thanks folks

    Not quite.  It's a good example of the 3 types of backups but you need to write it as dynamic SQL so that you can change the file names over time.

    No you don’t.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Seggerman-675349

    Hall of Fame

    Points: 3503

    SET @Filename =’C:\bak\PowerHouse_’ + CONVERT(VARCHAR(8),GetDate(),112) + ‘.bak’

  • Jeff Moden

    SSC Guru

    Points: 993401

    GilaMonster - Tuesday, February 27, 2018 1:02 AM

    Jeff Moden - Monday, February 26, 2018 4:07 PM

    Seggerman-675349 - Monday, February 26, 2018 1:58 PM

    yes, that is what I needed - thanks folks

    Not quite.  It's a good example of the 3 types of backups but you need to write it as dynamic SQL so that you can change the file names over time.

    No you don't.

    data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAnQAAAC7CAIAAABjKpTQAAAbVklEQVR4nO2dP4/kuJmH+T2cN3DxKunEweYV+gusgP4GlS42mmQgNLDBZIuKHE3kXagzYyIndmceYL3V4QDnncXhcOfEyQG8QBL1knwpUSWq/vQ8D17MdKkoinxJ8UdSKtLYf/2AYRiGYVhBM//5z1+Xmu3495/sf38z2r//ZAEAAMBaxBUAAKAwiCsAAEBhENcZjk1ljDHGVM0xJ2jdjgfaujvVOwgpPr7/7v3HQnF9/vDu3YfPhSIbOTbWGHtKaR5tddqJy6mNNebUdG7B2fLeWlOf4TLb5GhlnGesYAr5nk+n8/Sb60opL65/TNOf2Pb3ftACtPX88U7gjo2tGi03rTXG+6o24bkTF4o5NtUgqsem6jXSSWaom5G4Wv/Ei9NU1ktJa01lj+7vDNfZuDhkJMElsuO01n7+8M6TVtepkb2a/IPWfnz/XTmtdrTpKjvXuLS1DerBotOXccGmVrv02rxnZuds4qrlKNWu5bK6yJQkrY+2uOcnImxP8tv1som4qlfyxHVojmVnRa0bTaWUWkpc29o2ra1EW18LPXYX1SuhGl+gnXUbHZ3lisT12HjObOvRjZmuU4ojLa6ZcVqrSmsfjejftLXru/hdnehgx8f33xUfvfq5lR5Ua6rH0fPF4tMXcWXiujbv1yeucY7k1dt6eUrWF1mcpPXRnllc4/TfMBcWV2ttU/V3maJ5iYJIiWtd2aO1TTWOilxrLqPKFNdjU1XN0Q1U67atq+aYENf0DHAkruNIyx1va1M30fyzHCJ3IY9NVTVNbYzp/5O6kjEF7fuzFsPHLNepxZEW18zisNMy6NSzrZ1ruuzWbeLgQCjZxZEK0WUpmB4JnCV9MXF61+WUAyB3k3TU6ZAyNr/WRSFba2rbVN5MQlPZpuknHGoROP90OXoLakZO3uto8JeKMw7ZJcmNiWW1i70kc+R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pbdVwzWyF+6hV8i4rXiOh6Z798mZudveU/DqXGFfva0V7PXb7+CfRIVcV22h0xO30VOCouNeE5xsh9pRmVI1LrczelSdWmhkydcubzapO93tThyyqiPxv8v0dJ2cYa5XlMcal5Ws524uvwHE6rdVMyztteV2lFO/Jk/hFcqgpokJQepkNnZTOy0JZ655penMuwfeyHqEw314Mot/PQQWpKyYxsSu9s/z3nDu8H8zv+t7mmoXsKrIK7SeZFqTZhybH7kGvnzvPskrhDX7O0g/aS6CSbFyX7s2ZOEU5UhVeu0EZOS94y6lPl8ybvgZF2aj3D0nWjV9Hdn8soo0c1LPGPLfM0mvzjCvBRhw7eFvdd6+w6934MIekn+ZKl48Bqviq8/T1MIOi+7g00nKZqCSIRUNtpKxanttBW+LZzxvm0QTu6KpTz9El5RD+busKZfXd+ET0nSkq2yXBwzlVvd12/m7W15cAuH6B1+8TRgck/DROqVjeD8SOMMpXryM1ObF9wnUasMCzZo02ui+ya8dNyKaE5O+zNyXX5l0GqdUj9TeVfqUr6TRf6DyZEo715ao2eUYZ95wpuJe3P+Jug7d8OHVGuh9s3XFYdNqb9al/Lgd65wLWQ8YSv+Qt8XDvskfkG8lptn8Z7wudEWHbZaxBWugVQvOhWMtr0IC/3pOvy4H2AexBUAAKAwiCsAAEBhEFcAAIDCIK4AAACFQVwBAAAKg7gCAAAUBnEFAAAoDOIKAABQmP8HxMFoJvf3Q2IAAAAASUVORK5CYIIA

    Oh my… bad habits are hard to break.  I’m not sure why I’ve been doing it with dynamic SQL all these years and never thought to try otherwise.  Thanks, Gail.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
    "If you think its expensive to hire a professional to do the job, wait until you hire an amateur."--Red Adair
    "Change is inevitable... change for the better is not."
    When you put the right degree of spin on it, the number 3|8 is also a glyph that describes the nature of a DBAs job. 😉

    Helpful Links:
    How to post code problems

  • Perry Whittle

    SSC Guru

    Points: 233658

    my article below details differential backups and log shipping, but it should give you an insight into what diffs are

    http://www.sqlservercentral.com/articles/differential/93482/

    -----------------------------------------------------------------------------------------------------------

    [font="Tahoma"]"Ya can't make an omelette without breaking just a few eggs"[/font] 😉

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

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