Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : Oracle

Oracle dead lock deep research.

Update SQLS will lead dead lock exception. Because by default, it use optimistic lock but not pessimistic lock.
Below description is exceprted from the attachment(It exceeds my image that this blog can not upload the attachment,hehe)
Optimistic locking offers an elegant solution to the problems outlined above. Optimistic locking does
not lock records when they are read, and proceeds on the assumption that the data being updated has not
changed since the read. Since no locks are taken out during the read, it doesn’t matter if the user goes to
lunch after starting a transaction, and deadlocks are all but eliminated since users should never have to
wait on each other’s locks
There are some ways to resolve this problem.
1. Create a pessimistic lock. Change the sql like below formal.
First: select … from … for update nowait 
Second: update the resultSet.
2. Execute the SQL again after a random duration when program meets this kind of exception. ( ......

oracle¸ßˮλÏß

ʲôÊÇË®Ïß(High Water Mark)?
----------------------------
ËùÓеÄoracle¶Î(segments£¬ÔÚ´Ë£¬ÎªÁËÀí½â·½±ã£¬½¨Òé°Ñsegment×÷Ϊ±íµÄÒ»¸öͬÒå´Ê) ¶¼ÓÐÒ»¸öÔÚ¶ÎÄÚÈÝÄÉÊý¾ÝµÄÉÏÏÞ£¬ÎÒÃǰÑÕâ¸öÉÏÏÞ³ÆÎª"high water mark"»òHWM¡£Õâ¸öHWMÊÇÒ»¸ö±ê¼Ç£¬ÓÃÀ´ËµÃ÷ÒѾ­ÓжàÉÙûÓÐʹÓõÄÊý¾Ý¿é·ÖÅ䏸Õâ¸ösegment¡£HWMͨ³£Ôö³¤µÄ·ù¶ÈΪһ´Î5¸öÊý¾Ý¿é£¬Ô­ÔòÉÏHWMÖ»»áÔö´ó£¬²»»áËõС£¬¼´Ê¹½«±íÖеÄÊý¾ÝÈ«²¿É¾³ý£¬HWM»¹ÊÇΪԭֵ£¬ÓÉÓÚÕâ¸öÌØµã£¬Ê¹HWMºÜÏóÒ»¸öË®¿âµÄÀúÊ·×î¸ßˮ룬ÕâÒ²¾ÍÊÇHWMµÄԭʼº¬Ò壬µ±È»²»ÄÜ˵һ¸öË®¿âûˮÁË£¬¾Í˵¸ÃË®¿âµÄÀúÊ·×î¸ßˮλΪ0¡£µ«ÊÇÈç¹ûÎÒÃÇÔÚ±íÉÏʹÓÃÁËtruncateÃüÁÔò¸Ã±íµÄHWM»á±»ÖØÐÂÖÃΪ0¡£
HWMÊý¾Ý¿âµÄ²Ù×÷ÓÐÈçÏÂÓ°Ï죺
a) È«±íɨÃèͨ³£Òª¶Á³öÖ±µ½HWM±ê¼ÇµÄËùÓеÄÊôÓڸñíÊý¾Ý¿â¿é£¬¼´Ê¹¸Ã±íÖÐûÓÐÈκÎÊý¾Ý¡£
b) ¼´Ê¹HWMÒÔÏÂÓпÕÏеÄÊý¾Ý¿â¿é£¬¼üÈëÔÚ²åÈëÊý¾ÝʱʹÓÃÁËappend¹Ø¼ü×Ö£¬ÔòÔÚ²åÈëʱʹÓÃHWMÒÔÉϵÄÊý¾Ý¿é£¬´ËʱHWM»á×Ô¶¯Ôö´ó¡£
ÈçºÎÖªµÀÒ»¸ö±íµÄHWM£¿
a) Ê×ÏÈ¶Ô±í½øÐзÖÎö:
ANALYZE TABLE <tablename> ESTIMATE/COMPUTE STATISTICS;
b) SELECT blocks, empty_blocks, num_rows
from user_tables
WHERE table_name = ......

ORACLE 10gÏÂÔØµØÖ·

ORACLE 10gÏÂÔØµØÖ·
Oracle Database 10g Release 2 (10.2.0.1.0) Enterprise/Standard Edition for Microsoft Windows (32-bit)
http://download.oracle.com/otn/nt/oracle10g/10201/10201_database_win32.zip
http://download.oracle.com/otn/nt/oracle10g/10201/10201_client_win32.zip
http://download.oracle.com/otn/nt/oracle10g/10201/10201_clusterware_win32.zip
http://download.oracle.com/otn/nt/oracle10g/10201/10201_gateways_win32.zip
Oracle Database 10g Release 2 (10.2.0.1.0) Enterprise/Standard Edition for Microsoft Windows (x64)
http://download.oracle.com/otn/nt/oracle10g/10201/102010_win64_x64_database.zip
http://download.oracle.com/otn/nt/oracle10g/10201/102010_win64_x64_client.zip
http://download.oracle.com/otn/nt/oracle10g/10201/102010_win64_x64_clusterware.zip
Oracle Database 10g Release 2 (10.2.0.1.0) Enterprise/Standard Edition for Linux x86
http://download.oracle.com/otn/linux/oracle10g/10201/10201_database_linux32.zip
http://download.oracle.com/otn/linux/oracle10g/10201/10201_ ......

oracle´´½¨±í¿Õ¼ä.´´½¨Óû§.´´½¨±í

ÔÚSQL*PlusÖУº£¨1£©ÈçºÎÌí¼Óɾ³ýÊý¾Ý¿â£¿£¨2£©Êý¾Ý¿â¾ÍÊDZíÂ𣿣¿£¨3£©ÈçºÎ´´½¨±í¿Õ¼ä£¿£¨4£©ÈçºÎ´´½¨Óû§£¿£¨5£©ÊDz»ÊÇÒ»¸ö±í¿Õ¼äÖ»ÄÜ´´½¨Ò»¸öÓû§£¿£¨6£©ÔõÑù´Ó¿Í»§¶Ë·ÃÎÊÊý¾Ý¿â·þÎñÆ÷µÄÅäÖã¿
¡¡¡¡
¡¡¡¡»Ø´ð£º
¡¡¡¡1¡¢ºÎÌí¼Óɾ³ýÊý¾Ý¿â£¿Ã»ÕâÖÖ¸ÅÄ²»¶®¡£
¡¡¡¡2¡¢Êý¾Ý¿â=ËùÓеÄoracleµÄÊý¾ÝÎļþ+¿ØÖÆÎļþ+ÈÕÖ¾Îļþ+²ÎÊýÎļþ,Êý¾Ý¿â²»ÊDZí
¡¡¡¡3¡¢create¡¡tablespace¡¡...¡¡Óï¾ä
¡¡¡¡eg:CREATE¡¡TABLESPACE¡¡tabspace_2
¡¡¡¡DATAFILE¡¡’diska:tabspace_file2.dat’¡¡SIZE¡¡20M
¡¡¡¡DEFAULT¡¡STORAGE¡¡(INITIAL¡¡10K¡¡NEXT¡¡50K
¡¡¡¡MINEXTENTS¡¡1¡¡MAXEXTENTS¡¡999)
¡¡¡¡ONLINE;
¡¡¡¡4¡¢create¡¡user...Óï¾ä
¡¡¡¡eg:
¡¡¡¡CREATE¡¡USER¡¡sidney
¡¡¡¡IDENTIFIED¡¡BY¡¡welcome
¡¡¡¡DEFAULT¡¡TABLESPACE¡¡cases_ts
¡¡¡¡QUOTA¡¡10M¡¡ON¡¡cases_ts
¡¡¡¡TEMPORARY¡¡TABLESPACE¡¡temp_ts
¡¡¡¡QUOTA¡¡5M¡¡ON¡¡system
¡¡¡¡PROFILE¡¡engineer
¡¡¡¡PASSWORD¡¡EXPIRE;
¡¡¡¡5¡¢±í¿Õ¼äÓëÓû§Ã»Ì«´óµÄ¹ØÏµ
¡¡¡¡6¡¢Ê¹ÓÃnet8¡¡configration¡¡assistantÅäÖÃһϡ£
¡¡¡¡
¡¡¡¡ÄãÔÚÓÃSQL¡¡serverµÄ¹ÛÄîѧϰOracle£¬ÕâÊDz»¶ÔµÄ¡£
¡¡¡¡
¡¡¡¡OracleµÄÊý¾Ý¿âÒ ......

oracle supportÒ»´ÎΣ»ú´¦Àí£¨Ö®Ò»£©

ÌìÓв»²â·çÔÆ£¬
IBM µÄÖж˴ÅÅÌÕóÁÐÕâ´ÎÓÖÈÇ»öÁË¡£ÔÚ΢ÂëÉý¼¶µÄʱºò£¬
DS4800 ·¢Éú¹ÊÕÏ¡£IBM¹¤³Ìʦ°ÑÕóÁйÊÕϻָ´ºó£¬ÅÄÅÄÆ¨¹É×ßÈË£¬ÁôÏÂÁËÕóÁÐÉϲ»Ò»ÖµÄÊý¾Ý¡£
û°ì·¨£¬ÕóÁÐÉϵÄÊý¾ÝÓÖµÃÎÒÃÇÀ´Ïë°ì·¨ÇÀ¾ÈÁË¡£¡£¡£¡£
»¹ºÃÓÐoracle supportµÄÖ§³ÖÎÒÃÇ×îÖÕ»¯½âÁËÕâ´ÎΣ»ú¡£ÏÂÎÄÏêϸ½éÉÜÁËÕû¸ö»Ö¸´µÄ¹ý³Ì¡£
 
 
oracle¹¤³Ìʦµ½´ïÏÖ³¡ºó£¬¸ù¾Ý´íÎóÐÅÏ¢£¬
 
ÎÊÌâÇé¿öÈçÏÂSRÐÅÏ¢Ëùʾ£º£¨HP-UX PA-RISC (64-bit)+ORACLE 9.2.0.8.0.+filesystem+no archivelog mode+no backup)
** Customer's Management 24x7 contact name:***************
** Customer's Management 24x7 contact number: ****************
** Primary Customer contact name: *******************
** Current Customer 24x7 voice phone number: ********************
** Current Customer E-mail address: ********************
** Current Customer Pager/Fax number: *****************
### Characteristics of Problem ###
This is a critical production system
Database is down and will not start
Data corruption issue and media recovery failed to fix the problem ......

¹ØÓÚoracle µÄÐÐÁÐת»»

½ñÌì²Å·¢ÏÖÁËwmsys.wm_concatÕâ¸öÓÐȤÓÐÓõĺ¯Êý£¬ËüµÄ×÷ÓÃÊÇÒÔ','Á´½Ó×Ö·û¡£
Àý×ÓÈçÏ£º
SQL> create table idtable (id number,name varchar2(30));
Table created
SQL> insert into idtable values(10,'ab');
1 row inserted
SQL> insert into idtable values(10,'bc');
1 row inserted
SQL> insert into idtable values(10,'cd');
1 row inserted
SQL> insert into idtable values(20,'hi');
1 row inserted
SQL> insert into idtable values(20,'ij');
1 row inserted
SQL> insert into idtable values(20,'mn');
1 row inserted
SQL> select * from idtable;
        ID NAME
---------- ------------------------------
        10 ab
        10 bc
        10 cd
        20 hi
        20 ij
        20 mn
6 rows selected
SQL> select id,wmsy ......
×ܼǼÊý:3994; ×ÜÒ³Êý:666; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [108] [109] [110] [111] 112 [113] [114] [115] [116] [117]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ