SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Extremely Quick Backups


Extremely Quick Backups

Author
Message
Steve Jones
Steve Jones
SSC Guru
SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)

Group: Administrators
Points: 562767 Visits: 20830
Comments posted to this topic are about the item Extremely Quick Backups

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
sqldoubleg
sqldoubleg
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2814 Visits: 1385
Be careful with this command in production as you 'break' the log chain if in full or bulk logged recovery models.
You can still use it specifying WITH COPY_ONLY though.
Rune Bivrin
Rune Bivrin
SSCertifiable
SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)

Group: General Forum Members
Points: 6396 Visits: 1753
Interesting. If you look in the linked documentation, you're led to believe that the ... FILE = NUL syntax (without the single quotes) is the correct one, but clearly that doesn't work in practice.


Just because you're right doesn't mean everybody else is wrong.
michaelf.fitzpatrick
michaelf.fitzpatrick
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1917 Visits: 177
Rune Bivrin - Friday, January 12, 2018 12:32 AM
Interesting. If you look in the linked documentation, you're led to believe that the ... FILE = NUL syntax (without the single quotes) is the correct one, but clearly that doesn't work in practice.

Yes..
https://docs.microsoft.com/en-us/sql/t-sql/statements/backup-transact-sql
This states NUL (not 'NUL')

{ DISK | TAPE | URL} = { 'physical_device_name' | @physical_device_name_var | NUL }

Stewart "Arturius" Campbell
Stewart "Arturius" Campbell
SSC Guru
SSC Guru (56K reputation)SSC Guru (56K reputation)SSC Guru (56K reputation)SSC Guru (56K reputation)SSC Guru (56K reputation)SSC Guru (56K reputation)SSC Guru (56K reputation)SSC Guru (56K reputation)

Group: General Forum Members
Points: 56987 Visits: 7960
Interesting question to end the week on, thanks Steve.
However, I wonder why anyone would need to do this (other than obtaining a benchmark)?

____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
sqldoubleg
sqldoubleg
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2814 Visits: 1385
Stewart "Arturius" Campbell - Friday, January 12, 2018 2:39 AM
Interesting question to end the week on, thanks Steve.
However, I wonder why anyone would need to do this (other than obtaining a benchmark)?

The only use case I have for this, it is when you need to have databases in full recovery model, but you don't care about point in time recovery (sounds crazy, but keep reading), for instance if you have Availability Groups/Mirroring in DEV but you don't really care about transaction logs, you can clear the log using TO DISK = 'NUL'

Cheers

sknox
sknox
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10461 Visits: 3343
sqldoubleg - Friday, January 12, 2018 4:09 AM
Stewart "Arturius" Campbell - Friday, January 12, 2018 2:39 AM
Interesting question to end the week on, thanks Steve.
However, I wonder why anyone would need to do this (other than obtaining a benchmark)?

The only use case I have for this, it is when you need to have databases in full recovery model, but you don't care about point in time recovery (sounds crazy, but keep reading), for instance if you have Availability Groups/Mirroring in DEV but you don't really care about transaction logs, you can clear the log using TO DISK = 'NUL'

Cheers

Doesn't sound crazy to me -- we have a Data Warehouse in an Availability Group in production, and that's exactly what we use this for. We have full or differential backups to recover us to any particular day's file load, and we have to keep the original files for other purposes, so we can always reload them if necessary.

Bobby Russell
Bobby Russell
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2147 Visits: 568
This really should include the WITH COPY_ONLY in the command. Not using this breaks your backup chain.
Steve Jones
Steve Jones
SSC Guru
SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)

Group: Administrators
Points: 562767 Visits: 20830
Bobby Russell - Friday, January 12, 2018 8:29 AM
This really should include the WITH COPY_ONLY in the command. Not using this breaks your backup chain.


That's not always a concern for some people.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Steve Jones
Steve Jones
SSC Guru
SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)SSC Guru (562K reputation)

Group: Administrators
Points: 562767 Visits: 20830
You can also use this with AGs. Create the db, do a nul backup, start direct seeding.

It is useful to eliminate disk/network as a backup bottleneck if you need to test a system as well. If this is a production dB, then you do want copy_only if you need an intact chain.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search