Showing posts with label hangs. Show all posts
Showing posts with label hangs. Show all posts

Sunday, March 25, 2012

Alter View Hangs - Merge Replication SQL 2005

Background - I have a publication that propigates schema changes. I have a view in which I want to remove a column.

Error - Going by what the BOL says, I use Alter View and delete the column from my select statement. I issue the alter view command against the Publication database and it just "churns". I do not get any locking errors or any other type of error, but the statement never completes execution. I watched it run for 10 minutes and cancelled the query. Executing the same statement against a copy of the database that is not being published executes in 1, 2 seconds.

Here is what I am doing:

Old View: Select table1.record_number, table1.record_date, table1.status_code, table2.status_desc,

table2.txt_sort_order

FROM table1 join table2 on table1.status_code = table2.status_code

The query I am executing:

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

ALTER VIEW myview

AS

Select table1.record_number, table1.record_date, table1.status_code, table2.status_desc

FROM table1 join table2 on table1.status_code = table2.status_code

If this view is the only article in the publication, then it is a known issue.

Add a dummy table to the publication and your alter should succeed.

Thursday, February 9, 2012

All DB ops hangs in sql2000

Hi
We have a warehouse fact table with millions of rows.
When we run a report that select massive amount of data
all the queries against that table hangs.
We checked there were no outstanding transactions against that table.
Any ideas what it could be.
Tks
MangeshMangesh Deshpande wrote:
> Hi
> We have a warehouse fact table with millions of rows.
> When we run a report that select massive amount of data
> all the queries against that table hangs.
> We checked there were no outstanding transactions against that table.
> Any ideas what it could be.
> Tks
> Mangesh
Are any of the queries timing out, possibly leaving locks on the server
until the connection is cleaned up by SQL Server?
What about blocking issues? Can you use a NOLOCK hint on the "massive"
queries to prevent shared locks from being taken?
David Gugick
Imceda Software
www.imceda.com