显示标签为“differential”的博文。显示所有博文
显示标签为“differential”的博文。显示所有博文

2012年3月29日星期四

full, differential, transaction hwo to rotate the differential?

Being of the "point and click"-generation I managed to create some sort of a fairly simple backup plan for our databases. There are hourly transactional backups and daily full backups, which were set up with a database maintenance plan. As the databases store event records they are ever increasing around the hour. The daily backups are now of a size that holding them is not feasable anymore and I want to move to a differential backup scheme:

Weekly full backups

Daily differential backups

Hourly transactional log backups

The problem I have is that the database maintenance plans allow me to rotate backup files automatically as they included the date and time of the backup. For differential backups there is no option in the Database Maintenance plan so I want to create them manually. The problem now is that I can create one device, append the differential backup to it. But how do I rotate the differential backup device name, let's say bi-weekly?

(untested):

1. script out the diff backup plan.
2. create a sql job that runs every 2 week that drops the diff plan, creates a new one with the desired device name.|||

Do you mean with the SQL-DMO? Or is there another way

oj wrote:

(untested):

1. script out the diff backup plan.
2. create a sql job that runs every 2 week that drops the diff plan, creates a new one with the desired device name.

|||

So basically I have no clue

1) how to script out a diff backup plan

2) how to create a sql job that drops the diff plan, creates a new one with the desired device name.

|||

I am not in front of a sqlserver so can't verify. but if:

1. create a differential backup job just as you would normally.

2. go to sql jobs under sqlagent, right click on the job and script it out. This is where you get the definition for the diff job (i.e. job id, name, steps, etc.).

3. take note of the step id and steps definition.

4. create a new sql job that runs every 4 week. In the jobstep definition for this new job (say, switchdevice), you'd want to execute

sp_update_jobstep @.jobname='the_diff_jobname',@.stepid=<the stepid of the diff job>,@.command='new_backup_command_pointing_to_a_desired_device'

5. create another job that does the same thing as the #4 but with a different device name. Be sure to schedule 2 weeks before or after the job in #4.

With the combo of #4 and #5, you essentially have a device name changed every 2 week.

|||thanks for your elaborat answer oj. one thing is still puzzling me. If I create the diff backup to append to the device it will append even after switching. So the device will be ever growing. We can live with a device per week and manually cleanup old one's. Would you know a way to automatically generate these devices? Or should I stop trying and just create them by hand?|||

You can take a look at sp_addumpdevice and sp_dropdevice in sql book online.

Cheers,

|||

Ok, Thanks for the support here. What we end up doing is the following:

We've created two backup devices per database

Two bi-weekly (every odd/even week) scheduled job performs a full back with INIT
BACKUP DATABASE base
TO base_wk<n>
WITH INIT

A daily job backs up a differential
BACKUP DATABASE base
TO base_wk<n>
WITH DIFFERENTIAL

Every half hour a transaction log back is performed
BACKUP LOG base
TO base_wk<n>

In each case <n> is either 1 or 0 for odd and even weeks. Numerous links I've found on backups seem to fail to see the real possibility that during a full backup due to a hardware failure both database and backup are lost, not really disastor save, which backing up is all about.

So there are in total three scheduled jobs: one weekly, one daily and one every half hour. schedule in bi-weekly intervals writing to base_wk0 and base_wk1 alternatively. Furthermore for historic reasons a monthly full backup is scheduled using the wizard which stores a unique backup file for every month.

Let the disastors happen...

full, differential, transaction hwo to rotate the differential?

Being of the "point and click"-generation I managed to create some sort of a fairly simple backup plan for our databases. There are hourly transactional backups and daily full backups, which were set up with a database maintenance plan. As the databases store event records they are ever increasing around the hour. The daily backups are now of a size that holding them is not feasable anymore and I want to move to a differential backup scheme:

Weekly full backups

Daily differential backups

Hourly transactional log backups

The problem I have is that the database maintenance plans allow me to rotate backup files automatically as they included the date and time of the backup. For differential backups there is no option in the Database Maintenance plan so I want to create them manually. The problem now is that I can create one device, append the differential backup to it. But how do I rotate the differential backup device name, let's say bi-weekly?

(untested):

1. script out the diff backup plan.
2. create a sql job that runs every 2 week that drops the diff plan, creates a new one with the desired device name.|||

Do you mean with the SQL-DMO? Or is there another way

oj wrote:

(untested):

1. script out the diff backup plan.
2. create a sql job that runs every 2 week that drops the diff plan, creates a new one with the desired device name.

|||

So basically I have no clue

1) how to script out a diff backup plan

2) how to create a sql job that drops the diff plan, creates a new one with the desired device name.

|||

I am not in front of a sqlserver so can't verify. but if:

1. create a differential backup job just as you would normally.

2. go to sql jobs under sqlagent, right click on the job and script it out. This is where you get the definition for the diff job (i.e. job id, name, steps, etc.).

3. take note of the step id and steps definition.

4. create a new sql job that runs every 4 week. In the jobstep definition for this new job (say, switchdevice), you'd want to execute

sp_update_jobstep @.jobname='the_diff_jobname',@.stepid=<the stepid of the diff job>,@.command='new_backup_command_pointing_to_a_desired_device'

5. create another job that does the same thing as the #4 but with a different device name. Be sure to schedule 2 weeks before or after the job in #4.

With the combo of #4 and #5, you essentially have a device name changed every 2 week.

|||thanks for your elaborat answer oj. one thing is still puzzling me. If I create the diff backup to append to the device it will append even after switching. So the device will be ever growing. We can live with a device per week and manually cleanup old one's. Would you know a way to automatically generate these devices? Or should I stop trying and just create them by hand?|||

You can take a look at sp_addumpdevice and sp_dropdevice in sql book online.

Cheers,

|||

Ok, Thanks for the support here. What we end up doing is the following:

We've created two backup devices per database

Two bi-weekly (every odd/even week) scheduled job performs a full back with INIT
BACKUP DATABASE base
TO base_wk<n>
WITH INIT

A daily job backs up a differential
BACKUP DATABASE base
TO base_wk<n>
WITH DIFFERENTIAL

Every half hour a transaction log back is performed
BACKUP LOG base
TO base_wk<n>

In each case <n> is either 1 or 0 for odd and even weeks. Numerous links I've found on backups seem to fail to see the real possibility that during a full backup due to a hardware failure both database and backup are lost, not really disastor save, which backing up is all about.

So there are in total three scheduled jobs: one weekly, one daily and one every half hour. schedule in bi-weekly intervals writing to base_wk0 and base_wk1 alternatively. Furthermore for historic reasons a monthly full backup is scheduled using the wizard which stores a unique backup file for every month.

Let the disastors happen...

full, differential, transaction hwo to rotate the differential?

Being of the "point and click"-generation I managed to create some sort of a fairly simple backup plan for our databases. There are hourly transactional backups and daily full backups, which were set up with a database maintenance plan. As the databases store event records they are ever increasing around the hour. The daily backups are now of a size that holding them is not feasable anymore and I want to move to a differential backup scheme:

Weekly full backups

Daily differential backups

Hourly transactional log backups

The problem I have is that the database maintenance plans allow me to rotate backup files automatically as they included the date and time of the backup. For differential backups there is no option in the Database Maintenance plan so I want to create them manually. The problem now is that I can create one device, append the differential backup to it. But how do I rotate the differential backup device name, let's say bi-weekly?

(untested):

1. script out the diff backup plan.
2. create a sql job that runs every 2 week that drops the diff plan, creates a new one with the desired device name.|||

Do you mean with the SQL-DMO? Or is there another way

oj wrote:

(untested):

1. script out the diff backup plan.
2. create a sql job that runs every 2 week that drops the diff plan, creates a new one with the desired device name.

|||

So basically I have no clue

1) how to script out a diff backup plan

2) how to create a sql job that drops the diff plan, creates a new one with the desired device name.

|||

I am not in front of a sqlserver so can't verify. but if:

1. create a differential backup job just as you would normally.

2. go to sql jobs under sqlagent, right click on the job and script it out. This is where you get the definition for the diff job (i.e. job id, name, steps, etc.).

3. take note of the step id and steps definition.

4. create a new sql job that runs every 4 week. In the jobstep definition for this new job (say, switchdevice), you'd want to execute

sp_update_jobstep @.jobname='the_diff_jobname',@.stepid=<the stepid of the diff job>,@.command='new_backup_command_pointing_to_a_desired_device'

5. create another job that does the same thing as the #4 but with a different device name. Be sure to schedule 2 weeks before or after the job in #4.

With the combo of #4 and #5, you essentially have a device name changed every 2 week.

|||thanks for your elaborat answer oj. one thing is still puzzling me. If I create the diff backup to append to the device it will append even after switching. So the device will be ever growing. We can live with a device per week and manually cleanup old one's. Would you know a way to automatically generate these devices? Or should I stop trying and just create them by hand?|||

You can take a look at sp_addumpdevice and sp_dropdevice in sql book online.

Cheers,

|||

Ok, Thanks for the support here. What we end up doing is the following:

We've created two backup devices per database

Two bi-weekly (every odd/even week) scheduled job performs a full back with INIT
BACKUP DATABASE base
TO base_wk<n>
WITH INIT

A daily job backs up a differential
BACKUP DATABASE base
TO base_wk<n>
WITH DIFFERENTIAL

Every half hour a transaction log back is performed
BACKUP LOG base
TO base_wk<n>

In each case <n> is either 1 or 0 for odd and even weeks. Numerous links I've found on backups seem to fail to see the real possibility that during a full backup due to a hardware failure both database and backup are lost, not really disastor save, which backing up is all about.

So there are in total three scheduled jobs: one weekly, one daily and one every half hour. schedule in bi-weekly intervals writing to base_wk0 and base_wk1 alternatively. Furthermore for historic reasons a monthly full backup is scheduled using the wizard which stores a unique backup file for every month.

Let the disastors happen...

sql

2012年2月26日星期日

Full or Diff backup impact on Log size?

I have a question regarding FUll and differential backup.

We we take full or diff back up, does it create lot of logs ie. Does full or diff backup has any impact on log size?

Thanks

No, not in my experience.|||The backup itself will not add much to the log, but it will hold up log truncation for the duration of the backup so that if there is a lot of other activity being logged by other users during the backujp, the log can become increasingly full. Once the backup is done, the log should be able to truncate as usual (for SIMPLE recovery mode.)|||Thanks for the replies.
So taking full or diff backup does not create additional logs?. It will be just the logs of incoming transactions (not any additional logs because of full or diff backup)?

Thanks
|||That's correct.

2012年2月24日星期五

Full Database Back and Diffrential Database Backup

I have one full database back and 4 differential database backup.
(Recovery model is simple) In the recovery process, I have restored the
full database backup with No_recovery option. After that should i
restore all the 4 differential backup or the most recent differential
backup? Please explain.
RegardsHi
http://vyaskn.tripod.com/sql_server_administration_best_practices.htm#Step1
--administaiting best practices
"Praveen" <apveen@.gmail.com> wrote in message
news:1143010815.337892.295070@.e56g2000cwe.googlegroups.com...
>I have one full database back and 4 differential database backup.
> (Recovery model is simple) In the recovery process, I have restored the
> full database backup with No_recovery option. After that should i
> restore all the 4 differential backup or the most recent differential
> backup? Please explain.
> Regards
>|||You have to restore first full backup and latest differential backup
you have taken after last full backup.
Regards
Amish Shah|||thank you for your replay. but i have a doubt. how only full database
backup and most recent diffrentail backup is enough to recover the
database?. why the intermediate diffrential backups are not required?.
Internally what is happening?.
BOL does not specify the backgroud process of recovery process while
applying the diffrential backup after full database back up?.|||Differential backups always store the changes from the last FULL backup. So
the previous Differential backups are not needed only the last one.
--
Andrew J. Kelly SQL MVP
"Praveen" <apveen@.gmail.com> wrote in message
news:1143029248.422816.10680@.j33g2000cwa.googlegroups.com...
> thank you for your replay. but i have a doubt. how only full database
> backup and most recent diffrentail backup is enough to recover the
> database?. why the intermediate diffrential backups are not required?.
> Internally what is happening?.
> BOL does not specify the backgroud process of recovery process while
> applying the diffrential backup after full database back up?.
>|||I got the answer from this link
http://msdn2.microsoft.com/en-us/library/ms345448(SQL.90).aspx
thanks for all.

Full Database Back and Diffrential Database Backup

I have one full database back and 4 differential database backup.
(Recovery model is simple) In the recovery process, I have restored the
full database backup with No_recovery option. After that should i
restore all the 4 differential backup or the most recent differential
backup? Please explain.
RegardsHi
http://vyaskn.tripod.com/ sql_serve...r />
.htm#Step1
--administaiting best practices
"Praveen" <apveen@.gmail.com> wrote in message
news:1143010815.337892.295070@.e56g2000cwe.googlegroups.com...
>I have one full database back and 4 differential database backup.
> (Recovery model is simple) In the recovery process, I have restored the
> full database backup with No_recovery option. After that should i
> restore all the 4 differential backup or the most recent differential
> backup? Please explain.
> Regards
>|||You have to restore first full backup and latest differential backup
you have taken after last full backup.
Regards
Amish Shah|||thank you for your replay. but i have a doubt. how only full database
backup and most recent diffrentail backup is enough to recover the
database?. why the intermediate diffrential backups are not required?.
Internally what is happening?.
BOL does not specify the backgroud process of recovery process while
applying the diffrential backup after full database back up?.|||Differential backups always store the changes from the last FULL backup. So
the previous Differential backups are not needed only the last one.
Andrew J. Kelly SQL MVP
"Praveen" <apveen@.gmail.com> wrote in message
news:1143029248.422816.10680@.j33g2000cwa.googlegroups.com...
> thank you for your replay. but i have a doubt. how only full database
> backup and most recent diffrentail backup is enough to recover the
> database?. why the intermediate diffrential backups are not required?.
> Internally what is happening?.
> BOL does not specify the backgroud process of recovery process while
> applying the diffrential backup after full database back up?.
>|||I got the answer from this link
http://msdn2.microsoft.com/en-us/library/ms345448(SQL.90).aspx
thanks for all.

Full Database Back and Diffrential Database Backup

I have one full database back and 4 differential database backup.
(Recovery model is simple) In the recovery process, I have restored the
full database backup with No_recovery option. After that should i
restore all the 4 differential backup or the most recent differential
backup? Please explain.
Regards
Hi
http://vyaskn.tripod.com/sql_server_...ices.htm#Step1
--administaiting best practices
"Praveen" <apveen@.gmail.com> wrote in message
news:1143010815.337892.295070@.e56g2000cwe.googlegr oups.com...
>I have one full database back and 4 differential database backup.
> (Recovery model is simple) In the recovery process, I have restored the
> full database backup with No_recovery option. After that should i
> restore all the 4 differential backup or the most recent differential
> backup? Please explain.
> Regards
>
|||You have to restore first full backup and latest differential backup
you have taken after last full backup.
Regards
Amish Shah
|||thank you for your replay. but i have a doubt. how only full database
backup and most recent diffrentail backup is enough to recover the
database?. why the intermediate diffrential backups are not required?.
Internally what is happening?.
BOL does not specify the backgroud process of recovery process while
applying the diffrential backup after full database back up?.
|||Differential backups always store the changes from the last FULL backup. So
the previous Differential backups are not needed only the last one.
Andrew J. Kelly SQL MVP
"Praveen" <apveen@.gmail.com> wrote in message
news:1143029248.422816.10680@.j33g2000cwa.googlegro ups.com...
> thank you for your replay. but i have a doubt. how only full database
> backup and most recent diffrentail backup is enough to recover the
> database?. why the intermediate diffrential backups are not required?.
> Internally what is happening?.
> BOL does not specify the backgroud process of recovery process while
> applying the diffrential backup after full database back up?.
>
|||I got the answer from this link
http://msdn2.microsoft.com/en-us/library/ms345448(SQL.90).aspx
thanks for all.

Full backup without change archive bit

Here's the scenario:
I set a maintenance plan for sqlserver:
monday morning : full backup
in 6 days rest : differential backup
Sometimes I need to make a full backup of some databases and send to client.
I've got a problem, when I have to make a full backup for example in friday
for someone , because all next differential backups from maintenance plan
are wrong.
(include only differences from friday - not from monday)
So I have a question. How to make a full backup without reset an archive
bit?.
Any idea ?
Thanks to all in advance for your worthy assistance,
Radoslaw PutekRadek
Can you perfom full BACKUP DATABASE on friday within another job ,I mean not
by maintenance plan?
"Radek" <SPAM_putti@.poczta.onet.pl> wrote in message
news:bnql59$77a$1@.atlantis.news.tpi.pl...
> Here's the scenario:
> I set a maintenance plan for sqlserver:
> monday morning : full backup
> in 6 days rest : differential backup
> Sometimes I need to make a full backup of some databases and send to
client.
> I've got a problem, when I have to make a full backup for example in
friday
> for someone , because all next differential backups from maintenance plan
> are wrong.
> (include only differences from friday - not from monday)
> So I have a question. How to make a full backup without reset an archive
> bit?.
> Any idea ?
> Thanks to all in advance for your worthy assistance,
> Radoslaw Putek
>|||> > Here's the scenario:
> > I set a maintenance plan for sqlserver:
> > monday morning : full backup
> > in 6 days rest : differential backup
> >
> > Sometimes I need to make a full backup of some databases and send to
> client.
> > I've got a problem, when I have to make a full backup for example in
> friday
> > for someone , because all next differential backups from maintenance
plan
> > are wrong.
> > (include only differences from friday - not from monday)
> >
> > So I have a question. How to make a full backup without reset an archive
> > bit?.
> > Any idea ?
> >
> > Thanks to all in advance for your worthy assistance,
> >
> > Radoslaw Putek
--
> Radek
> Can you perfom full BACKUP DATABASE on friday within another job ,I mean
not
> by maintenance plan?
>
--
I used my own backup procedures in jobs.
I have over 500 databases and these procedures make me :
SQL_20031029_FULL catalog
database1_full.bac
database2_full.bac
...
SQL_20031030_DIFF catalog
database1_diff.bac
database2_diff.bac
...
.....
And when i make a full backup of some databases in friday(for example) my
restore plan doesn't work.
Radoslaw Putek|||Radek
I'd go with writing stored procedure that accep parameter as database id.
If you were asked to backup particular database/or databases you just put
their id as parameter, that's all.
"Radek" <SPAM_putti@.poczta.onet.pl> wrote in message
news:bnqn9o$ht2$1@.atlantis.news.tpi.pl...
> > > Here's the scenario:
> > > I set a maintenance plan for sqlserver:
> > > monday morning : full backup
> > > in 6 days rest : differential backup
> > >
> > > Sometimes I need to make a full backup of some databases and send to
> > client.
> > > I've got a problem, when I have to make a full backup for example in
> > friday
> > > for someone , because all next differential backups from maintenance
> plan
> > > are wrong.
> > > (include only differences from friday - not from monday)
> > >
> > > So I have a question. How to make a full backup without reset an
archive
> > > bit?.
> > > Any idea ?
> > >
> > > Thanks to all in advance for your worthy assistance,
> > >
> > > Radoslaw Putek
> --
> > Radek
> > Can you perfom full BACKUP DATABASE on friday within another job ,I mean
> not
> > by maintenance plan?
> >
> --
> I used my own backup procedures in jobs.
> I have over 500 databases and these procedures make me :
> SQL_20031029_FULL catalog
> database1_full.bac
> database2_full.bac
> ...
> SQL_20031030_DIFF catalog
> database1_diff.bac
> database2_diff.bac
> ...
> .....
> And when i make a full backup of some databases in friday(for example) my
> restore plan doesn't work.
> Radoslaw Putek
>
>|||Radek,
As I understand it, your problem is that your diff backups will be based on that "extra" database
backup, something you don't want them to be. I'm fairly certain that you cannot do that, I'm afraid.
Detaching might be an option (but that is not fully online, of course).
This seems like a valid request for sqlwish@.microsoft.com.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Radek" <SPAM_putti@.poczta.onet.pl> wrote in message news:bnql59$77a$1@.atlantis.news.tpi.pl...
> Here's the scenario:
> I set a maintenance plan for sqlserver:
> monday morning : full backup
> in 6 days rest : differential backup
> Sometimes I need to make a full backup of some databases and send to client.
> I've got a problem, when I have to make a full backup for example in friday
> for someone , because all next differential backups from maintenance plan
> are wrong.
> (include only differences from friday - not from monday)
> So I have a question. How to make a full backup without reset an archive
> bit?.
> Any idea ?
> Thanks to all in advance for your worthy assistance,
> Radoslaw Putek
>|||Ok
Now I see what you mean?
Perhaps detach a database will be an option but I really don't know another
solution
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:OdR673snDHA.2272@.tk2msftngp13.phx.gbl...
> Radek
> I'd go with writing stored procedure that accep parameter as database id.
> If you were asked to backup particular database/or databases you just put
> their id as parameter, that's all.
>
> "Radek" <SPAM_putti@.poczta.onet.pl> wrote in message
> news:bnqn9o$ht2$1@.atlantis.news.tpi.pl...
> > > > Here's the scenario:
> > > > I set a maintenance plan for sqlserver:
> > > > monday morning : full backup
> > > > in 6 days rest : differential backup
> > > >
> > > > Sometimes I need to make a full backup of some databases and send to
> > > client.
> > > > I've got a problem, when I have to make a full backup for example in
> > > friday
> > > > for someone , because all next differential backups from
maintenance
> > plan
> > > > are wrong.
> > > > (include only differences from friday - not from monday)
> > > >
> > > > So I have a question. How to make a full backup without reset an
> archive
> > > > bit?.
> > > > Any idea ?
> > > >
> > > > Thanks to all in advance for your worthy assistance,
> > > >
> > > > Radoslaw Putek
> > --
> > > Radek
> > > Can you perfom full BACKUP DATABASE on friday within another job ,I
mean
> > not
> > > by maintenance plan?
> > >
> > --
> > I used my own backup procedures in jobs.
> > I have over 500 databases and these procedures make me :
> > SQL_20031029_FULL catalog
> > database1_full.bac
> > database2_full.bac
> > ...
> > SQL_20031030_DIFF catalog
> > database1_diff.bac
> > database2_diff.bac
> > ...
> > .....
> > And when i make a full backup of some databases in friday(for example)
my
> > restore plan doesn't work.
> >
> > Radoslaw Putek
> >
> >
> >
> >
>

Full backup invisible to the next differential backup

Hi
Given that differential backups are labelled with a base Log Sequence Number
(LSN) as to know which full backup they're related to, and that they store
all changes made after that LSN. I want to know if it's possible to have a
full backup that is not taken into account when a differential backup is
created.
For instance:
1. On Monday a full backup is created
2. On Tuesday another full backup is automatically created by a 3rd-party
application
3. On Wednesday a differential backup is created.
We want this diff backup to ignore the Tuesday full backup and store all
changes since the Monday one.
4. On Thursday the DB crashes and we're able to restore in order:
- Full backup from step 1
- Diff backup from step 3
- All log backups after the diff backup on step 3
The key here is to be able to have something like a disconnected backup that
can be performed by this 3rd-party application, that doesn't interfere on
the regular backup chain.
Any thoughts are welcome.
Thanks!Dallara,
"Dallara" <someone@.microsoft.com> wrote in message
news:ObpEKvh5DHA.1636@.TK2MSFTNGP12.phx.gbl...
quote:

> For instance:
> 1. On Monday a full backup is created
> 2. On Tuesday another full backup is automatically created by a 3rd-party
> application
> 3. On Wednesday a differential backup is created.
> We want this diff backup to ignore the Tuesday full backup and store

all
quote:

> changes since the Monday one.

This is not possible.
What's the point of the third party backup if it is disregarded?
James Hokes|||The application has an automated process that
1 - gets exclusive access to the DB
2 - back it up
3 - does whatever needs to be done
if 3 fails the DB is restored, otherwise the backup can be discarded
4 - release exclusive access to DB
The idea is not to interfere with the client maintenance plans and backup
policy (if they have one).
It's basically the same idea of the COPY BACKUP for the NT backup.
"James Hokes" <noemail@.noway.com> wrote in message
This is not possible.
What's the point of the third party backup if it is disregarded?
James Hokes
quote:

> Dallara,
>
> "Dallara" <someone@.microsoft.com> wrote in message
3rd-party[QUOTE]
> all
>
|||Why not take the database offline, copy the database files, put the database
back online. See ALTER DATABASE in BOL.
HTH
--
Barry McAuslin
Look inside your SQL Server files with SQL File Explorer.
Go to http://www.sqlfe.com for more information.
"Dallara" <someone@.microsoft.com> wrote in message
news:Om5pYkj5DHA.2348@.TK2MSFTNGP10.phx.gbl...
quote:

> The application has an automated process that
> 1 - gets exclusive access to the DB
> 2 - back it up
> 3 - does whatever needs to be done
> if 3 fails the DB is restored, otherwise the backup can be discarded
> 4 - release exclusive access to DB
> The idea is not to interfere with the client maintenance plans and backup
> policy (if they have one).
> It's basically the same idea of the COPY BACKUP for the NT backup.
>
>
> "James Hokes" <noemail@.noway.com> wrote in message
> This is not possible.
> What's the point of the third party backup if it is disregarded?
> James Hokes
>
> 3rd-party
store[QUOTE]
>

Full backup invisible to the next differential backup

Hi
Given that differential backups are labelled with a base Log Sequence Number
(LSN) as to know which full backup they're related to, and that they store
all changes made after that LSN. I want to know if it's possible to have a
full backup that is not taken into account when a differential backup is
created.
For instance:
1. On Monday a full backup is created
2. On Tuesday another full backup is automatically created by a 3rd-party
application
3. On Wednesday a differential backup is created.
We want this diff backup to ignore the Tuesday full backup and store all
changes since the Monday one.
4. On Thursday the DB crashes and we're able to restore in order:
- Full backup from step 1
- Diff backup from step 3
- All log backups after the diff backup on step 3
The key here is to be able to have something like a disconnected backup that
can be performed by this 3rd-party application, that doesn't interfere on
the regular backup chain.
Any thoughts are welcome.
Thanks!Dallara,
"Dallara" <someone@.microsoft.com> wrote in message
news:ObpEKvh5DHA.1636@.TK2MSFTNGP12.phx.gbl...
> For instance:
> 1. On Monday a full backup is created
> 2. On Tuesday another full backup is automatically created by a 3rd-party
> application
> 3. On Wednesday a differential backup is created.
> We want this diff backup to ignore the Tuesday full backup and store
all
> changes since the Monday one.
This is not possible.
What's the point of the third party backup if it is disregarded?
James Hokes|||The application has an automated process that
1 - gets exclusive access to the DB
2 - back it up
3 - does whatever needs to be done
if 3 fails the DB is restored, otherwise the backup can be discarded
4 - release exclusive access to DB
The idea is not to interfere with the client maintenance plans and backup
policy (if they have one).
It's basically the same idea of the COPY BACKUP for the NT backup.
"James Hokes" <noemail@.noway.com> wrote in message
This is not possible.
What's the point of the third party backup if it is disregarded?
James Hokes
> Dallara,
>
> "Dallara" <someone@.microsoft.com> wrote in message
> > For instance:
> > 1. On Monday a full backup is created
> > 2. On Tuesday another full backup is automatically created by a
3rd-party
> > application
> > 3. On Wednesday a differential backup is created.
> > We want this diff backup to ignore the Tuesday full backup and store
> all
> > changes since the Monday one.
>|||Why not take the database offline, copy the database files, put the database
back online. See ALTER DATABASE in BOL.
HTH
--
Barry McAuslin
Look inside your SQL Server files with SQL File Explorer.
Go to http://www.sqlfe.com for more information.
"Dallara" <someone@.microsoft.com> wrote in message
news:Om5pYkj5DHA.2348@.TK2MSFTNGP10.phx.gbl...
> The application has an automated process that
> 1 - gets exclusive access to the DB
> 2 - back it up
> 3 - does whatever needs to be done
> if 3 fails the DB is restored, otherwise the backup can be discarded
> 4 - release exclusive access to DB
> The idea is not to interfere with the client maintenance plans and backup
> policy (if they have one).
> It's basically the same idea of the COPY BACKUP for the NT backup.
>
>
> "James Hokes" <noemail@.noway.com> wrote in message
> This is not possible.
> What's the point of the third party backup if it is disregarded?
> James Hokes
>
> > Dallara,
> >
> >
> > "Dallara" <someone@.microsoft.com> wrote in message
> > > For instance:
> > > 1. On Monday a full backup is created
> > > 2. On Tuesday another full backup is automatically created by a
> 3rd-party
> > > application
> > > 3. On Wednesday a differential backup is created.
> > > We want this diff backup to ignore the Tuesday full backup and
store
> > all
> > > changes since the Monday one.
> >
>

Full and Differential Backups

Does the full and differential backups have to be in the same location or can I do a once a week full backup on one drive and everyday differential backups on a different drive?

Thanks

Hi,

if you store your backup local, it's still better to have them on the same drive - by watching your systemmonitor.

But it doesn' matter wehre you store your backups.

|||

As such there is no restriction. you can have your full and differential back any where. If you are taking the backup in local machine , your backup is not fully fault tollerent. YOu should have either a network path or tape drive to store the backup.

Madhu

|||

Another thought is to do your backups to a local disk (which one makes no difference) and then archive this of to secondary storage (network share from another machine, tape, etc.)

The reason for this is that backups and restores to/from a local disk will be the fastest method. So, for your backups, and in the event of a restore due to a single bad disk (or single bad decision Smile ) these will be optimized. Then you can add a layer of fault-tolerance by copying them off to secondary storage which will be protected in the event of a complete disaster.

Full & differential restore

Hi All,

I am trying to restore full backup in Sql Server 2005. I am using the following query to restore full backup.

"Restore database Testdb from Disk = 'C:\Testdbfull.bak'

with move 'Testdb' to 'C:\DB\Testdb.mdf ',

move 'Testdb_log' to 'C:\DB\Testdb_log.ldf ', norecovery "

The above query is running successfully and database restored. But i am not able to access this database since in the database tab it is showing 'Testdb (Restoring)'

The next day I want to restore the differential database backup so i used the 'norecovery' statement.

please help why it is showing as '(Restoring)'

Thanks in advance,

Senthil

The NORECOVERY keyword is used when you want to restore a set of backups and it leaves the database in a restoring state. It doesn't roll backup any uncommitted transactions as it expects futher backups to be applied. In order to bring the database online you just need to run the following command after you've applied your final backup:


RESTORE DATABASE mydb

WITH RECOVERY

Check Books Online for more info.

HTH!

|||

Thanks Rich.

If i run the query which you mentioned then the database comes back to online.

But what my problem is for example i have restored full backup on Monday and i made some updates in the database.

On Tuesday I want to restore differential backup which i get from my client side everyday.

If i try to restore it is throwing error as:

Msg 3117, Level 16, State 4, Line 2

The log or differential backup cannot be restored because no files are ready to rollforward.

Msg 3013, Level 16, State 1, Line 2

RESTORE DATABASE is terminating abnormally.

Please help me what should i do.

Thanks in advance!

Senthil

|||

All backups except the last one should be restored with no recovery. If you want to pull data incrementally (only the delta) you should take a look at replication or log shipping.

|||

Thanks Vlad!

Can you explain or give some article link for log shipping.

I want to restore full backup on Monday and daily differential backup from client from Tuesday onwards.

Please explain how to do

Thanks

Senthil

|||

First of all, what are you trying to accomplish? Please describe your environment.

As I understand - you have some client database and you want to have a copy of this database, but the only changed data should be copied, right? Then - do you want to update this secondary database or it will be read-only? What is your goal?

Log shipping documentation in Books Online:

http://msdn2.microsoft.com/en-us/library/ms187103.aspx

Basically log shipping takes transaction log backup on the primary database then copies it to the secondary database and restores it there, the secondary database could either in 'loading' or in 'read-only' mode, thus log shipping is best suitable for disaster recovery or for the reporting needs.|||

Vlad,

I explain my requirement below.

Every week Monday morning i will get a full backup from my client side.

So i will restore this full backup as a new database in my local server on Monday. Also i will use this database for read and write.

From Tuesday to Friday i will get the daily differential backup from the client.

I want to restore this daily differential backup as daily basis and i want to retain the changes which i made in my local database server.

This is what my situation.

Currently what i am doing is Monday I will restore full backup as new database and Tuesday I will delete the database and again i restore full backup as new database with norecovery and restore differential backup with recovery clause. Then i will start using the database for Read and Write.

But what happened is whatever i made changes on Monday in my local server to that database will not be available.

Can you help me.

Thanks in advance.

Senthil

|||

Ok, so you want to merge your changes with that changes made to the client database. In this case if you have a channel between you and the client, you could implement one-way merge replication (details you can also find in Books Online). You don't need a permanent link for the merge replication, but it should be available occasionally. If you don't have a channel - I think there is no out-of-the box soultion, so you will have to develop it yourself.

For example you can add 'rowversion' column to each table and then pull only new/changed data, and you will need to implement some conflict resolving mechanism in a case changes were done to the same data on both sides. This is one of the possible solutions.

Let me know if you have any questions.

|||

Ok Vlad,

If i want to use the database for read-only purpose then how can i restore daily differential backups.

Thanks

Senthil

|||

You can put database into stand-by mode. Take a look at the code below:

Code Snippet

use master
go
create database test_client
on
(name = 'test_client_data', filename = 'c:\test_client.mdf')
log on
(name = 'test_client_log', filename = 'c:\test_client.ldf')
go

use test_client
go
create table dbo.test (
i int identity
, data sysname
)
go

-- Some test data
insert into dbo.test (
data
)
select name
from master..sysobjects
go

-- Perform a full backup
backup database test_client to disk = 'c:\test_client_full.bak'
go

-- Restore it on your side as stand-by (read-only), so you will be able to restore additional backups
restore database test_client_standby
from disk = 'c:\test_client_full.bak'
with standby = 'c:\test_client_standby_undo',
move 'test_client_data' to 'c:\test_client_standby_data.mdf',
move 'test_client_log' to 'c:\test_client_standby_log.ldf',
replace
go

use test_client
go
-- Make some changes in the client database
insert into dbo.test (
data
)
values (
'new data from the client'
)
go

-- Perform a differential backup
backup database test_client to disk = 'c:\test_client_diff.bak' with differential
go

-- First in order to perform restore we should terminate all connections to this database
alter database test_client_standby
set single_user
with rollback immediate
go

-- Restore differential backup
restore database test_client_standby
from disk = 'c:\test_client_diff.bak'
with standby = 'c:\test_client_standby_undo'
go

-- Return database to multi-user mode
alter database test_client_standby
set multi_user
go

-- Check the data
use test_client_standby
go
select * from dbo.test where data = 'new data from the client'
go

|||

refer this link for configuring log shipping,

http://sql-articles.com/articles.php and http://sql-articles.com/articles/lship/lship.htm

Now you can configure log shipping and restore the full backup of Mondays and subsequent log or differential backups using with recovery option in the destination server so that the db will be in Read-only mode..........

Senthil, If you restore mondays full backup and tue or weds differentials differential backup then the db will contain all the changes made since monday's full backup...........even if you perform any change on tuesday the diff backup will contain that and hence when you restore the diff backup it will not be the same as it was on monday...........

feel free to ask if you have anymore doubts............

Thanxx

Deepak

|||

In my example there is no need for 'with standby = 'c:\test_client_standby_undo'' in the last restore statement, copy-paste, sorry Smile this is actually a hand-made mini-version of the log shipping.

upd: arghhh, you do need to supply 'standby' clause if you need to restore additional backups, sorry once again.

|||

Hi Vlad,

I have taken the code which you given and I am getting this below error when restore differential backup query runs.

--Query getting error:

restore database test_client_standby

from disk = 'c:\test_client_diff.bak'

--with standby = 'c:\test_client_standby_undo'

go

error msg.

Msg 3117, Level 16, State 4, Line 1

The log or differential backup cannot be restored because no files are ready to rollforward.

Msg 3013, Level 16, State 1, Line 1

RESTORE DATABASE is terminating abnormally.

Any service tools setting is required to avoid this?

Senthil

|||

hmmm, strange. please provide the result of select @.@.version

|||

Thanks Deepak!!!!

I understood but i want to restore daily backup and use the database everyday as online.

Is it possible?

Senthil

Full & differential restore

Hi All,

I am trying to restore full backup in Sql Server 2005. I am using the following query to restore full backup.

"Restore database Testdb from Disk = 'C:\Testdbfull.bak'

with move 'Testdb' to 'C:\DB\Testdb.mdf ',

move 'Testdb_log' to 'C:\DB\Testdb_log.ldf ', norecovery "

The above query is running successfully and database restored. But i am not able to access this database since in the database tab it is showing 'Testdb (Restoring)'

The next day I want to restore the differential database backup so i used the 'norecovery' statement.

please help why it is showing as '(Restoring)'

Thanks in advance,

Senthil

The NORECOVERY keyword is used when you want to restore a set of backups and it leaves the database in a restoring state. It doesn't roll backup any uncommitted transactions as it expects futher backups to be applied. In order to bring the database online you just need to run the following command after you've applied your final backup:


RESTORE DATABASE mydb

WITH RECOVERY

Check Books Online for more info.

HTH!

|||

Thanks Rich.

If i run the query which you mentioned then the database comes back to online.

But what my problem is for example i have restored full backup on Monday and i made some updates in the database.

On Tuesday I want to restore differential backup which i get from my client side everyday.

If i try to restore it is throwing error as:

Msg 3117, Level 16, State 4, Line 2

The log or differential backup cannot be restored because no files are ready to rollforward.

Msg 3013, Level 16, State 1, Line 2

RESTORE DATABASE is terminating abnormally.

Please help me what should i do.

Thanks in advance!

Senthil

|||

All backups except the last one should be restored with no recovery. If you want to pull data incrementally (only the delta) you should take a look at replication or log shipping.

|||

Thanks Vlad!

Can you explain or give some article link for log shipping.

I want to restore full backup on Monday and daily differential backup from client from Tuesday onwards.

Please explain how to do

Thanks

Senthil

|||

First of all, what are you trying to accomplish? Please describe your environment.

As I understand - you have some client database and you want to have a copy of this database, but the only changed data should be copied, right? Then - do you want to update this secondary database or it will be read-only? What is your goal?

Log shipping documentation in Books Online:

http://msdn2.microsoft.com/en-us/library/ms187103.aspx

Basically log shipping takes transaction log backup on the primary database then copies it to the secondary database and restores it there, the secondary database could either in 'loading' or in 'read-only' mode, thus log shipping is best suitable for disaster recovery or for the reporting needs.|||

Vlad,

I explain my requirement below.

Every week Monday morning i will get a full backup from my client side.

So i will restore this full backup as a new database in my local server on Monday. Also i will use this database for read and write.

From Tuesday to Friday i will get the daily differential backup from the client.

I want to restore this daily differential backup as daily basis and i want to retain the changes which i made in my local database server.

This is what my situation.

Currently what i am doing is Monday I will restore full backup as new database and Tuesday I will delete the database and again i restore full backup as new database with norecovery and restore differential backup with recovery clause. Then i will start using the database for Read and Write.

But what happened is whatever i made changes on Monday in my local server to that database will not be available.

Can you help me.

Thanks in advance.

Senthil

|||

Ok, so you want to merge your changes with that changes made to the client database. In this case if you have a channel between you and the client, you could implement one-way merge replication (details you can also find in Books Online). You don't need a permanent link for the merge replication, but it should be available occasionally. If you don't have a channel - I think there is no out-of-the box soultion, so you will have to develop it yourself.

For example you can add 'rowversion' column to each table and then pull only new/changed data, and you will need to implement some conflict resolving mechanism in a case changes were done to the same data on both sides. This is one of the possible solutions.

Let me know if you have any questions.

|||

Ok Vlad,

If i want to use the database for read-only purpose then how can i restore daily differential backups.

Thanks

Senthil

|||

You can put database into stand-by mode. Take a look at the code below:

Code Snippet

use master
go
create database test_client
on
(name = 'test_client_data', filename = 'c:\test_client.mdf')
log on
(name = 'test_client_log', filename = 'c:\test_client.ldf')
go

use test_client
go
create table dbo.test (
i int identity
, data sysname
)
go

-- Some test data
insert into dbo.test (
data
)
select name
from master..sysobjects
go

-- Perform a full backup
backup database test_client to disk = 'c:\test_client_full.bak'
go

-- Restore it on your side as stand-by (read-only), so you will be able to restore additional backups
restore database test_client_standby
from disk = 'c:\test_client_full.bak'
with standby = 'c:\test_client_standby_undo',
move 'test_client_data' to 'c:\test_client_standby_data.mdf',
move 'test_client_log' to 'c:\test_client_standby_log.ldf',
replace
go

use test_client
go
-- Make some changes in the client database
insert into dbo.test (
data
)
values (
'new data from the client'
)
go

-- Perform a differential backup
backup database test_client to disk = 'c:\test_client_diff.bak' with differential
go

-- First in order to perform restore we should terminate all connections to this database
alter database test_client_standby
set single_user
with rollback immediate
go

-- Restore differential backup
restore database test_client_standby
from disk = 'c:\test_client_diff.bak'
with standby = 'c:\test_client_standby_undo'
go

-- Return database to multi-user mode
alter database test_client_standby
set multi_user
go

-- Check the data
use test_client_standby
go
select * from dbo.test where data = 'new data from the client'
go

|||

refer this link for configuring log shipping,

http://sql-articles.com/articles.php and http://sql-articles.com/articles/lship/lship.htm

Now you can configure log shipping and restore the full backup of Mondays and subsequent log or differential backups using with recovery option in the destination server so that the db will be in Read-only mode..........

Senthil, If you restore mondays full backup and tue or weds differentials differential backup then the db will contain all the changes made since monday's full backup...........even if you perform any change on tuesday the diff backup will contain that and hence when you restore the diff backup it will not be the same as it was on monday...........

feel free to ask if you have anymore doubts............

Thanxx

Deepak

|||

In my example there is no need for 'with standby = 'c:\test_client_standby_undo'' in the last restore statement, copy-paste, sorry Smile this is actually a hand-made mini-version of the log shipping.

upd: arghhh, you do need to supply 'standby' clause if you need to restore additional backups, sorry once again.

|||

Hi Vlad,

I have taken the code which you given and I am getting this below error when restore differential backup query runs.

--Query getting error:

restore database test_client_standby

from disk = 'c:\test_client_diff.bak'

--with standby = 'c:\test_client_standby_undo'

go

error msg.

Msg 3117, Level 16, State 4, Line 1

The log or differential backup cannot be restored because no files are ready to rollforward.

Msg 3013, Level 16, State 1, Line 1

RESTORE DATABASE is terminating abnormally.

Any service tools setting is required to avoid this?

Senthil

|||

hmmm, strange. please provide the result of select @.@.version

|||

Thanks Deepak!!!!

I understood but i want to restore daily backup and use the database everyday as online.

Is it possible?

Senthil