I have a question on database snapshots.
I have created a table and inserted 2 rows.
create table tab7
(c1 int primary key clustered,
insert into tab7
Then i have created a snapshot. it created in 2 secs.
Then i am inserting 50000 rows into the table in a transaction. Parallely,
declare @i int
set @i = 3
while @i <= 50000
insert into tab7 values (@i, @i, 'a')
set @i = @i + 1
I opened a new session, i have initiated the create database snapshot. My observation, i see
CREATE DATABASE testdb_snap2
(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.