473,654 Members | 3,129 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hanging during READ_COMMITTED_ SNAPSHOT ON

When issuing the below command on any of our databases, it just hangs
forever.

ALTER DATABASE DBName SET READ_COMMITTED_ SNAPSHOT ON;

I realize that all connections expect the query window need to be
closed and that is the case I think, or at least we are resetting the
web server and still see the issue. The only way I have been able to
fix it is to completely stop and restart the database server, then
issue the command and it returns immediately.

This is a pain though and has to be done after hours. Is there a way to
issue the command while the system is in use, possibly taking just that
database offline (and not all other Dbs on the server) for a short time
and then returning it back to use using just scripting?

May 24 '06 #1
10 32779
pb648174 (go****@webpaul .net) writes:
When issuing the below command on any of our databases, it just hangs
forever.

ALTER DATABASE DBName SET READ_COMMITTED_ SNAPSHOT ON;

I realize that all connections expect the query window need to be
closed and that is the case I think, or at least we are resetting the
web server and still see the issue. The only way I have been able to
fix it is to completely stop and restart the database server, then
issue the command and it returns immediately.


Did you use sp_who to see what other connections to the database that
were active?

You can use

ALTER DATABASE db SET SINGLE_USER WITH ROLLBACK IMMEDIATE

as a guick way to get everyone out. Don't forget to set it back to
multi user when you are done.

--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
May 25 '06 #2
The problems happen intermittently, so I can't really execute the
sp_who statement when there is an error. Theoretically, how could it
ever block? Shouldn't it just get the version of the row before the
transaction started for the read operation?

May 25 '06 #3
Whoops, wrong message, nevermind

May 25 '06 #4
In case anyone is interested, here is the final solution we came up
with. It assumes the current DB is the one you want to set for snapshot
mania and will execute only on SQL 2005 without throwing errors on SQL
2000.

if(charindex('M icrosoft SQL Server 2005',@@version ) > 0)
begin
declare @sql varchar(8000)
select @sql = '
ALTER DATABASE ' + DB_NAME() + ' SET SINGLE_USER WITH ROLLBACK
IMMEDIATE ;
ALTER DATABASE ' + DB_NAME() + ' SET READ_COMMITTED_ SNAPSHOT ON;
ALTER DATABASE ' + DB_NAME() + ' SET MULTI_USER;
'
Exec(@sql)
end
go

May 26 '06 #5
pb648174 (go****@webpaul .net) writes:
In case anyone is interested, here is the final solution we came up
with. It assumes the current DB is the one you want to set for snapshot
mania and will execute only on SQL 2005 without throwing errors on SQL
2000.

if(charindex('M icrosoft SQL Server 2005',@@version ) > 0)


A somewhat simpler test:

if serverproperty( 'ProductVersion ') not like '[1-8].%'

--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
May 26 '06 #6
if CAST(serverprop erty('ProductVe rsion') as varchar) not like '[1-8].%'
Erland Sommarskog wrote:
pb648174 (go****@webpaul .net) writes:
In case anyone is interested, here is the final solution we came up
with. It assumes the current DB is the one you want to set for snapshot
mania and will execute only on SQL 2005 without throwing errors on SQL
2000.

if(charindex('M icrosoft SQL Server 2005',@@version ) > 0)


A somewhat simpler test:

if serverproperty( 'ProductVersion ') not like '[1-8].%'

--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


May 30 '06 #7

Hi *,
Is there any simpler way to set Isolation level means not
using the PL/SQL block.
~Vivek
--
sharma_vivek_us
------------------------------------------------------------------------
sharma_vivek_us 's Profile: http://www.dbtalk.net/m441
View this thread: http://www.dbtalk.net/t309038

Jun 20 '06 #8
sharma_vivek_us (sh************ ********@no-mx.forums.yourd omain.com.au)
writes:
Is there any simpler way to set Isolation level means not
using the PL/SQL block.


Could you clarify what you want to achieve?

"PL/SQL block" is not something you need to use with SQL Server - or even
can. PL/SQL is Oracle or DB2.

--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Jun 20 '06 #9
What's you hardware conf.? You may want to check the controller's
behavior...The versionning behind READ_COMMITTED_ SNAPSHOT imposes super
heavy IO overhead on the controller...Se t up a trace on Physical Disk:
Average sec per/write
Physical Disk: Average sec per/read and monitor until next
problem...Inter mittent behaviors often result of a extreme disphase
between physical resources and logical need...

pb648174 wrote:
When issuing the below command on any of our databases, it just hangs
forever.

ALTER DATABASE DBName SET READ_COMMITTED_ SNAPSHOT ON;

I realize that all connections expect the query window need to be
closed and that is the case I think, or at least we are resetting the
web server and still see the issue. The only way I have been able to
fix it is to completely stop and restart the database server, then
issue the command and it returns immediately.

This is a pain though and has to be done after hours. Is there a way to
issue the command while the system is in use, possibly taking just that
database offline (and not all other Dbs on the server) for a short time
and then returning it back to use using just scripting?


Jun 20 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1492
by: omission9 | last post by:
Any advice on the following would be much appreciated. I have thrown everything I have at it and am completely stumped. I apologize for the length, I have tried to be as succint as possible. I have a pythoncard/wxPython application. The application works well except that users were reporting occasional crashes. The application would simply stop and just hang. I was able to reproduce the bug faithfully and ran the application in the...
6
6689
by: Harlan Messinger | last post by:
A publication style guide indicates that for a table heading like the following, Table 3. Wheat and rye harvest in European countries in years that end in 3 or 7 or when a new prime minister takes office. when the heading flows over more than one line, a hanging indent should be used, such that the remainder of the heading should be left-aligned, in this example, with "Wheat", leaving "Table 3. " standing off by itself on the left.
25
5016
by: Shannon Jacobs | last post by:
Maybe there is a simple trick here, and I'm not spotting it... Is there a guru of CSS hanging around here who can help out? The page in question has a multi-column table with a list of links in each column. Because links are added and deleted separately in each column, it would be exceedingly awkward to use a separate table row for each link. Therefore, within each column the links are separated by <br> tags. However, the automatic line...
1
3063
by: =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?= | last post by:
Hello guys, I was wondering if anybody here had implemented a solution where Tables are aligned according to what the hanging indent tells us when there is a potential for the table overflowing in the right margin or out of the page. I did some research a while back and came to the conclusion at that time that it wasn't possible to have both (either we align on the hanging indent and if there is a potential for a table to be 6.75
2
1585
by: Neil | last post by:
I'm using Access 2000 with a SQL 7 back end. I recently implemented some code in a form's AfterUpdate event which calls a stored procedure which copies the contents of the current record to a history table. The code works fine when the user edits and saves the record. However, if the user performs a Find and Replace, the code hangs. At first I thought the code was hanging because of multiple records being replaced. But when I debugged...
5
2378
by: Stanimir Stamenkov | last post by:
I'm trying to style an icon "hanging" below the first line of a heading and I've found interesting difference between Mozilla and the other browsers I'm trying with - Safari 3.1.1, Opera 9.27 and IE 6: http://www.geocities.com/stanio/test/hanging-icon.html I've used negative 'text-indent' and with Mozilla the first line of text doesn't flow over the "hanging" icon, while with the other browsers I see what I want to achieve. Which is...
3
1680
by: Microsoft | last post by:
Hi I have a c# program that continually runs 24/7 and performs a variety of tasks based on a timer. There is one routine that hangs every Saturday morning without fail. If I restart the program throughout the week is still hangs. I can restart it immediatly after the hang and it runs fine until next Saturday. There is nothing different about Saturday that I can think of.
2
8317
by: kj | last post by:
Hi! I have a Pythonoob question. I have a script that hangs indefinitely at random times; the only thing to do at this point is to kill it. I'm looking for suggestions on how to troubleshoot and debug the problem. I'm not even sure of where exactly the script is hanging, though I suspect it is right around when it tries to read from a pipe
1
1569
by: =?Utf-8?B?QW5uaWU=?= | last post by:
I'm using Vista Home...just updated my Spysweeper to 5.8. While running a sweep, it got stuck and wouldn't continue its process. I then canceled the sweep...now it's hanging during the cancellation process! So 2 questions: 1. What would cause the hang? Bad file? Bad upgrade? 2. Why won't the program stop? It's still saying 'cancel in progress' and that was 2 hours ago! Should I just turn off my computer?
0
8372
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8814
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8706
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8475
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7304
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5621
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2709
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1592
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.