Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Db Snapshots question Expand / Collapse
Author
Message
Posted Sunday, August 19, 2012 12:50 PM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Wednesday, July 23, 2014 1:13 PM
Points: 774, Visits: 1,734
Hi,

I have a question on database snapshots.
I have created a table and inserted 2 rows.

create table tab7
(c1 int primary key clustered,
c2 int,
c3 char(2000)
)


insert into tab7
select 1,1,'aa'
union all
select 2,2,'bb'

Then i have created a snapshot. it created in 2 secs.

Then i am inserting 50000 rows into the table in a transaction. Parallely,

begin tran
declare @i int
set @i = 3
while @i <= 50000
begin
insert into tab7 values (@i, @i, 'a')
set @i = @i + 1
end
commit tran
go

I opened a new session, i have initiated the create database snapshot. My observation, i see

CREATE DATABASE testdb_snap2
ON
(NAME = testdb,
FILENAME = 'C:\Snaps\snap2.ssf')
AS SNAPSHOT OF testdb

IO_completion waittype and snapshot creation is taking a long time, alomost my transaction( INSERT ) is finished, the snapshot is created. To be realistic a little bit before it is getting created.

Why it is waiting for so long time. cant the snapshot create at that timeframe or point in time snapshot.
Want to understand why it is taking such a long time?

Thanks in Advance.
Post #1346950
Posted Monday, August 20, 2012 11:59 PM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, August 28, 2014 4:17 PM
Points: 286, Visits: 576
A database snapshot will always be transactionally consistent with its source database at the time of creation. Therefore the incomplete transaction will have to be rolled back in the database snapshot and I suspect this is why it is not immediately available.

Clare
_________________________________________________________________________________________________________________
Measure twice; cut once (and have a good saw)

Hey, just a thought.....did you check Books Online yet?
Post #1347576
Posted Tuesday, August 21, 2012 10:27 PM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Wednesday, July 23, 2014 1:13 PM
Points: 774, Visits: 1,734
Thank you.
Post #1348175
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse