| General Information | ||||||||||||||||||||||||||||||||||
| Data Dictionary Objects |
| |||||||||||||||||||||||||||||||||
| Lock Definitions | ||||||||||||||||||||||||||||||||||
| Descriptions |
| |||||||||||||||||||||||||||||||||
| Lock Escalation | ||||||||||||||||||||||||||||||||||
| How to make lock escalation look good | Subject: Re: How to make lock escalation look good... Date: Wed, 21 May 2003 14:03:35 GMT From: "Jim Kennedy" <kennedy-down_with_spammers@attbi.com> Newsgroups: comp.databases.oracle.server I've worked with DB2 and it requires throwing most transactions out the window. Worse than that dynamic SQL must be followed immediately by a commit or no one else can do one. (their query tool does this for you) DB2 does not do dynamic SQL; it does static sql. What it does with "dynamic" sql is create a plan and bind it in then run it - turning dynamic to static and that puts a lock on the plan table until you commit. So anyone else running dynamic sql can't until you commit. (plan table is a source of serialization for the entire system). When I worked with it (DB2 on a mainframe) we had to make sure all DML had a commit immediately after it. | |||||||||||||||||||||||||||||||||
| Lock Demo | ||||||||||||||||||||||||||||||||||
| Locking Demo |
| |||||||||||||||||||||||||||||||||
| Lock Table | ||||||||||||||||||||||||||||||||||
| Table Locking | LOCK TABLE <table_name> IN <lock_mode> MODE [NOWAIT | WAIT <seconds>]; | |||||||||||||||||||||||||||||||||
LOCK TABLE uwclass.servers IN exclusive MODE WAIT 120; | ||||||||||||||||||||||||||||||||||
| Lock Related Queries | ||||||||||||||||||||||||||||||||||
| Active Table Locks | SELECT SUBSTR(a.object,1,25) TABLENAME, | |||||||||||||||||||||||||||||||||
| Active Locks | SELECT s.username, s.sid, s.serial#, s.osuser, k.ctime, o.object_name | |||||||||||||||||||||||||||||||||
| List Locks | set wrap off | |||||||||||||||||||||||||||||||||
| List Lock Types | set wrap off | |||||||||||||||||||||||||||||||||
| Locked Objects | SELECT oracle_username USERNAME, owner OBJECT_OWNER, | |||||||||||||||||||||||||||||||||
| Locked Objects | SELECT o.owner, o.object_name, o.object_type, o.last_ddl_time, o.status, l.session_id, l.oracle_username, l.locked_mode | |||||||||||||||||||||||||||||||||
| Locked Objects | SELECT DECODE(request,0,'Holder: ','Waiter:') || sid sess, id1, id2, lmode, request, type | |||||||||||||||||||||||||||||||||
| Objects that have been lock for 2 minutes or more | SELECT SUBSTR(TO_CHAR(w.session_id),1,5) WSID, p1.spid WPID, | |||||||||||||||||||||||||||||||||
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




