Can we identify the reason for a Deadlock , after it has passed. I mean can I get to knw the reason as to why the deadlock occured yesterday on my production box.
I had not left the profiler on ... neither did I send the dead lock erorrs to the SQL error logs using the DBCC TRACEON (1204, 3605, -1)
There are a series of traces of transactions for essentially the same units of work. Each includes a retrieving the same table "Select" from the database. The first 4 transactions ran concurrently. The last one ran about 7 minutes later with no other concurrent transactions.
The elapsed times for the database accesses for each of the first 4 is significantly higher than the last one. Can you think of any database optimazation that might improve this?
Are there any utilities available than can be used for stand-alone testing of SQL Server database performance? E.G. they would measure response time for reading/writing large/small amounts of canned data once/multiple times with concurrent/nonconcurrent access.
SQL Server Database is on 2000.I am not sure about the ISOLATION level in the Java code.
Basically I am new to SQL Sever....Please ans the above questions and provide me the direction to proceed on these questions
Is there a way to send out an email woth deadlock information (victim query, winner query, process id's and resources on which the deadlock occurred) as soon as a deadlock occurs in a database or at instance level?I currently has trace flag 1222 turned on. And also created an alert that send me an email whenever a deadlock occurs. but it just says that a deadlock occurred and I log into sql server error log and review the information.
I have recently started working on a OLAP application. The database is around 35 gig, with over half of that space being taken by the indexes. What has happened is previous developers have added indexes to attempt to improve the performance of a select statement (for reporting). Some of the indexes work, but many do not.
I would like to drop the ineffective indices. What I would like is a way to find if indexes are being used, preferably by object name. Is there a third party vendor that can monitor objects and how much they are used? Is there another way to do this using SQL?
How can get an object's dependencies in SQL Server. For example it I have written a procedure which accesses some tables inside it then the procedure is said to be dependent on that table. Or one procedure might call another procedure and hence dependent.
Can I know an object's dependent objects from any system table. I think Oracle has a table USER_DEPENDENCIES which provides this info (I may be wrong :-().
Some columns in transaction tables are "mandatory fields" on the dataentry screens, and as a result tend to accumulate junk entries, wherethe user puts something, anything, in the window in order to get theGUI to accept the screen. This filler isn't as elaborate as LoremIpsum, but more likely characters from adjacent keys on the second rowof the keyboard, like "lkjkljl". This non-data gets in the way ofapplications that use the data. I wonder if there is a way torecognize and ignore this stuff -- I would assume it's a well-knownproblem, but I haven't found any literature on it. Any pointerswelcome. And sorry if this is off-topic for a DB group.Thanks,Jim Geissman
Hi AllThe problem:!!I want to create a temp table which is common between different usersso that each user could select his rows and print them withoutprinting others selection.All clients use the same connection string.Is there a way to identify users?I think it's possible to delete rows of a user when he logs out theprogram.Do I think right?thanks very muchHafez
Has previous work been done on this? Is their a library one can download? Here's the problem. In an aricle a person or author may make a statement about a subject or a person. I am making a database on this.
For example, here in Israel, PM Olmert may make a statement on the teacher's strike or on Abu Mazen. The article may say, speaking of Mazen, Olmert said such and such. PM Olmert said, "xxxxxxx......." with the previous material making it clear whathe was speaking of.
Right now I have ugly code. Is there a neat way of doing this?
If this is the wrong forum, can somebody direct me to the right forum?
But, at the same time, also want to include two additional columns identifying or even inserting 1's against each of the first Customer_ID considering the first two columns, and the second one on the single column itself?In other words consider the following sample, how to add 1 to the last two columns where either the Customer appears for the first time in context with the Region and Branch Fields or to be appearing on it's own for the first time:
Region Branch Customer Transaction Required_A Required_B
Hell Sir, I am using repeater control to show the result after search .and using checkbox control in itemtemplate row .After searchresult i am facing a problem in identifying the checked checkboxes in the itemtemplate of repeater control . Please provide appropriate solution .... thanks for ur attention...
Hi everybody, I'm migrating a table that has above 20,000 records and lot of duplication.Let's say an Employee table with multiple records having slight diference in the EmployeeName field.Now nobody would like to sit and manually identify them with such hugh number of records. Is there any way which would help me identify most of them and reduce the redundancy.
We would have come across locks on rows, tables etc. How do we handle it through code (SP)!!!
A job is executed at 12 pm midnight on a table. This table exists on an 24X7 accessed (users will be access the table anytime in the day/night) database. We need to execute this job if this table is not locked at 12 pm. Can we have the solution for the listed are two scenarios:
1. You have a normal user and do not have system privilege. How would you design the database(Table)? Is it possible? 2. You have all the privileges on the system tables. What would be the sql script to help us identify the lock? How will it be used in your code? Or is there exception handling !!!
I wand to higllight the duplicate student .I am considering two parameter Name and Birthdate to identify such records even though the probablity of two different student having same name and same DOB is very less.Margin for bad result is relatively low for me.
I am trying to test some data handling between two different versions of an application.
I have restored the database schema twice, once as DB_old and once as DB_new.
I import a transaction using the new application into DB_new and I import the SAME transaction into the DB_old using the old version of application.
I then have to eyeball the data in SQL Query Analyzer to try to identify problems where the fields have received different values.
I have done this by running a select statement twice telling it to use both of the databases and then viewing it in two grids. There are a lot of columns so I have to do a lot of scrolling across the screen to do the comparison, and since the view is in two separate grids I have to hop back and forth and click the scroll bars, etc.
It seems like there has to be a better way. I don't suppose there is a way to lock the two grids so they both scroll together is there?
I was thinking maybe I could insert each of the selects into a temporary table and then do some kind of comparison to identify which values were different in each column. Some of the columns will have differences, like the timestamp, but if I could somehow identify which columns were different then I could eyeball them to identify which of those were okay to be different and which of them were actually bugs from the changed application version.
I have no idea how to identify those individual columns with different data values or even where to start.
Just so you understand better what I am doing now here is the query I am running that I then eyeball: use DB_new select * from claim where claim_id = 35144 use DB_old select * from claim where claim_id = 35144
I'm getting the following from DBCC CBECKDB (there are other errors in there, too but this is the one that concerns me at the moment):
Msg 8939, Level 16, State 42, Line 1 Table error: Object ID 1227270540, index ID 255, page (1:5359776). Test (m_slotCnt <= 1 && m_type == TEXT_TREE_PAGE) failed. Values are 8 and 1. Msg 8944, Level 16, State 12, Line 1 Table error: Object ID 1227270540, index ID 255, page (1:5359777), row 0. Test (ColumnOffsets <= (nextRec - pRec)) failed. Values are 8186 and 220. Msg 8941, Level 16, State 102, Line 1 Table error: Object ID 1227270540, index ID 255, page (1:5359778). Test (sorted [i].offset >= PAGEHEADSIZE) failed. Slot 7, offset 0x1 is invalid. Msg 8942, Level 16, State 101, Line 1 Table error: Object ID 1227270540, index ID 255, page (1:5359778). Test (sorted[i].offset >= max) failed. Slot 0, offset 0x7 overlaps with the prior row. CHECKDB found 0 allocation errors and 4 consistency errors in table '(Object ID 1227270540)' (object ID 1227270540).
...returns null. I've checked the sysobjects table for this ID, and it doesn't show up. Any ideas on how I can identify what this object is? Let me know if you want more info. This is SQL 2000, sp4, the DB is about 60GB and it's the only one on the system having issues. The issue has been around for a while (more than a month), and is consistent. I can post all of the DBCC output if you really want/need it. I was just hesitant to do so since it's so huge.
Boy, 4th day on the job and the hits just keep coming. :-) (Not complaining. I'm learning a lot!)
UPDATE: 2007.06.04_15:44 - Funny: When I ran dbcc checktable(CheckItem), I got all of the error messages displayed below, both for the mystery object ID and for the CheckItem table. I guess that's solved, but I'd still like to know if it's possible to have identified this another way, if anyone has time. Thanks.
-D.
____________________________________________________________________________________ "Believe in those who are seeking the truth. Doubt those who say they have found it." -Andre Gide
I need help flagging duplicate records in ome tables I have.For example if I have Table1 which conatins Field1, Field2 and Field3like belowField1 Field2 Field3 Field4Paul 18 Null NullPaul 18 Null NullJohn 19 Null NullHow would I;1. put a 'Y' in Field3 to mark the two records which are duplicates.2. put a 'Y' in Field4 to mark ONLY ONE of the duplicate records.Regards,Ciarán
I have inherited support for a database with many used tables. Thereisn't any documentation on what is used or dead. I was hoping to runtraces and capture the objectid but the property doesn't work thatway.Any good ideas would be appreciated.
When distributing a SQL Server database to customers we need to be able to tell which version of a stored procedure is currently installed on the user's machine. Does 6.5 or 7.0 provide any way to monitor versions like this?
i´m looking for TSQL-Code (7.0/2000) to identify, if a SQL Server Database ist a SystemDatabase or a UserDatabase. In the sysdatabases there is no information abount that.
When running the DBCC newalloc command I get some errors like the following: "extent 51400 is in the wrong segment" "chain processed with bad segment for object 448004627" I've checked the system tables and system stored procedures and see no reference to page numbers being mapped to segments or identifying which extents are associated to which tables. I'm trying to determine which pages are associated with these extents so that I can print them to view the content. Any ideas how to determine the page numbers associated with extents and which extents are associated with each table?
I monitor a few "perfmon" counters which includes under the "system" object, "bytes transmitted/sec" and "file read bytes/sec". Every once in awhile, these counters will skyrocket, which can also be verified by the hard drive lights flickering like mad.
The only software installed on the machine is SQL Server 2K.
I was wondering if anyone knew how I could monitor within SQL 2K what process or user is using all of these cycles. If anyone could shed some light on this it would be greatly appreciated. Specifically, I would like to find out which database/query is doing this to minimize in the future as this affects all of the other connections.
Can any one recommend an approach for identifying the frequently accessed tables and files in a SQL/Server application? Particularly, if the database is stored on raw partitions instead of FAT or NTFS. Thanks.
I have installed a SQL 2005 software and created 4 instances and 4 databases on each server namely , Adventureworks , sample , testdb1, testdb2.
After creating these many databases , i was very confused to find out the actual database files in Programfiles directory as each instance was created in a separate directory namely MSSQL.1 , MSSQL.2...etc.
how do i identify the correct database path for sample database in instance3.
is there any system tables or stored proc that i can user to identify this path. tanks
How can we write a query to achieve this while keeping in mind:
- We do not want to do unnecessary record lookups and Updates - We only update records that corresponds to new entries. For example, we should not touch the record for InvoiceID = 2 in the above example
Extent (3:394032) in database ID 7 is allocated by more than one allocation object. The error has been repaired.
Msg 8913, Level 16, State 1, Line 2
Extent (3:394032) is allocated to 'GAM' and at least one other object.The error has been repaired.
--Lots of these
Repair: Deleted off-row data column with ID 562825134080, for object ID 1076927654, index ID 1, partition ID 72057594039566336, alloc unit ID 72057594044153856 (type LOB data) on page (3:393971), slot 28. Repair: Deleted off-row data column with ID 562825199616, for object ID 1076927654, index ID 1, partition ID 72057594039566336, alloc unit ID 72057594044153856 (type LOB data) on page (3:393971), slot 29. Repair: Deleted off-row data column with ID 562825265152, for object ID 1076927654, index ID 1, partition ID 72057594039566336, alloc unit ID 72057594044153856 (type LOB data) on page (3:393971), slot 30.
Lots of these:
Msg 8945, Level 16, State 1, Line 2 Table error: Object ID 1076927654, index ID 1 will be rebuilt. The error has been repaired. Msg 8977, Level 16, State 1, Line 2 Table error: Object ID 1076927654, index ID 1, partition ID 72057594039566336, alloc unit ID 72057594044088320 (type In-row data). Parent node for page (3:394009) was not encountered. The error has been repaired.