翻译(难度挺大的)
We have a deadlock problem at hand. Transactions are randomly terminated.
We have two types of transactions:
􀂃 the important transaction that inserts employee name and address information
􀂃 the less important transaction that inserts employee demographic information
The requirement is that when the database server terminates of these transactions, it never terminates the more important transaction.
By setting the DEADLOCK_PRIORITY to LOW for the less important transaction, the less important transaction will be the preferred deadlock victim. When a deadlock between an important and a less important transaction occurs, the less important would always be the preferred deadlock victim and terminated. A more important transaction would never be terminated.
We cannot expect only two transactions running at the same time. There could be many less important transactions and many important transactions running at the same time.
We could imagine that two important transactions become deadlocked. In that case, one of them would be the chosen deadlock victim and terminated. But the requirement was that in a deadlock situation the more important transaction would never be terminated, and in this case both are equally important.
In SQL Server 2000, a single user session may have one or more threads running on its behalf. Each thread may acquire or wait to acquire a variety of resources, such as locks, parallel query execution-related resources,threads, and memory. With the exception of memory, all these resources participate in the SQL Server deadlock detection scheme. Deadlock situations arise when two processes have data locked, and each process cannot
release its lock until other processes have released theirs. Deadlock detection is performed by a separate thread called the lock monitor thread. When the lock monitor initiates a deadlock search for a particular thread, it identifies the resource on which the thread is waiting. The lock monitor then finds the owner for that particular
resource and recursively continues the deadlock search for those threads until it finds a cycle. A cycle identified in this manner forms a deadlock. After a deadlock is identified, SQL Server ends the deadlock by automatically choosing the thread that can break the deadlock. The chosen thread is called the deadlock victim. SQL Server
rolls back the deadlock victim's transaction, notifies the thread's application by returning error message number 1205, cancels the thread's current request, and then allows the transactions of the non-breaking threads to continue. Usually, SQL Server chooses the thread running the transaction that is least expensive to undo as the
deadlock victim. Alternatively, a user can set the DEADLOCK_PRIORITY of a session to LOW. If a session's setting is set to LOW, that session becomes the preferred deadlock victim. Since the transaction that inserts employee demographics information into the database is less important than the transaction that inserts employee name and address information, the DEADLOCK_PRIORITY of the transaction that inserts employee
demographics information should be set to LOW.
A:
If a session's setting is set to LOW, that session becomes the preferred deadlock victim. Since the transaction that inserts employee name and address information into the database is more important than the transaction that inserts employee demographics information, the DEADLOCK_PRIORITY of the transaction that inserts employee name and address information should not be set to LOW.
C:
Error 1205 is returned when a transaction becomes the deadlock victim. Adding conditional code to the transaction that inserts the employee name and address information to check for this error, and specifying that the transaction should restart if this error is encountered, would cause the transaction to restart. This would ensure that an important transaction would never be terminated, which was the requirement. There is a drawback with this proposed solution though: it is inefficient and performance
would not be good. It would be better to lower the DEADLOCK_PRIORITY of the less important
transactions.
D:
ROWLOCK optimizer hint is a table hint that uses row-level locks instead of the coarser-grained pageand table-level locks.
E:
Choosing the highest transaction level would increase the number of locks. This could not ensure that certain transactions (the ones with high priority, for example) would never be locked.
Note: When locking is used as the concurrency control method, concurrency problems are reduced, as this allows all transactions to run in complete isolation of one another, although more than one transaction can be running at any time. SQL Server 2000 supports the following isolation levels: • Read Uncommitted, which is the lowest level, where transactions are isolated only enough to ensure that physically corrupt data is not read;
• Read Committed, which is the SQL Server 2000 default level;
• Repeatable Read; and
• Serializable, which is the highest level of isolation.
Where high levels of concurrent access to a database are required, the optimistic concurrent control
method should be used.
问题点数:100、回复次数:14Top
1 楼yyl001(70-229问题连载)回复于 2004-12-03 22:22:23 得分 0
能翻译多少算多少,请把你翻译的部分注明,谢谢Top
2 楼960379(文物:眉毛搭桥)回复于 2004-12-04 09:10:00 得分 10
我们正面临一个难题:死锁,即信息的交互(在SQL中也叫事务)有时候会突然中断。目前存在两种类型的事务:
#1048707:插入雇员姓名和地址信息的重要事务;
#1048707:插入雇员示例图片(不准确)信息的普通/次要事务。
要求即使在数据库服务器连接中断地时候,也不能停止重要事务。
将普通事务的DEADLOCK_PRIORITY设为LOW可选择其成为死锁的牺牲品。当重要事务和次要事务之间发生死锁,总是次要事务终止而重要事务不会。
我们不能保证同一时刻总是只有两个事务在提交/处理。事实上,同时提交的事务可能有许多次要事务以及许多重要事务。
可以想象当两个重要事务死锁的情况。这种情况下,其中一个重要事务将会终止。显然这与要求不符(这句话是意译)。
Top
3 楼960379(文物:眉毛搭桥)回复于 2004-12-04 09:18:30 得分 10
A:
如果一个线程的设置为LOW,那么它将在死锁时终止。因为插入雇员姓名和地址信息的事务比插入示例图片信息的事务重要性高,那么插入雇员姓名和地址信息的事务的DEADLOCK_PRORITY不应该设为LOW。
Top
4 楼960379(文物:眉毛搭桥)回复于 2004-12-04 09:23:44 得分 10
C:
当死锁导致事务终止时,将会返回Error 1205。在插入雇员姓名和地址信息的事务中添加条件语句以检测该错误,并且在发生错误后指定要重启事务,则可以让事务重新开始。这可以保证重要事务绝对不会被终止,从而满足了要求。但是这种解决方案有一个弊端:效率低下。降低次要事务的DEADLOCK_PRIORITY是一个更好的选择。
Top
5 楼yyl001(70-229问题连载)回复于 2004-12-04 16:11:37 得分 0
D , E
再帮我翻译下,谢谢,翻译完马上结帖Top
6 楼960379(文物:眉毛搭桥)回复于 2004-12-06 14:37:05 得分 10
D:
ROWLOCK优化器提示是一种表级提示,它使用了较低等级的锁,而不是……专有名词不会翻译。
E:
选择最高的事务等级将会增加锁的数量。(但是)这样做并不能保证特定的事务(例如具有较高优先级的事务)绝对不会终止。Top
7 楼king678(★☆KING☆★)回复于 2004-12-07 11:22:43 得分 0
upTop
8 楼umit12020(谷雨)回复于 2004-12-08 08:43:25 得分 10
D: 槳架 優化者暗示是使用吵嚷水準(層次)的鎖而不更粗糙糧食的 pageand 桌子水準(層次)的鎖的桌子暗示。
最高的處理事務水準(層次)選擇的E:增加鎖的數字(目)。 它沒能確保某種會議錄 (高優先的一個, 例如) 從不(絕不)被鎖住。
不e:當把鎖用作 concurrency 時控制方法, 減少 concurrency 問題, 如同它允許所有會議錄在互相的完全孤立中跑(營運), 雖然任何時候能夠跑(營運)比一個處理事務多。 資料查詢語言 服務器 2000 支援(這些)下面的孤立水準(層次): &# 8226 ; 閱讀 未承諾的 , 它(這)是最低的水準(層次), 在會議錄孤立得僅僅足以確保實際上腐敗的資料沒閱讀那裡; &# 8226 ; 閱讀投入, 它(這)是 2000 違約水準(層次)的 資料查詢語言 服務器; &# 8226 ; 可重複的閱讀; 和 &# 8226 ; 可串行化的, 它(這)是孤立的最高的水準(層次)。
在需要到資料庫併行通路的高水準(層次)那裡, 應該使用樂觀併行控制方法。
Top
9 楼960379(文物:眉毛搭桥)回复于 2004-12-08 09:21:21 得分 5
D:
ROWLOCK优化器提示是一种表级提示,它使用了行级的锁,而不是……专有名词不会翻译。
Top
10 楼king678(★☆KING☆★)回复于 2004-12-08 10:05:47 得分 5
upTop
11 楼yxsalj(想和你去吹吹风)回复于 2004-12-09 19:33:14 得分 40
目前,我们遇到了一个问题:死锁。事务会突然终止。
我们有两类型的事务:较重要的插入雇员姓名和地址信息的事务;较不重要的插入雇员人口信息的事务。
要求当数据库终止这些事务时(即不重要的事务),它不会终止重要的事务。
通过把不大重要的事务的"DEADLOCK_PRIORITY"设置成"LOW",不重要的事务就优先成为死锁牺牲品。
当死锁出现在重要的,较不重要的事务中时,不重要的事务总是被优先选择终止,而更重要的事务不会终止。
我们不能期望同一时间只有两个事务运行,有可能有大量的不重要的,重要的事务在同一时间运行。
我们假设两个重要的事务间死锁。在这种情况下,其中一个被选择成死锁牺牲品终止。但是出现死锁时,要求较重要的事务不会被终止。这里,两个同样重要。
在SQL SERVER 2000中,一个单一的用户会话可以有一个或多个线程运行。每个线程可以捕获或等待捕获不同的资源。比如锁,与执行相关的并行查询资源,线程,内存。除了内存外,所有其他的资源参与SQL SERVER的死锁检测计划。
当两个进程锁定数据,每个进程等待其他的进程释放才释放它自己的锁时,死锁产生了。死锁的检测由一个独立的
叫锁监视器的线程来执行。锁监视器启动一个死锁查寻,它识别线程正在等待的资源。锁监视器接着找到该资源的
拥有者,递归地继续查找可能出现死锁的线程,直到找到一个环路。这种情况下,一个环路等同于一个死锁。
当一个死锁被识别后,SQL SERVER选择终止进程来自动结束死锁,被选中的线程叫死锁牺牲品。SQL SERVER回滚死锁牺牲品的事务,通过返回错误码1205来通告线程的应用,取消线程的当前请求。然后,让没有终止的线程继续运行。
通常,SQL SERVER选择比死锁牺牲品会更少代价的重做线程来运行事务。或者,用户可以把会话的"DEADLOCK_PRIORITY"设置成"LOW"。如果会话被设置成"LOW",那么这个会话将更容易成为死锁的牺牲品。因为插入雇员人口信息的事务没有插入雇员姓名和地址信息的事务重要,插入雇员人口信息事务的"DEADLOCK_PRIORITY"应该被设置成"LOW"。
A:如果一个会话被设置成"LOW",这个会话变成易于死锁的牺牲品。因为插入雇员姓名和地址信息到数据库的事务比插入雇员人口信息的事务更加重要。插入雇员姓名和地址信息的事务的"DEADLOCK_PRIORITY"不应该被设置成"LOW"。
C:当一个事务成为死锁的牺牲品时,返回1205错误。增加条件码到插入雇员姓名和地址信息的事务来检测这种错误。当错误发生时,确保事务要重启。根据要求,确保重要的事务不会被终止。撤回的解决方案是无效的,性能不好的。把不重要的事务的"DEADLOCK_PRIORITY"降级是一种更好的方式。
D:行锁优化提示是表提示的一种,它使用行级锁定,替代低效的页面级的,整个表的锁定。
E:选择最高级别的事务水平将导致锁数目的增长,这并不能确保某些事务(比如,有高的优先级)从不会被锁定。
注意:当锁被用作为并发控制的方法,并发的问题减少了。尽管在任一时间内可能有多个事务在运行,它永许所有事务彼此独立的运行。SQL SERVER支持XXX级的隔离。未提交读,最低级的,事务被隔离,仅仅确保物理损坏的数据不被读。XXX,提交读,SQL SERVER 2000的缺省级别。可重复读,可串行化是最高级别的隔离。在要求高度并发访问数据库的地方,优化并发控制应该应用上。
Top
12 楼yxsalj(想和你去吹吹风)回复于 2004-12-09 19:36:32 得分 0
希望楼主能看懂,能区分行级锁定与表级锁定.Top
13 楼guanshui(CSDN.NET-中国最大的灌水网络)回复于 2004-12-10 11:05:51 得分 0
hey, you are so lazy.
You can tranlate what you can translate. If there are any words or sentences which you can not understand, you may ask people in singles.Top
14 楼GHOSTSEA(GHOST SEA)回复于 2004-12-12 01:10:15 得分 0
难度大的一米啊~~~~看不明白啊~~~~这么多蝌蚪啊~~~~~~Top




