oracleËÀËø²éѯ¼°´¦Àí
²éѯ·¢ÉúËÀËøµÄselectÓï¾ä
select sql_text from v$sql where hash_value in
(select sql_hash_value from v$session where sid in
(select session_id from v$locked_object))
---------------------------------------------------------
¹ØÓÚÊý¾Ý¿âËÀËøµÄ¼ì²é·½·¨
Ò»¡¢ Êý¾Ý¿âËÀËøµÄÏÖÏó
³ÌÐòÔÚÖ´ÐеĹý³ÌÖУ¬µã»÷È·¶¨»ò±£´æ°´Å¥£¬³ÌÐòûÓÐÏìÓ¦£¬Ò²Ã»ÓгöÏÖ±¨´í¡£
¶þ¡¢ ËÀËøµÄÔÀí
µ±¶ÔÓÚÊý¾Ý¿âij¸ö±íµÄijһÁÐ×ö¸üлòɾ³ýµÈ²Ù×÷£¬Ö´ÐÐÍê±Ïºó¸ÃÌõÓï¾ä²»Ìá
½»£¬ÁíÒ»Ìõ¶ÔÓÚÕâÒ»ÁÐÊý¾Ý×ö¸üвÙ×÷µÄÓï¾äÔÚÖ´ÐеÄʱºò¾Í»á´¦Óڵȴý״̬£¬
´ËʱµÄÏÖÏóÊÇÕâÌõÓï¾äÒ»Ö±ÔÚÖ´ÐУ¬µ«Ò»Ö±Ã»ÓÐÖ´Ðгɹ¦£¬Ò²Ã»Óб¨´í¡£
Èý¡¢ ËÀËøµÄ¶¨Î»·½·¨
ͨ¹ý¼ì²éÊý¾Ý¿â±í£¬Äܹ»¼ì²é³öÊÇÄÄÒ»ÌõÓï¾ä±»ËÀËø£¬²úÉúËÀËøµÄ»úÆ÷ÊÇÄÄһ̨¡£
1£©ÓÃdbaÓû§Ö´ÐÐÒÔÏÂÓï¾ä
select username,lockwait,status,machine,program from v$session where sid in
(select session_id from v$locked_object)
Èç¹ûÓÐÊä³öµÄ½á¹û£¬Ôò˵Ã÷ÓÐËÀËø£¬ÇÒÄÜ¿´µ½ËÀËøµÄ»úÆ÷ÊÇÄÄһ̨¡£×Ö¶Î˵Ã÷£º
Username£ºËÀËøÓï¾äËùÓõÄÊý¾Ý¿âÓû§£»
Lockwait£ºËÀËøµÄ״̬£¬Èç¹ûÓÐÄÚÈݱíʾ±»ËÀËø¡£
Status£º ״̬£¬active±íʾ±»ËÀËø
Machine£º ËÀËøÓï¾äËùÔڵĻúÆ÷¡£
Program£º ²úÉúËÀËøµÄÓï¾äÖ÷ÒªÀ´×ÔÄĸöÓ¦ÓóÌÐò¡£
2£©ÓÃdbaÓû§Ö´ÐÐÒÔÏÂÓï¾ä£¬¿ÉÒԲ鿴µ½±»ËÀËøµÄÓï¾ä¡£
select sql_text from v$sql where hash_value in
(select sql_hash_value from v$session where sid in
(select session_id from v$locked_object))
ËÄ¡¢ ËÀËøµÄ½â¾ö·½·¨
Ò»°ãÇé¿öÏ£¬Ö»Òª½«²úÉúËÀËøµÄÓï¾äÌá½»¾Í¿ÉÒÔÁË£¬µ«ÊÇÔÚʵ¼ÊµÄÖ´Ðйý³ÌÖС£Óû§¿É
Äܲ»ÖªµÀ²úÉúËÀËøµÄÓï¾äÊÇÄÄÒ»¾ä¡£¿ÉÒÔ½«³ÌÐò¹Ø±Õ²¢ÖØÐÂÆô¶¯¾Í¿ÉÒÔÁË¡£
¡¡¾³£ÔÚOracleµÄʹÓùý³ÌÖÐÅöµ½Õâ¸öÎÊÌ⣬ËùÒÔÒ²×ܽáÁËÒ»µã½â¾ö·½·¨¡£
¡¡¡¡1£©²éÕÒËÀËøµÄ½ø³Ì£º
sqlplus "/as sysdba" (sys/change_on_install)
SELECT s.username,l.OBJECT_ID,l.SESSION_ID,s.SERIAL#,
l.ORACLE_USERNAME,l.OS_USER_NAME,l.PROCESS
from V$LOCKED_OBJECT l,V$SESSION S WHERE l.SESSION_ID=S.SID;
¡¡¡¡2£©killµôÕâ¸öËÀËøµÄ½ø³Ì£º
¡
Ïà¹ØÎĵµ£º
¢Ù Ö»ÐèÔÚÎļþ TNSNames.ora ÖмÓÈëÒÔϽڵ㣬¼´¿É³É¹¦ÅäÖüàÌý
ORCL190 = //ºìÉ«²¿ÃÅΪÁ¬½Ó¼àÌýÃû×Ö
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.190)(PORT = 1521)) //ºìÉ«²¿ÃÅΪ·þÎñÆ÷ËùÔÚIPµØÖ· 1521Ϊ¶Ë¿ÚºÅ
(CONNECT_DATA ......
ÒÔdbaµÇ½
1.²é¿´Äĸö±í±»Ëø:
select b.owner,b.object_name,l.session_id,l.locked_mode
from v$locked_object l, dba_objects b
where b.object_id=l.object_id;
2.²é¿´±»Ëø±íµÄsid ºÍserial# :
select t2.username,t2.sid,t2.serial#,t2.logon_time
from v$locked_object t1 ......
1.ÔÚORACLEÖÐʵÏÖSELECT TOP N
ÓÉÓÚORACLE²»Ö§³ÖSELECT TOPÓï¾ä£¬ËùÒÔÔÚORACLEÖо³£ÊÇÓÃORDER BY¸úROWNUMµÄ×éºÏÀ´ÊµÏÖSELECT TOP NµÄ²éѯ¡£
¼òµ¥µØËµ£¬ÊµÏÖ·½·¨ÈçÏÂËùʾ£º
SELECT¡¡ÁÐÃû£±£®£®£®ÁÐÃû£î¡¡from
(SELECT¡¡ÁÐ ......
OracleÖÐÁÙʱ±í²úÉú¹ýÁ¿RedoµÄ˵Ã÷
×î½ü,ÔÚOracle9iÖÐÄãÓùýÁÙʱ±íÂð?
ËüÊÇ·ñ¸øÄã´øÀ´ÁËÐÔÄÜÌá¸ß?Äã×¢Òâ¹ýô?
--------------------------------------------------------------------------------
ºÃÁËÑÔ¹éÕý´«.
ÎÒÃÇÖªµÀÁÙʱ±íÔÚDML²Ù×÷ÖпÉÒÔ¼õÉÙredoµÄÉú³É,´Ó¶øÔÚ±£´æÖмä½á¹û¼¯Ê±¿ÉÒÔ´øÀ´½Ï´óµÄÐÔÄÜÌá¸ß.
¿ÉÊÇ,È ......