How Long A Table Blocked

Jul 20, 2005

I have written a stored procedure to list out all tables in which
rows or the table itself is locked. The only information I am
not able to get is the time when the lock occurred. The way I
want is that if I run the procedure it should show all locks
on a table which are at least 5 or x seconds old. This way I can
avoid momentary locks on a table which go away after few seconds.

Which table and column of master database has that information?

Thanks.

--

email id is bogus

View 3 Replies


ADVERTISEMENT

Long Blocked Transaction Logging

May 5, 2007

Is there anyone know any feature in SQL server which can detect/log the transaction which has been blocked unusually long? My idea is:



If a transaction has run for over 30 minutes, then log the following information in SQL server log:

1. State of the transaction : Blocked, Running, Sleeping

2. Time happeing

3. Duration

4. Last SQL it run

5. Blocked by which thread and info of the thread : the last SQL it run, the state of the thread.



Possibly it would be run in SQL server agent or SQL profiler has such feature, I am not sure about it. Can anyone suggest? Thanks.

View 4 Replies View Related

Sync'd Table Updates Blocked

Feb 11, 2008

Hi

I'm using VS'08 and develop in VB.

I'm using SQL CE 3.5 as a local cache for SQL'05 tables.

The table that's being updated uses an interger autonumber for the PK.

When the program starts up and inserts records into the table, it works, as long as no on else is insering recoreds into the same table.

Once a duplicate PK is created by another WS, the records no longer update the SQL'05 table.

If the blocked program is restarted, it'll insert records with a PK that's past the one found at the initial sync. until blocked again.

PK ---- ProgID ----- MSG




1
0
4
B
hello
2/6/2008 9:33:55 PM
2/6/2008 9:33:55 PM

2
0
4
B
hello
2/11/2008 7:54:38 PM
2/11/2008 7:54:38 PM

3
1
1
B
hello
2/11/2008 8:32:41 PM
2/11/2008 8:32:41 PM

4
0
4
T
just something
2/11/2008 8:34:18 PM
2/11/2008 8:34:18 PM

5
1
1
B
one
2/11/2008 9:13:41 PM
2/11/2008 9:13:41 PM

6
1
1
B
two
2/11/2008 9:14:06 PM
2/11/2008 9:14:06 PM

7
1
1
B
three
2/11/2008 9:14:35 PM
2/11/2008 9:14:35 PM

8
1
1
B
four
2/11/2008 9:15:04 PM
2/11/2008 9:15:04 PM

9
1
1
B
five
2/11/2008 9:15:59 PM
2/11/2008 9:15:59 PM

10
0
4
B
cp 1
2/11/2008 9:17:44 PM
2/11/2008 9:17:44 PM

11
0
4
B
cp 2
2/11/2008 9:18:13 PM
2/11/2008 9:18:13 PM

12
1
1
B
eight
2/11/2008 9:21:31 PM
2/11/2008 9:21:31 PM

13
0
4
B
cp 3
2/11/2008 9:21:52 PM
2/11/2008 9:21:52 PM

NULL
NULL
NULL
NULL
NULL
NULL
NULL

David L.

View 8 Replies View Related

Access To Table Blocked Signature Is Not Valid

Aug 3, 2007

I created sqlexpress database and .net app, everything was fine on my local machine.

When I moved the app to my server, I detached the database with SMSS express, moved the MDF file over along with the app files and I attached to the database with SSMS to make sure everything went over ok but when I try to open a table I get the error,


SQL Execution Error
Executed statement: Select x, x, x, x,x from tblFile
Error source: .Net SqlClient Data Provider
Error Message: Access to table dbl.tblFile is blocked because the signature is not valid.

I can open the stored procedures fine by choosing modify from the context menu.

Any ideas here?

View 1 Replies View Related

Long Table Locks

Jul 20, 2005

HiThere is an application that runs on sql server.The application selects/updates some few tables frequentlyOnce there is even a select on this table .It blocks other userssometimes for very long.Is there anything that can be done to reduce this?The table has 18000 rows and does not seem to have an indexI thought indexing might help but 18000 rows without an index isno reason for 30 minutes of lock time.I will appreciate your help as usualVince

View 1 Replies View Related

Table Name Too Long Via ODBC

Aug 16, 2006

Hi,

I am traing to execute this select

SELECT count(*) CM_CERT_VARIANCE_DET_APINV_RELATE

using SQL SERVER ODBC, however, I received this message:

"Identifer too long"

Is there any table length name limitation?

I think, there is, because works well on SQL environment.

I mean, should this table have less then 18 characters? Can I work around this limitation?



cheers,

Alessandro

View 6 Replies View Related

To Divide One Long Db Table Into Many Shorter Ones???

Jun 8, 2001

Hello Folks,

I'm looking for the group's collective wisdom on the following issue, I'm sure many have been confronted with it.

I'm designing a db for a website that will utilize SQL Server 7. I have few tables that I think will grow very large row wise and that will be written to an read from frequently. I sense that I might be able to get better perfomance out of the system if I split many of these large tables up (row wise) into many smaller tables.

For example, The website that I'm working on has a "MailingAddresses" db table that contains the mailing addresses for the sites users (subscribers and other misc users - 1 record per user, anticipating 70,000+ users). Each user can update their record, and there will be frequent queries to the tables to get addresses for both internal admin use and for display on public webpages.

The website has five distinct sections that are in some sense like five distinct websites. Each user belongs to only one of these sections and they won't migrate between sections. Therefore I'm considering breaking up the one large "MailingAddresses" tables into five smaller tables, one for each section, i.e., "MAddressesSectionA", ..., "MAddressesSectionE".

These tables will have the same fields and constraints. Also of course there would be the same number of reads and writes in total with the five smaller tables as compared to that for the one big table. Also the combined size of the info in the five smaller tables would be the same as that for the one large table.

Though it's going to more of a pain to manage five tables versus one, I have a hunch it might be easier for the dbms to handle reads and writes with five smaller tables than with one large table...

...Of course this is true when queries are mainly respective to users from just one or two of the sections (as might be the case) - the big table then has the overhead of the address records for users in the other sections. BUT is there any benefit with the five smaller tables route when they are all frequently accessed??? Sure each select query has fewer records to go through, but with all five tables in play the dbms has to deal on average with the same amount of info as in the one big table.

What do you folks think, to divide or not to divide the big table(s) up row wise into smaller tables?

I guess the issue is summed up in this question: In general, can a dbms better handle in memory, and more quickly write to and query access - one BIG table with a+b+...+n records, or N smaller tables with a, b,...,n records respectively?


Thanks for the collective wisdom, - Jerry

View 2 Replies View Related

Long Query Rollback - Can I Rename The Table?

Mar 8, 2007

I have a long query which I have set off and would like to stop, andrename one of the tables used.My query is due to my lack of understanding of the underlyingstructure of MSSQL-Server...So say and update updates TABLE_A and I stop it, whilst thistransaction is rolling back I attempt to rename TABLE_A to TABLE_A_OLDand rename a different table to become TABLE_A. I am assuming thatthe rollback actions will use the object reference of TABLE_A_OLD andcontinue to rollback the effects on the correct table and not corrupt'new' TABLE_A... or will it not allow me to rename TABLE_A until therollback is complete?Thanks for any help!Steve

View 1 Replies View Related

Import Long Text From Excel Into Table

Dec 3, 2007



Hi everyone,

I've got an excel file that I want to import into a database table.
The longest text in a cell is 385 characters.
I've made the fields in the table nvarchar(1024).

I created a data flow task for the import.

When I run this task, I get the following error:

[Excel Source [1]] Error: There was an error with output column "Line Text" (52) on output "Excel Source Output" (9). The column status returned was: "Text was truncated or one or more characters had no match in the target code page.".
[Excel Source [1]] Error: The "output column "Line Text" (52)" failed because truncation occurred, and the truncation row disposition on "output column "Line Text" (52)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.



is it possible that there is a restriction on the length of the text ?

regards,

Filip

View 8 Replies View Related

Not Able To Retrieve Rows From Small Table-So Many Time For So Long

Mar 8, 2005

Dear Participants,

We are using merge replication for multi locational database but we are facing one problem in only one table which is not included in replication-

Table name is xxxxmast has only 39 row static information, but it used by every users for all task as select only information from this table like-

Select fin_year into mem_variable from xxxxmast where co_name = :global_variable
go

Code validation from here only.

Right validation from here only.

Report retrival validation from here only.

It means its usage for select from every user frequentely for so many times but we have to only fetch information from this table.

It was working prior fine but rightnow get problem for while-

Today Dated 08-March this table not accessible fro three times in eight hours-

1st time for 10 minute.

2nd time 10 minutes

3rd time 52 minutes.

Users want to login but at the login time years and other validation from this table, so users awaited for above mention time.

We had have do following by yesterday-

Drop table xxxxmast.

Create table xxxxmast.

Insert required data.


This is realy trouble for our application.

Any help realy great for us.

Thanks

R.Mall

View 3 Replies View Related

Long Transaction With Locks Is Blocking All Other Activity To Table

Oct 1, 2007

We have a web-based third-party application that has both background processes and user activity requests running in the same database (SQL Server 2005 SP2). The problem is that a background process will start a long-running transaction and hold an exclusive lock on a few rows in a given table (a small table, <100 rows). The web clients need to scan this same table, but when their "select *" statements get to those locked row(s), the web client queries stall waiting for that exclusive lock to be released. This effectively brings the entire web front end to a halt because all clients must hit this table for each user action. I realize that this is the classic lock condition that multiversioning databases like Oracle, PostgreSQL, SQL Server Compact Edition, and other databases do not suffer because they don't use shared read locks like SQL Server. But since we're on SQL Server for this app, what is the way to get around this problem? Modifying the clients to use WITH (NOLOCK) is not an option... there will be major consistency issues unless the clients run in Read Committed or higher. Any ideas? We could tweak this app if needed. Does SQL Server 2008 introduce multiversioning or at least some mechanism to get around this problem? I did not see it mentioned on the Microsoft site, but maybe I missed it. Thanks in advance.


Austin

View 6 Replies View Related

Population Of Dimension Table Takes Long Time

May 26, 2008



Hi,

The scenario is the data comes from various sources and its staged into staging database. From this staging database it goes into data warehouse database. Everyday this staging database is truncated and repopulated from various sources.
I've a dimension table called DimCustomers which consists of around 300,000 rows and has lots of different types of SCD columns. It takes around 4-5 hours to load data from staging to this dimension table. Currently I'm using a For Loop container which uses a store proc to extract 15000 rows each time and populate my dimension tables. First couple of loops it goes off quickly but as and when the number reaches half of the count it slows down and hence it takes around 4-5 hours to load data.

What would be the best approach to populate this kind of dimension table.

Thanks

View 7 Replies View Related

Estimate On How Long It Might Take To Full-text Index A Table With 21,000 Rows?

Jan 31, 2005

i need to full-text index a table so that i can easily search the text fields of that table.. the table has about 21,000 rows, and i was wondering how long it might take to full-text index it?

thanks

View 1 Replies View Related

SQL Server 2014 :: Alter Table Add 2 Fields Takes Too Long

Sep 25, 2015

We have a proc that adds some fields to a few tables of ours and normally there are no issues. For one of our client databases this process is taking anywhere from 5-10 minutes to add the fields. This causes an issue where the app will timeout waiting. After plugging around and looking at the proc and trying different items i found it to only be for this one database and ONLY when there is data in the table. If i truncate the table and run the same procedure everything is fine. Tables all have same index on 4 columns and the columns being added are not indexed because of the stupid hoops we have to jump thru to pre-pivot data for our reporting package.

View 4 Replies View Related

SQL Server 2008 :: Store Long Values To Be Used In (IN) Statement In Separate Table?

Jul 14, 2015

I have several reports that are looking for a code within a certain set of codes or ranges. The specific list of codes to be including is determined by the end user. Currently my "IN" statement can be a hundred lines, listing several ranges, lists of specific codes, etc. I am constantly getting asked what codes does it include, is this code included, etc. Sometimes they'll give me a printed 10 page list of codes and want me to compare to what I have included in the report. Not ideal in the slightest.

What I'd like to do is have a table or a file of some kind somewhere where the end user can view the codes contained, add new ones, and delete ones they no longer want. Then I'd like to be able to just reference that file in my IN statement. Leaving the responsibility of listing the correct codes on them.

View 9 Replies View Related

Blocked/Blocking

Dec 7, 1999

Hello...

Is it normal in SQL Server 6.5 the user who only running the query blocking the other user who try to update/add the records?

note: The query is a complex SQL.

Many Thanks!

View 2 Replies View Related

Blocked Process

Mar 17, 1999

We are using SQL server 6.5 and currently have about 100 users connections at a given
point in time. The application is Visual Basic 5.0 based and it allows users to create
MS Word documents from the application. These documents names are stored in a table which basically
acts as a reference table. Every time a document needs to be attached to a record
this table is called with an insert/update query. This results in an exclusive page/table
lock and ends up into a blocked process. This finally results into a major halt for
all the system users.

Manual killing of these blocked processes frees up the resources and brings things back to normal
although disruptive to the users.

Any clue as to why the blocked processes are not able to free themsevles up ?
Are we missing something in our SQL configuration that will help us with unblocking
these processes ?

View 1 Replies View Related

Shrink Db Blocked

Feb 27, 2002

Hi,

Issuing 'dbcc shrinkfile (log ,truncateonly)'

I get the error message below. Books online doesn't say any more.
Can anyone explain? I am the only user connected to the db at the time, no jobs are executing.

Cannot shrink log file 2 (log) because all logical log files are in use.

(1 row(s) affected)

DBCC execution completed. If DBCC printed error messages, contact your system administrator.

View 1 Replies View Related

Blocked By SPID -1?????

Oct 6, 1998

What is SPID -1? I see nothing listing it in any activity monitor, but it has just recently started blocking some processes.


Thanks,
jim craddock

View 3 Replies View Related

Still Getting Blocked Despite WITH (NOLOCK)

Apr 5, 2006

I'm running a heavy SELECT query using WITH (NOLOCK). This still causes other processes trying to INSERT in one of the tables to get blocked.
I thought the locking hint would prevent from blocking other processes?

View 4 Replies View Related

Your Upgrade Is Blocked

Jun 29, 2006

I am getting the following error message when I tried installing the 2005 Developer Edition from the MSDN kit. I previously installed the 2005 Express Edition, and it worked just fine, so I thought that the install failed as it was at a lower version than the Express Edition. I uninstalled the SQLExpress Edition, however, when I try to install SQL Server 2005 again, I get the following message:



Name: Microsoft SQL Server 2005 Tools

Reason: Your upgrade is blocked. For more information about upgrade support, see the "Version and Edition Upgrades" and "Hardware and Software Requirements" topics in SQL Server 2005 Setup Help or SQL Server 2005 Books Online.

Build version check:

Your upgrade is blocked because the existing component is a later version than the version you are trying to upgrade to. To modify an existing SQL Server component, go to Add or Remove Programs in Control Panel, select the component you would like to modify, and then click Change/Remove.

Name: Microsoft SQL Server 2005 Tools

Reason: Your upgrade is blocked. For more information about upgrade support, see the "Version and Edition Upgrades" and "Hardware and Software Requirements" topics in SQL Server 2005 Setup Help or SQL Server 2005 Books Online.

Build version check:

Your upgrade is blocked because the existing component is a later version than the version you are trying to upgrade to. To modify an existing SQL Server component, go to Add or Remove Programs in Control Panel, select the component you would like to modify, and then click Change/Remove.



I have also installed Visual Studio NET, and I wonder if some component in the Studio app is holding back the SQL Server install. I have uninstalled all SQL components several times already, and I keep on getting this message.



Gregory



Gregory

View 1 Replies View Related

Mirroring Blocked And DB Got Down!!!

May 4, 2008

Hi all,


I have an SQL Server 2005 mirroring config with "High availability". Twice over the past four weeks, the principal server started logging to the event log:

"All schedulers on Node 0 appear deadlocked due to a large number of worker threads waiting on DBMIRROR_DBM_EVENT" I checked the database activity monitor and indeed there were lots of processes in DBMIRROR_DBM_EVENT.

The database was totally unresponsive to queries (all got timeouts), and no failover was done.

This are the log entries for all day:

05/04/2008 08:40:44,Server,Unknown,All schedulers on Node 0 appear deadlocked due to a large number of worker threads waiting on DBMIRROR_DBM_EVENT. Process Utilization 0%.
05/04/2008 08:39:44,Server,Unknown,All schedulers on Node 0 appear deadlocked due to a large number of worker threads waiting on DBMIRROR_DBM_EVENT. Process Utilization 0%.
05/04/2008 08:38:44,Server,Unknown,All schedulers on Node 0 appear deadlocked due to a large number of worker threads waiting on DBMIRROR_DBM_EVENT. Process Utilization 0%.
05/04/2008 08:37:44,Server,Unknown,All schedulers on Node 0 appear deadlocked due to a large number of worker threads waiting on DBMIRROR_DBM_EVENT. Process Utilization 0%.
05/04/2008 08:36:44,Server,Unknown,All schedulers on Node 0 appear deadlocked due to a large number of worker threads waiting on DBMIRROR_DBM_EVENT. Process Utilization 0%.
05/04/2008 08:35:44,Server,Unknown,All schedulers on Node 0 appear deadlocked due to a large number of worker threads waiting on DBMIRROR_DBM_EVENT. Process Utilization 0%.
05/04/2008 08:33:49,Server,Unknown,The time stamp counter of CPU on scheduler id 2 is not synchronized with other CPUs.
05/04/2008 03:24:02,Backup,Unknown,Log was backed up. Database: TeleCable<c/> creation date(time): 2007/08/24(13:38:00)<c/> first LSN: 205089:18926:1<c/> last LSN: 209688:18463:1<c/> number of dump devices: 1<c/> device information: (FILE=1<c/> TYPE=DISK: {'\face01f$logbackup'}). This is an informational message only. No user action is required.
05/04/2008 00:00:14,spid24s,Unknown,This instance of SQL Server has been using a process ID of 1700 since 4/9/2008 3:18:54 AM (local) 4/9/2008 1:18:54 AM (UTC). This is an informational message only; no user action is required.

After that, the same entry once per minute.

I restarted the database and everything came to normal.


As you can imagine, the problem is really serious.

Should I forget about mirroring? Anyone has experienced something similar?

Thanks in advance and best regards.

View 11 Replies View Related

SERIALIZABLE TRANSACTION Getting Blocked?

Jun 10, 2004

Hi guys,

I have a stored procedure which generates the next sequence number...
it uses SERIALIZABLE Option. procs look something like below..

begin
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
BEGIN TRANSACTION

Sequence generating statement...

COMMIT TRANSACTION
set @NextSequenceValue = @NextSequenceValue
Return @NextSequenceValue
end

For some reason when i call the proc with below parameters to get next sequence number.. its hungs up..


declare @NextSequenceValue int
set @NextSequenceValue = 0
exec spGetNextSequence 19, 'LotSequence', @NextSequenceValue output, Null
select @NextSequenceValue as NextSequenceValue


When i queried sp_who2 it shows that my processid is blocked by some other processid.. and when i do DBCC INPUTBUFFER (blockingprocessid), the query of blocking processid and my nextsequence generation stored proc is not realted at all..

Can you help shed some light on why my nextsequence generating proc is getting hunged...?

help is appericated..

View 4 Replies View Related

Killing A Blocked Process

Jul 21, 1999

If I kill a blocked process, why does the current activity window still show the process? Both processes, blocking and blocked, are scheduled tasks. Also, the blocked process is still listed as a running task in the manage scheduled task window.

View 1 Replies View Related

Process Being Blocked By SPID -1

May 10, 1999

The following is an extract from sp_who2

SPID Status Login HostName BlkBy DBName Command CPUTime DiskIO
----- ---------- ------- -------- ----- ------- ------- ------- ------
162 sleeping om18682 . -1 STIPROD SELECT 236 120

Has anybody experienced a process being blocked by SPID -1.

View 4 Replies View Related

Connection Blocked By Process -2

Oct 18, 2007

Hi,

I have a fairly complex application running which has numerous connections on various threads accessing my sql 2005 database.

Every now and then I find that one of my connections is being blocked by process with a pid of -2.

I assume this is some system process.

The only way I can get my application going again is to restart the sql server.

Can someone tell me what process -2 is?

cheers,
Robert

View 2 Replies View Related

Insert Statement Blocked

Sep 25, 2006

HiShortly, I keep invoices in a table.Occasionally, someone will fire the execution of a stored procedure(SP) that performs several UPDATEs against (potentially) all invoicesOLDER than a date that is supplied to the SP as a parameter.The SP is usually a lengthy process (it takes at least 30 mins).The problem is that SQL server 2000 Dev Edition doesn't allow me toinsert new invoices that are "younger", while the SP is executing.How should I specify to SQL Server that new invoices are "harmless"?Thanks.

View 8 Replies View Related

Blocked Transaction Problem

Oct 11, 2006

Hello,

I am trying to execute next query, but when doing it, TABLE1 locks and it does not finish.

SERVER2 is a linked server.

BEGIN TRAN
INSERT INTO TABLE1
SELECT * FROM SERVER2.DATABASE2.DBO.TABLE2 WHERE TAB_F1 IS NULL
COMMIT TRAN

I have same configuration in other 2 computers and it works ok.

What is the problem?

Thank you!!

View 8 Replies View Related

Database Blocked - URGENT!!

Apr 2, 2007

Hi guys,



we have a database here and something happened which causes a database block. We tried to run the 'sp_who' 'active' command to see the spid which locked the database, and we found out that some transaction is blocking another transaction. The following is the sample data results from the sp_who 'active'





spid ecid status loginame hostname blk dbname cmd

52 0 sleeping HOSTINGSQLMonitor BLUE2 185 tempdb INSERT
53 0 sleeping sa 10.10.10.106 185 mfgq_live SELECT
56 0 sleeping sa 10.10.10.106 175 mfgq_live UPDATE
57 0 sleeping sa 10.10.10.143 185 mfgq_live SELECT




We killed all spid which casuse the blocking, but they are keep on coming.



Does anybody have any idea on what casuses this problem or a teporary solution for this? Please help.



Thx

View 1 Replies View Related

Spid Blocked By Itself On SQL 2000 SP4

Jul 31, 2007

Hi

On one of my SQL servers (SQL 2000 SP4) i have a problem with spid blocked by itself (spid 54 (Blocked by 54)).

On the server it's running a verry simple UPDATE statement (from the Query Analizer)'. The query needs very long time to finalize (on SP3 it was very fast). I searched some forums regarding this issue and i found that maybe the SP4 can cause this problem.

Do you have any idea or advice?

Thanks


View 17 Replies View Related

SQL 2005 SP2 Installation Blocked

Feb 20, 2007

I'm getting the following error when I try to run SQL05 SP2 on my server. When I get to the Authentication screen, I select Windows Authentication and check the box to use for all services. I am logged in using my personal admin account. I click the 'Test' button. Connection to Database Services, instance name 'MSSQLSERVER' is successful. However, connection to Reporting Services, instance name 'myserverSSRS' fails. The error message is: "Login failed: HResult 0x2, Level 16, State 1, Named pipes provider: Could not open a connection to SQL Server[2]. Sqlcmd: Error: Microsoft SQL Native Client: An error has occurred while establishing a connection to the server. When connecting to SQL Server."

I've had problems getting Reporting Services to work. Is this message a result of SSRS not being set up properly? How can I correct this?

View 7 Replies View Related

SQL In SSIS Package Sometimes Is Blocked.

Apr 17, 2007

I have an SSIS package that is basic in nature. It imports a flat file and makes some inserts to tables via OLE destination and also updates some tables via stored procedure calls using params. Sometimes the process "locks" and never finishes. When it locks it gets locked by process "-2" or a value that is not an actual process. What does this mean? What is -2?

View 3 Replies View Related

VB Database Connection Blocked

Jun 8, 2007

Message: Generating user instances in SQL Server is disabled. Use sp_configure 'user instances enabled' to generate user instances.



I am using VB2005 Express. I had, evidently, a simpler version of SQL but deleted it, as was recommended, and then downloaded SQL 2005 Express. Now when trying to open an SQL database in a project I get that Information Message.



FURTHERMORE after loading the new SQL it wiped out all of my projects in VB 2005. The back up files were wiped out also.

That was naughty!

Thank you in advance for a reply.

gascitydan@yahoo.com

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved