|
|
|
Получить список заблокированных записей
|
|||
|---|---|---|---|
|
#18+
Где-то проскакивало - как Получить список заблокированных записей - напомните пожалуйста, причем помню, что делается одним движением. (или записей на конторых висят какие нибудь блокировки) С уважением!ТГ! ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.08.2002, 07:10:54 |
|
||
|
Получить список заблокированных записей
|
|||
|---|---|---|---|
|
#18+
Код: plaintext ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.08.2002, 09:12:26 |
|
||
|
Получить список заблокированных записей
|
|||
|---|---|---|---|
|
#18+
у меня пока нет проблем с блокировками. не подскажите каки трудности меня ожидают? причины возникновения? заблокированные записи не попадают в селект? приостанавливают исполнение запросов? или их просто нельзя апдейтить? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.08.2002, 10:46:51 |
|
||
|
Получить список заблокированных записей
|
|||
|---|---|---|---|
|
#18+
BOL: Isolation Levels When locking is used as the concurrency control mechanism, it solves concurrency problems. This allows all transactions to run in complete isolation of one another, although there can be more than one transaction running at any time. Serializability is the database state achieved by running a set of concurrent transactions equivalent to the database state that would be achieved if the set of transactions were executed serially in order. SQL-92 Isolation Levels Although serialization is important to transactions to ensure that the data in the database is correct at all times, many transactions do not always require full isolation. For example, several writers are working on different chapters of the same book. New chapters can be submitted to the project at any time. However, after a chapter has been edited, a writer cannot make any changes to the chapter without the editor's approval. This way, the editor can be assured of the accuracy of the book project at any point in time, despite the arrival of new unedited chapters. The editor can see both previously edited chapters and recently submitted chapters. The level at which a transaction is prepared to accept inconsistent data is termed the isolation level. The isolation level is the degree to which one transaction must be isolated from other transactions. A lower isolation level increases concurrency, but at the expense of data correctness. Conversely, a higher isolation level ensures that data is correct, but can affect concurrency negatively. The isolation level required by an application determines the locking behavior SQL Server uses. SQL-92 defines the following isolation levels, all of which are supported by SQL Server: Read uncommitted (the lowest level where transactions are isolated only enough to ensure that physically corrupt data is not read). Read committed (SQL Server default level). Repeatable read. Serializable (the highest level, where transactions are completely isolated from one another). If transactions are run at an isolation level of serializable, any concurrent overlapping transactions are guaranteed to be serializable. These isolation levels allow different types of behavior. Isolation level Dirty read Nonrepeatable read Phantom Read uncommitted Yes Yes Yes Read committed No Yes Yes Repeatable read No No Yes Serializable No No No Transactions must be run at an isolation level of repeatable read or higher to prevent lost updates that can occur when two transactions each retrieve the same row, and then later update the row based on the originally retrieved values. If the two transactions update rows using a single UPDATE statement and do not base the update on the previously retrieved values, lost updates cannot occur at the default isolation level of read committed. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.08.2002, 10:50:05 |
|
||
|
Получить список заблокированных записей
|
|||
|---|---|---|---|
|
#18+
Я прошу прощения, может я не правильно выразился. Я имею ввиду, если 10 юзверей подняли на исправление 10 записей, то как мне отследить , что именно эти . sp_lock - конечно хорошо, но коды Primary Key эта процедура не даст. Манипуляции с привденные в BOL сегодня результата не дали, поскольку я "видел" эти записи (невидеть - тоже вариант). Но тем не менее - как получить значение ключей этих записей - просто SQL код, ну если не влом. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.08.2002, 23:00:20 |
|
||
|
Получить список заблокированных записей
|
|||
|---|---|---|---|
|
#18+
select * from sysprocesses where blocked>0 a tam uje vse chto khochesh est' :) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 14.08.2002, 11:12:13 |
|
||
|
Получить список заблокированных записей
|
|||
|---|---|---|---|
|
#18+
select * from sysprocesses where blocked>0 a tam uje vse chto khochesh est' :) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 14.08.2002, 14:11:32 |
|
||
|
Получить список заблокированных записей
|
|||
|---|---|---|---|
|
#18+
причем помню, что делается одним движением. Что-то вы путаете. Блокируются следующие элементы BOL - Accessing and Changing Relational Data - Locking - Understanding Locking in SQL Server "RID - Row identifier. Used to lock a single row within a table. Key - Row lock within an index. Used to protect key ranges in serializable transactions. Page - 8 kilobyte –(KB) data page or index page. Extent - Contiguous group of eight data pages or index pages. Table - Entire table, including all data and indexes. DB - Database" Кроме того, а вы уверены, что ваши 10 пользователей блокируют именно одну запись каждый ? Может быть подумать над созданием собственной семафорной таблицы ? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 14.08.2002, 19:26:44 |
|
||
|
Получить список заблокированных записей
|
|||
|---|---|---|---|
|
#18+
В принципе можно получить набор данных, содержажий первичные ключи (или записи целиком), залоченных записей в таблице: 1) отбираем все записи с хинтом NOLOCK 2) отбираем незалоченные записи хинтом READPAST 3) разница между ними и есть залоченные записи. Есно, это все пишется в один запрос. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.08.2002, 09:38:12 |
|
||
|
|

start [/forum/topic.php?fid=46&msg=32044104&tid=1821046]: |
0ms |
get settings: |
6ms |
get forum list: |
15ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
40ms |
get topic data: |
10ms |
get forum data: |
2ms |
get page messages: |
62ms |
get tp. blocked users: |
2ms |
| others: | 203ms |
| total: | 346ms |

| 0 / 0 |
