Oracle¶àÁ£¶ÈËø»úÖÆ
£¨1£©Êý¾Ý¿âËøµÄ»ù±¾¸ÅÄî
»ù±¾ËøÀàÐÍÓÐÁ½ÖÖ£ºÅÅËûËø£¨Exclusive locks£©¼ÇΪXËø £¬ ¹²ÏíËø£¨Share locks£©¼ÇΪSËø¡£
ÅÅËûËø£ºÈôÊÂÎñT¶ÔÊý¾ÝD¼ÓXËø£¬ÔòÆäËûÊÂÎñ¶¼²»ÄÜÔÙ¶ÔD¼ÓÈκÎÀàÐ͵ÄËø£¬Ö±ÖÁTÊÍ·ÅDÉϵÄXËø£»Ò»°ãÒªÇóÔÚÐÞ¸ÄÊý¾ÝÇ°ÒªÏò¸ÃÊý¾Ý¼ÓÅÅËûËø£¬ËùÒÔÅÅËûËøÓÖ³ÆΪдËø¡£
¹²ÏíËø£ºÈôÊÂÎñT¶ÔÊý¾ÝD¼ÓSËø£¬ÔòÆäËûÊÂÎñÖ»ÄܶÔD¼ÓSËø£¬¶ø²»ÄܼÓXËø£¬Ö±ÖÁTÊÍ·ÅDÉϵÄSËø£»Ò»°ãÒªÇóÔÚ¶ÁÈ¡Êý¾ÝÇ°ÒªÏò¸ÃÊý¾Ý¼Ó¹²ÏíËø£¬ËùÒÔ¹²ÏíËøÓÖ³ÆΪ¶ÁËø¡£
£¨2£©Oracle¶àÁ£¶È·âËø»úÖÆ
¸ú¾Ý±£»¤¶ÔÏóµÄ²»Í¬£¬OracleÊý¾Ý¿âËø¿ÉÒÔ·ÖΪÒÔϼ¸Àࣺ
£¨1£©DML lock£¨data locks £¬Êý¾ÝËø£©£ºÓÃÓÚ±£»¤Êý¾ÝµÄÍêÕûÐÔ£»
£¨2£©DDL lock (dictionary locks£¬ ×ÖµäËø)£ºÓÃÓÚ±£»¤Êý¾Ý¿â¶ÔÏóµÄ½á¹¹£¨ÀýÈç±í£¬ÊÓͼ£¬Ë÷ÒýµÄ½á¹¹¶¨Ò壩£»
£¨3£©internal locks ºÍ latche(ÄÚ²¿ËøºÍãÅ)£º±£»¤ÄÚ²¿Êý¾Ý¿â½á¹¹£»
£¨4£©distributed locks£¨·Ö²¼Ê½Ëø£©£ºÓÃÓÚOPS£¨²¢ÐзþÎñÆ÷£©ÖУ»
£¨5£©PCM locks£¨²¢ÐиßËÙ»º´æ¹ÜÀíËø£©£ºÓÃÓÚOPS£¨²¢ÐзþÎñÆ÷£©ÖУ»
DML£¨Ò²¿É³ÆΪdata locks£¬Êý¾ÝËø£©Ëø¡£´Ó·âËøÁ£¶È£¨·âËø¶ÔÏóµÄ´óС£©µÄ½Ç¶È¿´£¬Oracle DMLËø¹²ÓÐÁ½¸ö²ã´Î£¬¼´Ðм¶ËøºÍ±í¼¶Ëø¡£
2.1 OracleµÄTXËø£¨Ðм¶Ëø£¬ÊÂÎñËø£©
TXµÄ±¾ÒåÊÇTransaction£¨ÊÂÎñ£©£¬µ±Ò»¸öÊÂÎñµÚÒ»´ÎÖ´ÐÐÊý¾ÝÐ޸ģ¨Insert£¬Update£¬Delete£©»òʹÓÃSelect...For UpdateÓï¾ä½øÐвéѯʱ£¬Ëü¼´»ñµÃÒ»¸öTX£¨ÊÂÎñ£©Ëø£¬Ö±ÖÁ¸ÃÊÂÎñ½áÊø£¨Ö´ÐÐCommit»òRollBack²Ù×÷£©Ê±£¬¸ÃËø²Å±»ÊÍ·Å¡£ËùÒÔÒ»¸öTXËø£¬¿ÉÒÔ¶ÔÓ¦¶à¸ö±»¸ÃÊÂÎñËø¶¨µÄÊý¾ÝÐС£
ÔÚOracleÊý¾ÝÐÐÉÏ£¬¶¼ÓÐÒ»¸ö±ê־λÀ´±íʾ¸ÃÐÐÊý¾ÝÊÇ·ñ±»Ëø¶¨¡£Êý¾ÝÐÐÉϵÄËø±êÖ¾Ò»µ©±»ÖÃ룬¾Í±íÃ÷¸ÃÊý¾ÝÐб»¼ÓXËø£¬OracleÔÚÊý¾ÝÐÐÉÏûÓÐSËø¡£
2.2 TMËø£¨±í¼¶Ëø£©
2.2.1ÒâÏòËøµÄÒý³ö
±íÊÇÓÉÐÐ×é³ÉµÄ£¬µ±ÎÒÃÇÏòij¸ö±í¼ÓËøʱ£¬Ò»·½ÃæÒª¼ì²é¸ÃËøµÄÉêÇëÊÇ·ñÓëÔÓÐµÄ±í¼¶ËøÏàÈÝ£»ÁíÒ»·½Ã棬»¹Òª¼ì²é¸Ã±íÊÇ·ñÓë±íÖеÄÿһÐÐÉϵÄËøÏàÈÝ¡£±ÈÈçÒ»¸öÊÂÎñÒªÔÚÒ»¸ö±íÉϼÓSËø£¬Èç¹û±íÖеÄÒ»ÐÐÒѱ»ÁíÍâµÄÊÂÎñ¼ÓÁËXËø£¬ÄÇô¸ÃËøµÄÉêÇëÒ²Ó¦±»×èÈû¡£Èç¹û±íÖеÄÊý¾ÝºÜ¶à£¬ÖðÐмì²éËø±êÖ¾µÄ¿ªÏú½«ºÜ´ó£¬ÏµÍ³ÐÔÄܽ«»áÊܵ½Ó°Ï졣ΪÁ˽â¾öÕâ¸öÎÊÌ⣬¿ÉÒÔÔÚ±í¼¶ÒýÈëеÄËøÀàÐÍÀ´±íʾÆäËùÊôÐеļÓËøÇé¿ö£¬Õâ¾ÍÒý³öÁË“ÒâÏòËø”µÄ¸ÅÄî¡£
ÒâÏòËøµÄº¬ÒåÊÇÈç¹û¶ÔÒ»¸ö½Úµã¼ÓÒâÏòËø£¬Ôò˵Ã
Ïà¹ØÎĵµ£º
ºÃ¾Ã¾ÍÏë¿´oracleÁË£¬ÓÉÓÚ×Ô¼ºÌ«ÀÁ£¬×î½ü²Å¿ªÊ¼¡£Ï£ÍûÒÔºóÄÜÑø³ÉºÃÏ°¹ß¡£
Ò»¡¢oracle 10g ·þÎñÆ÷
1.Ò»¸öoracle 10g·þÎñÆ÷°üº¬Ò»¸öoracleÊý¾Ý¿âºÍÒ»¸öoracle·þÎñÆ÷ʵÀý¡£
2.ÿµ±Êý¾Ý¿âÆô¶¯Ê±ºò£¬ÏµÍ³È«¾ÖÇø£¨SGA£©±»·ÖÅ䣬²¢Æô¶¯ÁËoracleºǫ́½ø³Ì¡£SGAÊÇÓÃÓÚÊý¾Ý¿âÓû§¹²ÏíÊý¾Ý¿âÐÅÏ¢µÄÄÚ´æÇøÓ ......
³£Ó÷½·¨ÓÐÒÔϼ¸ÖÖ£º
Ò»¡¢Í¨¹ýPL/SQL Dev¹¤¾ß
1¡¢Ö±½ÓFile->New->Explain Plan Window£¬ÔÚ´°¿ÚÖÐÖ´ÐÐsql¿ÉÒԲ鿴¼Æ»®½á¹û¡£ÆäÖУ¬Cost±íʾcpuµÄÏûºÄ£¬µ¥Î»Îªn%£¬Cardinality±íʾִÐеÄÐÐÊý£¬µÈ¼ÛRows¡£
2¡¢ÏÈÖ´ÐÐ EXPLAIN PLAN FOR select * from tableA ......
ORACLEÅàѵ(OCA)ÈÏÖ¤½éÉÜ
Oracle10g Certified Associate (OCA) Oracle ÈÏ֤רԱ¡£
¿¼ÊԳɼ¨Í¨¹ýÄÜ»ñµÃOracle¹«Ë¾ÎªÄú°ä·¢µÄÈ«ÇòÈÏÖ¤µÄÓ¢ÎÄOCAÖ¤Êé¡£OCAÓÉOracle¹«Ë¾³öÌâ¡£
¸ÃÖ¤Êé¿É×÷Ϊ¸÷ÆóÊÂÒµµ¥Î»Êý¾Ý¿â¹ÜÀíÈËÔ±ÉϸڵÄÒÀ¾Ý¡£
Ä¿Ç°ÒѳÉΪ¸÷IT¹«Ë¾¼°Ïà¹ØÆóÒµÕùÏྺƸµÄÊý¾Ý¿â¹ÜÀíά»¤È˲ţ¬ÊÇÊý¾Ý¿âά»¤¹ÜÀíÈËÔ ......
Access¡¢SQLServer¡¢Oracle³£¼ûSQLÓï¾äÓ¦ÓÃÇø±ð
¹Ø¾¢ËÉ PMP
Èç¹ûÒª¼æÈÝAccess¡¢SQL Server¡¢OracleÈý¸öÊý¾Ý¿â°æ±¾£»ÎÒÃÇÔÚ±àдSQLÓï¾äµÄ¹ý³ÌÖУ¬¾¡Á¿Ê¹ÓÃһЩͨÓõÄÓï¾ä£¬µ«»¹ÊÇÓÐЩ·½ÃæÓÐЩÇø±ð±ÜÃâ²»ÁË£¬ÏÖ¼òµ¥×ܽáһϡ£
ÒÔÏÂA´ú±íAccess,S´ú±íSQL Server,O´ú±íOracle
1¡¢È¡µ±Ç°ÏµÍ³Ê±¼ä
A:Select Now()
S:Selec ......