Home All Groups Group Topic Archive Search About
Author
20 Nov 2007 2:58 AM
Alan T
I created a snapshot of AdventureWorks.
However, when I inspect the snapshot database file, it says
size: 179MB
size on disk: 192 KB

What is that mean?

Author
20 Nov 2007 3:13 AM
Ben Nevarez
Do you ask why the size on disk is small? This is the way snapshots work.
When you create a database snapshot it is almost an empty file and the
snapshot really points to the pages of the source database. When a page in
the source database is updated the snapshot saves the original page. So, as
the original database is updated the snapshot file will also grow in size.

Hope this helps,

Ben Nevarez
Senior Database Administrator
AIG SunAmerica



Show quote
"Alan T" wrote:

> I created a snapshot of AdventureWorks.
> However, when I inspect the snapshot database file, it says
> size: 179MB
> size on disk: 192 KB
>
> What is that mean?
>
>
>
Author
20 Nov 2007 4:29 AM
Alan T
Hi,

Still not fully understand.
Please comment if I am wrong:
1) If I add/modify records in a table, the snapshot will save the modified
page only
2) Any further modifications to the same/other pages, snapshot saves the
modified pages also

So the snapshot seems to work like the differential database backup?

Show quote
"Ben Nevarez" <BenNeva***@discussions.microsoft.com> wrote in message
news:C79415A4-010A-4F9A-BFC4-726B1F09F2CF@microsoft.com...
>
> Do you ask why the size on disk is small? This is the way snapshots work.
> When you create a database snapshot it is almost an empty file and the
> snapshot really points to the pages of the source database. When a page in
> the source database is updated the snapshot saves the original page. So,
as
> the original database is updated the snapshot file will also grow in size.
>
> Hope this helps,
>
> Ben Nevarez
> Senior Database Administrator
> AIG SunAmerica
>
>
>
> "Alan T" wrote:
>
> > I created a snapshot of AdventureWorks.
> > However, when I inspect the snapshot database file, it says
> > size: 179MB
> > size on disk: 192 KB
> >
> > What is that mean?
> >
> >
> >
Author
20 Nov 2007 5:06 AM
Ben Nevarez
If you change records and SQL Server updates a page on the online database,
the snapshot will keep a copy of the original page.

If SQL Server updates the same page again on the online database that has no
effect on the snapshot, the snapshot already has a copy of the original page.

Hope this helps,

Ben Nevarez
Senior Database Administrator
AIG SunAmerica



Show quote
"Alan T" wrote:

> Hi,
>
> Still not fully understand.
> Please comment if I am wrong:
> 1) If I add/modify records in a table, the snapshot will save the modified
> page only
> 2) Any further modifications to the same/other pages, snapshot saves the
> modified pages also
>
> So the snapshot seems to work like the differential database backup?
>
> "Ben Nevarez" <BenNeva***@discussions.microsoft.com> wrote in message
> news:C79415A4-010A-4F9A-BFC4-726B1F09F2CF@microsoft.com...
> >
> > Do you ask why the size on disk is small? This is the way snapshots work.
> > When you create a database snapshot it is almost an empty file and the
> > snapshot really points to the pages of the source database. When a page in
> > the source database is updated the snapshot saves the original page. So,
> as
> > the original database is updated the snapshot file will also grow in size.
> >
> > Hope this helps,
> >
> > Ben Nevarez
> > Senior Database Administrator
> > AIG SunAmerica
> >
> >
> >
> > "Alan T" wrote:
> >
> > > I created a snapshot of AdventureWorks.
> > > However, when I inspect the snapshot database file, it says
> > > size: 179MB
> > > size on disk: 192 KB
> > >
> > > What is that mean?
> > >
> > >
> > >
>
>
>
Author
20 Nov 2007 5:28 AM
Alan T
I think I am a bit clearer.
The snapshot keeps the page(s) that was/were before modified.

So in order to keep safe of the original database, we should create or
refresh the snapshot whenever we do a major modification to the original
database?



Show quote
"Ben Nevarez" <BenNeva***@discussions.microsoft.com> wrote in message
news:F3F5484A-46AA-40DF-9789-57DA51762BC6@microsoft.com...
>
> If you change records and SQL Server updates a page on the online
database,
> the snapshot will keep a copy of the original page.
>
> If SQL Server updates the same page again on the online database that has
no
> effect on the snapshot, the snapshot already has a copy of the original
page.
>
> Hope this helps,
>
> Ben Nevarez
> Senior Database Administrator
> AIG SunAmerica
>
>
>
> "Alan T" wrote:
>
> > Hi,
> >
> > Still not fully understand.
> > Please comment if I am wrong:
> > 1) If I add/modify records in a table, the snapshot will save the
modified
> > page only
> > 2) Any further modifications to the same/other pages, snapshot saves the
> > modified pages also
> >
> > So the snapshot seems to work like the differential database backup?
> >
> > "Ben Nevarez" <BenNeva***@discussions.microsoft.com> wrote in message
> > news:C79415A4-010A-4F9A-BFC4-726B1F09F2CF@microsoft.com...
> > >
> > > Do you ask why the size on disk is small? This is the way snapshots
work.
> > > When you create a database snapshot it is almost an empty file and the
> > > snapshot really points to the pages of the source database. When a
page in
> > > the source database is updated the snapshot saves the original page.
So,
> > as
> > > the original database is updated the snapshot file will also grow in
size.
> > >
> > > Hope this helps,
> > >
> > > Ben Nevarez
> > > Senior Database Administrator
> > > AIG SunAmerica
> > >
> > >
> > >
> > > "Alan T" wrote:
> > >
> > > > I created a snapshot of AdventureWorks.
> > > > However, when I inspect the snapshot database file, it says
> > > > size: 179MB
> > > > size on disk: 192 KB
> > > >
> > > > What is that mean?
> > > >
> > > >
> > > >
> >
> >
> >
Author
20 Nov 2007 5:54 AM
Ben Nevarez
Yes, the snapshot keeps the original pages that have been changed on the
source database. Note that I used the term 'online' database before, perhaps
'source' database is a better description as we can also have snapshots of a
mirror database.

You create snapshots depending on your specific needs. Just keep in mind
that as your source database changes your snapshot will also grow on size.

Hope this helps,

Ben Nevarez
Senior Database Administrator
AIG SunAmerica



Show quote
"Alan T" wrote:

> I think I am a bit clearer.
> The snapshot keeps the page(s) that was/were before modified.
>
> So in order to keep safe of the original database, we should create or
> refresh the snapshot whenever we do a major modification to the original
> database?
>
>
>
> "Ben Nevarez" <BenNeva***@discussions.microsoft.com> wrote in message
> news:F3F5484A-46AA-40DF-9789-57DA51762BC6@microsoft.com...
> >
> > If you change records and SQL Server updates a page on the online
> database,
> > the snapshot will keep a copy of the original page.
> >
> > If SQL Server updates the same page again on the online database that has
> no
> > effect on the snapshot, the snapshot already has a copy of the original
> page.
> >
> > Hope this helps,
> >
> > Ben Nevarez
> > Senior Database Administrator
> > AIG SunAmerica
> >
> >
> >
> > "Alan T" wrote:
> >
> > > Hi,
> > >
> > > Still not fully understand.
> > > Please comment if I am wrong:
> > > 1) If I add/modify records in a table, the snapshot will save the
> modified
> > > page only
> > > 2) Any further modifications to the same/other pages, snapshot saves the
> > > modified pages also
> > >
> > > So the snapshot seems to work like the differential database backup?
> > >
> > > "Ben Nevarez" <BenNeva***@discussions.microsoft.com> wrote in message
> > > news:C79415A4-010A-4F9A-BFC4-726B1F09F2CF@microsoft.com...
> > > >
> > > > Do you ask why the size on disk is small? This is the way snapshots
> work.
> > > > When you create a database snapshot it is almost an empty file and the
> > > > snapshot really points to the pages of the source database. When a
> page in
> > > > the source database is updated the snapshot saves the original page.
> So,
> > > as
> > > > the original database is updated the snapshot file will also grow in
> size.
> > > >
> > > > Hope this helps,
> > > >
> > > > Ben Nevarez
> > > > Senior Database Administrator
> > > > AIG SunAmerica
> > > >
> > > >
> > > >
> > > > "Alan T" wrote:
> > > >
> > > > > I created a snapshot of AdventureWorks.
> > > > > However, when I inspect the snapshot database file, it says
> > > > > size: 179MB
> > > > > size on disk: 192 KB
> > > > >
> > > > > What is that mean?
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>
>
Author
20 Nov 2007 10:57 PM
Alan T
How do I refresh the snapshot database whenever I modify the source database
so that the snapshot database has the 'before' state of the modified page?

eg.
Monday - modify the employee record of John Smith
Tuesday - modify the employee record of John Smith
Wednesday - modify the employee record of John Smith
Thursday - modify the employee record of John Smith
Friday - modify the employee record of John Smith

If I don't 'refresh' the snapshot database, the snapshot database will still
keep the 'Monday' state because the page is already there after I modified
on Monday.

Show quote
"Ben Nevarez" <BenNeva***@discussions.microsoft.com> wrote in message
news:E8286D1B-F5DB-4697-BE38-5D60C4734E18@microsoft.com...
>
> Yes, the snapshot keeps the original pages that have been changed on the
> source database. Note that I used the term 'online' database before,
perhaps
> 'source' database is a better description as we can also have snapshots of
a
> mirror database.
>
> You create snapshots depending on your specific needs. Just keep in mind
> that as your source database changes your snapshot will also grow on size.
>
> Hope this helps,
>
> Ben Nevarez
> Senior Database Administrator
> AIG SunAmerica
>
>
>
> "Alan T" wrote:
>
> > I think I am a bit clearer.
> > The snapshot keeps the page(s) that was/were before modified.
> >
> > So in order to keep safe of the original database, we should create or
> > refresh the snapshot whenever we do a major modification to the original
> > database?
> >
> >
> >
> > "Ben Nevarez" <BenNeva***@discussions.microsoft.com> wrote in message
> > news:F3F5484A-46AA-40DF-9789-57DA51762BC6@microsoft.com...
> > >
> > > If you change records and SQL Server updates a page on the online
> > database,
> > > the snapshot will keep a copy of the original page.
> > >
> > > If SQL Server updates the same page again on the online database that
has
> > no
> > > effect on the snapshot, the snapshot already has a copy of the
original
> > page.
> > >
> > > Hope this helps,
> > >
> > > Ben Nevarez
> > > Senior Database Administrator
> > > AIG SunAmerica
> > >
> > >
> > >
> > > "Alan T" wrote:
> > >
> > > > Hi,
> > > >
> > > > Still not fully understand.
> > > > Please comment if I am wrong:
> > > > 1) If I add/modify records in a table, the snapshot will save the
> > modified
> > > > page only
> > > > 2) Any further modifications to the same/other pages, snapshot saves
the
> > > > modified pages also
> > > >
> > > > So the snapshot seems to work like the differential database backup?
> > > >
> > > > "Ben Nevarez" <BenNeva***@discussions.microsoft.com> wrote in
message
> > > > news:C79415A4-010A-4F9A-BFC4-726B1F09F2CF@microsoft.com...
> > > > >
> > > > > Do you ask why the size on disk is small? This is the way
snapshots
> > work.
> > > > > When you create a database snapshot it is almost an empty file and
the
> > > > > snapshot really points to the pages of the source database. When a
> > page in
> > > > > the source database is updated the snapshot saves the original
page.
> > So,
> > > > as
> > > > > the original database is updated the snapshot file will also grow
in
> > size.
> > > > >
> > > > > Hope this helps,
> > > > >
> > > > > Ben Nevarez
> > > > > Senior Database Administrator
> > > > > AIG SunAmerica
> > > > >
> > > > >
> > > > >
> > > > > "Alan T" wrote:
> > > > >
> > > > > > I created a snapshot of AdventureWorks.
> > > > > > However, when I inspect the snapshot database file, it says
> > > > > > size: 179MB
> > > > > > size on disk: 192 KB
> > > > > >
> > > > > > What is that mean?
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> >
> >
> >
Author
21 Nov 2007 7:53 AM
Tibor Karaszi
> How do I refresh the snapshot database whenever I modify the source database
> so that the snapshot database has the 'before' state of the modified page?

You don't. A snapshot database is a ... snapshot of the data. If you want continuous reflection of
modifications in the source database then you should go for some other technology (like
transactional replication, for instance).

Of course, you can drop and re-create the snapshot database, at an interval that meets your
requirements.

Show quote
"Alan T" <alanNOSPAMpltse@yahoo.com.au> wrote in message
news:u1vovi8KIHA.5224@TK2MSFTNGP02.phx.gbl...
> How do I refresh the snapshot database whenever I modify the source database
> so that the snapshot database has the 'before' state of the modified page?
>
> eg.
> Monday - modify the employee record of John Smith
> Tuesday - modify the employee record of John Smith
> Wednesday - modify the employee record of John Smith
> Thursday - modify the employee record of John Smith
> Friday - modify the employee record of John Smith
>
> If I don't 'refresh' the snapshot database, the snapshot database will still
> keep the 'Monday' state because the page is already there after I modified
> on Monday.
>
> "Ben Nevarez" <BenNeva***@discussions.microsoft.com> wrote in message
> news:E8286D1B-F5DB-4697-BE38-5D60C4734E18@microsoft.com...
>>
>> Yes, the snapshot keeps the original pages that have been changed on the
>> source database. Note that I used the term 'online' database before,
> perhaps
>> 'source' database is a better description as we can also have snapshots of
> a
>> mirror database.
>>
>> You create snapshots depending on your specific needs. Just keep in mind
>> that as your source database changes your snapshot will also grow on size.
>>
>> Hope this helps,
>>
>> Ben Nevarez
>> Senior Database Administrator
>> AIG SunAmerica
>>
>>
>>
>> "Alan T" wrote:
>>
>> > I think I am a bit clearer.
>> > The snapshot keeps the page(s) that was/were before modified.
>> >
>> > So in order to keep safe of the original database, we should create or
>> > refresh the snapshot whenever we do a major modification to the original
>> > database?
>> >
>> >
>> >
>> > "Ben Nevarez" <BenNeva***@discussions.microsoft.com> wrote in message
>> > news:F3F5484A-46AA-40DF-9789-57DA51762BC6@microsoft.com...
>> > >
>> > > If you change records and SQL Server updates a page on the online
>> > database,
>> > > the snapshot will keep a copy of the original page.
>> > >
>> > > If SQL Server updates the same page again on the online database that
> has
>> > no
>> > > effect on the snapshot, the snapshot already has a copy of the
> original
>> > page.
>> > >
>> > > Hope this helps,
>> > >
>> > > Ben Nevarez
>> > > Senior Database Administrator
>> > > AIG SunAmerica
>> > >
>> > >
>> > >
>> > > "Alan T" wrote:
>> > >
>> > > > Hi,
>> > > >
>> > > > Still not fully understand.
>> > > > Please comment if I am wrong:
>> > > > 1) If I add/modify records in a table, the snapshot will save the
>> > modified
>> > > > page only
>> > > > 2) Any further modifications to the same/other pages, snapshot saves
> the
>> > > > modified pages also
>> > > >
>> > > > So the snapshot seems to work like the differential database backup?
>> > > >
>> > > > "Ben Nevarez" <BenNeva***@discussions.microsoft.com> wrote in
> message
>> > > > news:C79415A4-010A-4F9A-BFC4-726B1F09F2CF@microsoft.com...
>> > > > >
>> > > > > Do you ask why the size on disk is small? This is the way
> snapshots
>> > work.
>> > > > > When you create a database snapshot it is almost an empty file and
> the
>> > > > > snapshot really points to the pages of the source database. When a
>> > page in
>> > > > > the source database is updated the snapshot saves the original
> page.
>> > So,
>> > > > as
>> > > > > the original database is updated the snapshot file will also grow
> in
>> > size.
>> > > > >
>> > > > > Hope this helps,
>> > > > >
>> > > > > Ben Nevarez
>> > > > > Senior Database Administrator
>> > > > > AIG SunAmerica
>> > > > >
>> > > > >
>> > > > >
>> > > > > "Alan T" wrote:
>> > > > >
>> > > > > > I created a snapshot of AdventureWorks.
>> > > > > > However, when I inspect the snapshot database file, it says
>> > > > > > size: 179MB
>> > > > > > size on disk: 192 KB
>> > > > > >
>> > > > > > What is that mean?
>> > > > > >
>> > > > > >
>> > > > > >
>> > > >
>> > > >
>> > > >
>> >
>> >
>> >
>
>
Author
22 Nov 2007 12:01 AM
Alan T
Sorry, go back to my question is if I keep modifying the same page (I think
the same record will be in the same page in the short interval say 10
minutes time if no page split), the snapshot database will only keep the
original page right before the first modification?

eg.
Monday 12:00pm - modify the employee record of John Smith
Monday 12:02pmTuesday - modify the employee record of John Smith
Monday 12:04pm - modify the employee record of John Smith
Monday 12:06pm - modify the employee record of John Smith
Monday 12:08pm - modify the employee record of John Smith

So the snapshot database only keeps the page before 12:00pm's modification?
What I think is at 12:02pm even the page is modified but the snapshot
database will not refresh the page before this page is already in the
snapshot database.
Author
22 Nov 2007 10:10 AM
Tibor Karaszi
> Sorry, go back to my question is if I keep modifying the same page (I think
> the same record will be in the same page in the short interval say 10
> minutes time if no page split), the snapshot database will only keep the
> original page right before the first modification?

Correct. The page will be copied to the snapshot file for the first modification of that page
performed in the source database.


> So the snapshot database only keeps the page before 12:00pm's modification?

Correct.


> What I think is at 12:02pm even the page is modified but the snapshot
> database will not refresh the page before this page is already in the
> snapshot database.

Correct.

Show quote
"Alan T" <alanNOSPAMpltse@yahoo.com.au> wrote in message
news:%232W4YrJLIHA.5360@TK2MSFTNGP03.phx.gbl...
> Sorry, go back to my question is if I keep modifying the same page (I think
> the same record will be in the same page in the short interval say 10
> minutes time if no page split), the snapshot database will only keep the
> original page right before the first modification?
>
> eg.
> Monday 12:00pm - modify the employee record of John Smith
> Monday 12:02pmTuesday - modify the employee record of John Smith
> Monday 12:04pm - modify the employee record of John Smith
> Monday 12:06pm - modify the employee record of John Smith
> Monday 12:08pm - modify the employee record of John Smith
>
> So the snapshot database only keeps the page before 12:00pm's modification?
> What I think is at 12:02pm even the page is modified but the snapshot
> database will not refresh the page before this page is already in the
> snapshot database.
>
>
>

AddThis Social Bookmark Button