Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


enabling READ_COMMITTED_SNAPSHOT


enabling READ_COMMITTED_SNAPSHOT

Author
Message
Chris Townson
Chris Townson
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 1

Hi,

I'm currently installing service pack 1 to webCT 6 Campus Edition (Virtual Learning Environment) which requires READ_COMMITTED_SNAPSHOT to be turned on.

I have connected to the database at administrator level (owner of db) and executed the following query:

ALTER DATABASE webctdatabase SET READ_COMMITTED_SNAPSHOT ON
Go

The query runs but never finishes. I have been checking for changes using:

select name,is_read_committed_snapshot_on from sys.database

but the result is still 0 (off).

Interestingly I ran the following query and it completed successfully, instantly.

ALTER DATABASE webctdatabase SET ALLOW_SNAPSHOT_ISOLATION ON

Where am I going wrong?

Chris.


Ted Pitts
Ted Pitts
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 207

The READ_COMMITTED_SNAPSHOT option can only be set if you are the only connection to the database. So when you see that command running for a long time, it is waiting for all the other connections to close.

You need to add a termination clause to the command to make sure it doesn't run forever, such as: WITH NOWAIT or WITH ROLLBACK AFTER 30 SECONDS

e.g. ALTER DATABASE webctdatabase SET READ_COMMITTED_SNAPSHOT ON WITH NOWAIT





Chris Townson
Chris Townson
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 1
excellent! thanks very much!
logicinside22
logicinside22
Old Hand
Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)

Group: General Forum Members
Points: 330 Visits: 1389
Had Same issue yesterday and i put database in single use mode and ran it again then put it multi user mode. works fine to me

Aim to inspire rather than to teach.
SQL Server DBA
GilaMonster
GilaMonster
SSC-Forever
SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)

Group: General Forum Members
Points: 47251 Visits: 44379
Please note: 7 year old thread.


Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


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