Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Full & Differential backups


Full & Differential backups

Author
Message
Abu Dina
Abu Dina
Right there with Babe
Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)

Group: General Forum Members
Points: 723 Visits: 3323
I would really appreciate it if someone could help understand the following.

I have a stored procedure to backup all user databases on an instance.

Example (D for Differential, F for FULL and L for Log
exec [sp_QB_Backup] @BackupType = 'D', @BackupFolderPath = '\\FileStoreBackup\'



I did the following the test:

1) Created a blank database called Test
2) Ran the above (failed on backing up Test database - fair enough as there isn't a full backup
3) Queried backupset table, no entries for Test DB yet.
4) Restored another database backup on top of the Test DB, rechecked backupset table, still no entry for Test DB.
5) Ran the differential backups again and it worked creating one.

But I never did a full backup of the Test DB so how can it do a differential? Is it because I restored from a FULL backup that SQL is using to work out the differential for the Test DB?

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


It takes a minimal capacity for rational thought to see that the corporate 'free press' is a structurally irrational and biased, and extremely violent, system of elite propaganda.
David Edwards - Media lens

Society has varying and conflicting interests; what is called objectivity is the disguise of one of these interests - that of neutrality. But neutrality is a fiction in an unneutral world. There are victims, there are executioners, and there are bystanders... and the 'objectivity' of the bystander calls for inaction while other heads fall.
Howard Zinn
GSquared
GSquared
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14375 Visits: 9729
It's doing a Diff on the one you restored. Obviously, that database has a restorable Full backup, since you just used it to restore the database, so it can do a Diff on it.

- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread

"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Abu Dina
Abu Dina
Right there with Babe
Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)

Group: General Forum Members
Points: 723 Visits: 3323
Hmmmm.... that's what I thought so thanks for confirming.

The reason I'm asking is because I have a job which performs daily differential backups and another which does fortnightly full backups.

So consider the following scenario:

DAY 1 - FULL Backups
Day 2 - Differential Backups
DAY 3 - NEW DATABASE added
DAY 3 - Differential Backups (will fail the job because there isn't a full backup for the new database).

So I thought I could add a check in my sproc to look for entries in the backupset table where the type is D but this won't work where a database is created then restored using a full backup from another database.
I know the differential won't fail but it would be confusing to find a differential backup in the backup folder but no full backup.

am I making sense?

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


It takes a minimal capacity for rational thought to see that the corporate 'free press' is a structurally irrational and biased, and extremely violent, system of elite propaganda.
David Edwards - Media lens

Society has varying and conflicting interests; what is called objectivity is the disguise of one of these interests - that of neutrality. But neutrality is a fiction in an unneutral world. There are victims, there are executioners, and there are bystanders... and the 'objectivity' of the bystander calls for inaction while other heads fall.
Howard Zinn
GSquared
GSquared
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14375 Visits: 9729
I build separate logging into that kind of script. It checks its own log to see if a database has had a full backup in the expected timeframe. If not, it runs one, if so, it does a Diff.

- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread

"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Abu Dina
Abu Dina
Right there with Babe
Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)

Group: General Forum Members
Points: 723 Visits: 3323
Yup... I did entertain this idea of custom logging before but I thought I'd check with you guys in case I'm duplicating unnecessary metadata. But it does make sense and it will give me more control.

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


It takes a minimal capacity for rational thought to see that the corporate 'free press' is a structurally irrational and biased, and extremely violent, system of elite propaganda.
David Edwards - Media lens

Society has varying and conflicting interests; what is called objectivity is the disguise of one of these interests - that of neutrality. But neutrality is a fiction in an unneutral world. There are victims, there are executioners, and there are bystanders... and the 'objectivity' of the bystander calls for inaction while other heads fall.
Howard Zinn
GSquared
GSquared
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14375 Visits: 9729
Because I use custom maintenance scripts, I maintain a log of "actions done per database". Rebuild some indexes? Log it. Run a backup? Log it. DBCC CHECKDB? Log it. And so on. Gives a one-stop table where all of a database's history is kept. Can get a full history for any database, or the whole server, without having to query dozens of system views.

Same database (DBA is the name of the database) has a DDL log in it for all object create/modify/drop commands. So it becomes easy to see things like, "What's the best backup to use if I want to restore to before that $%&*!@# moron dropped those tables?"

- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread

"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
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