SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Db Snapshots question


Db Snapshots question

Author
Message
Oracle_91
Oracle_91
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1184 Visits: 1742
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.
MissTippsInOz
MissTippsInOz
Old Hand
Old Hand (397 reputation)Old Hand (397 reputation)Old Hand (397 reputation)Old Hand (397 reputation)Old Hand (397 reputation)Old Hand (397 reputation)Old Hand (397 reputation)Old Hand (397 reputation)

Group: General Forum Members
Points: 397 Visits: 597
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?
Oracle_91
Oracle_91
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1184 Visits: 1742
Thank you.
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