OracleËø»úÖÆ
Êý¾Ý¿âÊÇÒ»¸ö¶àÓû§Ê¹ÓõĹ²Ïí×ÊÔ´¡£µ±¶à¸öÓû§²¢·¢µØ´æÈ¡Êý¾Ýʱ£¬ÔÚÊý¾Ý¿âÖоͻá²úÉú¶à¸öÊÂÎñͬʱ´æȡͬһÊý¾ÝµÄÇé¿ö¡£Èô¶Ô²¢·¢²Ù×÷²»¼Ó¿ØÖƾͿÉÄÜ»á¶ÁÈ¡ºÍ´æ´¢²»ÕýÈ·µÄÊý¾Ý£¬ÆÆ»µÊý¾Ý¿âµÄÒ»ÖÂÐÔ¡£
¼ÓËøÊÇʵÏÖÊý¾Ý¿â²¢·¢¿ØÖƵÄÒ»¸ö·Ç³£ÖØÒªµÄ¼¼Êõ¡£µ±ÊÂÎñÔÚ¶Ôij¸öÊý¾Ý¶ÔÏó½øÐвÙ×÷Ç°£¬ÏÈÏòϵͳ·¢³öÇëÇ󣬶ÔÆä¼ÓËø¡£¼ÓËøºóÊÂÎñ¾Í¶Ô¸ÃÊý¾Ý¶ÔÏóÓÐÁËÒ»¶¨µÄ¿ØÖÆ£¬ÔÚ¸ÃÊÂÎñÊÍ·ÅËø֮ǰ£¬ÆäËûµÄÊÂÎñ²»ÄܶԴËÊý¾Ý¶ÔÏó½øÐиüвÙ×÷¡£
ÔÚÊý¾Ý¿âÖÐÓÐÁ½ÖÖ»ù±¾µÄËøÀàÐÍ£ºÅÅËüËø£¨Exclusive Locks£¬¼´XËø£©ºÍ¹²ÏíËø£¨Share Locks£¬¼´SËø£©¡£µ±Êý¾Ý¶ÔÏó±»¼ÓÉÏÅÅËüËøʱ£¬ÆäËûµÄÊÂÎñ²»ÄܶÔËü¶ÁÈ¡ºÍÐ޸ġ£¼ÓÁ˹²ÏíËøµÄÊý¾Ý¶ÔÏó¿ÉÒÔ±»ÆäËûÊÂÎñ¶ÁÈ¡£¬µ«²»ÄÜÐ޸ġ£Êý¾Ý¿âÀûÓÃÕâÁ½ÖÖ»ù±¾µÄËøÀàÐÍÀ´¶ÔÊý¾Ý¿âµÄÊÂÎñ½øÐв¢·¢¿ØÖÆ¡£
OracleÊý¾Ý¿âµÄËøÀàÐÍ
¸ù¾Ý±£»¤µÄ¶ÔÏó²»Í¬£¬OracleÊý¾Ý¿âËø¿ÉÒÔ·ÖΪÒÔϼ¸´óÀࣺDMLËø£¨data locks£¬Êý¾ÝËø£©£¬ÓÃÓÚ±£»¤Êý¾ÝµÄÍêÕûÐÔ£»DDLËø£¨dictionary locks£¬×ÖµäËø£©£¬ÓÃÓÚ±£»¤Êý¾Ý¿â¶ÔÏóµÄ½á¹¹£¬Èç±í¡¢Ë÷ÒýµÈµÄ½á¹¹¶¨Ò壻ÄÚ²¿ËøºÍãÅ£¨internal locks and latches£©£¬±£»¤ Êý¾Ý¿âµÄÄÚ²¿½á¹¹¡£
DMLËøµÄÄ¿µÄÔÚÓÚ±£Ö¤²¢·¢Çé¿öϵÄÊý¾ÝÍêÕûÐÔ£¬¡£ÔÚOracleÊý¾Ý¿âÖУ¬DMLËøÖ÷Òª°üÀ¨TMËøºÍTXËø£¬ÆäÖÐTMËø³ÆΪ±í¼¶Ëø£¬TXËø³ÆΪÊÂÎñËø»òÐм¶Ëø¡£
µ±Oracle Ö´ÐÐDMLÓï¾äʱ£¬ÏµÍ³×Ô¶¯ÔÚËùÒª²Ù×÷µÄ±íÉÏÉêÇëTMÀàÐ͵ÄËø¡£µ±TMËø»ñµÃºó£¬ÏµÍ³ÔÙ×Ô¶¯ÉêÇëTXÀàÐ͵ÄËø£¬²¢½«Êµ¼ÊËø¶¨µÄÊý¾ÝÐеÄËø±ê־λ½øÐÐÖÃλ¡£ÕâÑùÔÚÊÂÎñ¼ÓËøÇ°¼ì²éTXËøÏàÈÝÐÔʱ¾Í²»ÓÃÔÙÖðÐмì²éËø±êÖ¾£¬¶øÖ»Ðè¼ì²éTMËøģʽµÄÏàÈÝÐÔ¼´¿É£¬´ó´óÌá¸ßÁËϵͳµÄЧÂÊ¡£TMËø°üÀ¨ÁËSS¡¢SX¡¢S¡¢X µÈ¶àÖÖģʽ£¬ÔÚÊý¾Ý¿âÖÐÓÃ0£6À´±íʾ¡£²»Í¬µÄSQL²Ù×÷²úÉú²»Í¬ÀàÐ͵ÄTMËø¡£
ÔÚÊý¾ÝÐÐÉÏÖ»ÓÐXËø£¨ÅÅËûËø£©¡£ÔÚ OracleÊý¾Ý¿âÖУ¬µ±Ò»¸öÊÂÎñÊ״η¢ÆðÒ»¸öDMLÓï¾äʱ¾Í»ñµÃÒ»¸öTXËø£¬¸ÃËø±£³Öµ½ÊÂÎñ±»Ìá½»»ò»Ø¹ö¡£µ±Á½¸ö»ò¶à¸ö»á»°ÔÚ±íµÄͬһÌõ¼Ç¼ÉÏÖ´ÐÐ DMLÓï¾äʱ£¬µÚÒ»¸ö»á»°ÔÚ¸ÃÌõ¼Ç¼ÉϼÓËø£¬ÆäËûµÄ»á»°´¦Óڵȴý״̬¡£µ±µÚÒ»¸ö»á»°Ìá½»ºó£¬TXËø±»ÊÍ·Å£¬ÆäËû»á»°²Å¿ÉÒÔ¼ÓËø¡£
µ±OracleÊý¾Ý¿â·¢ÉúTXËøµÈ´ýʱ£¬Èç¹û²»¼°Ê±´¦Àí³£³£»áÒýÆðOracleÊý¾Ý¿â¹ÒÆ𣬻òµ¼ÖÂËÀËøµÄ·¢Éú£¬²úÉúORA-60µÄ´íÎó¡£ÕâЩÏÖÏ󶼻á¶Ôʵ¼ÊÓ¦ÓòúÉú¼«´óµÄΣº¦£¬È糤ʱ¼äδÏìÓ¦£¬´óÁ¿ÊÂÎñʧ°ÜµÈ¡£
±¯¹Û·âËøºÍÀÖ¹Û·âËø
Ò»¡¢±¯¹Û·âËø
ËøÔÚÓû§ÐÞ¸Ä֮ǰ¾Í·¢»Ó×÷Óãº
Select ..for update£¨nowait)
Select * from t
Ïà¹ØÎĵµ£º
1.Êý¾Ý¿âµÄË÷Òý
¿ÉÒÔ½«Ë÷Òý¸ÅÄîÓ¦Óõ½Êý¾Ý¿â±íÉÏ¡£µ±Ò»¸ö±íº¬ÓдóÁ¿µÄ¼Ç¼ʱ£¬Oracle²éÕҸñíÖеÄÌØд¼Ç¼Ҫ»¨ºÜ³¤µÄʱ¼ä——¾ÍÏñ»¨ºÜ³¤Ê±¼ä·¿´È«ÊéÀ´²éÕÒij¸öÖ÷ÌâÒ»Ñù¡£OracleÓÐÒ»¸öÒ×ÓÚʹÓõŦÄÜ£¬¼´¿ÉÒÔ½¨Á¢Ò»¸ö´ÎÒþ²Ø±í£¬¸Ã±í°üº¬Ö÷±íÖеÄÒ»¸ö»ò¶à¸öÖØÒªµÄÁУ¬ÒÔ¼°ÔÚÖ÷± ......
1.Óû§¹ÜÀí
£¨1£©½¨Á¢Óû§£¨Êý¾Ý¿âÑéÖ¤£©
CREATE USER smith
IDENTIFIED BY smith_pwd
DEFAULT TABLESPACE users
TEMPORARY TABLESPACE temp
QUOTA 5m ON users;
£¨2£©ÐÞ¸ÄÓû§
ALTER USER smith
QUOTA 0 ON SYSTEM;
£¨3£©É¾³ýÓû§
DROP USER smith;
DROP USER ......
phpµ÷ÓÃoracleÐд洢¹ý³Ì############################################################
PHP³ÌÐò·ÃÎÊÊý¾Ý¿â£¬ÍêÈ«¿ÉÒÔʹÓô洢¹ý³Ì£¬ÓÐÈËÈÏΪʹÓô洢¹ý³Ì±ãÓÚά»¤
²»¹ýÈÊÕß¼ûÈÊ£¬ÖÇÕß¼ûÖÇ¡£
ÔÚÕâ¸öÎÊÌâÉÏ£¬Å¼ÈÏΪʹÓô洢¹ý³ÌÒâζ×űØÐëÒªDBAºÍ¿ª·¢ÈËÔ±¸ü½ôÃÜÅäºÏ,Èç¹ûÆäÖÐÒ»·½¸ü±ä£¬ÔòÏÔÈ»ÄÑÒÔά»¤¡£
µ«ÊÇʹÓô洢 ......
SQLÖеĵ¥¼Ç¼º¯Êý
1.ASCII
·µ»ØÓëÖ¸¶¨µÄ×Ö·û¶ÔÓ¦µÄÊ®½øÖÆÊý;
SQL> select ascii('A') A,ascii('a') a,ascii('0') zero,ascii(' ') space from dual;
A A ZERO ......
1¡¢Ð½¨PDM.ÓÒ»÷Workspace->New->Free Model->Physical Data Model
2¡¢Model nameÈÎÒâ, DBMS=>ORACLE Version 9i2->È·¶¨
3¡¢ÅäÖÃODBC
¿ØÖÆÃæ°å->¹ÜÀí¹¤¾ß->Êý¾ÝÔ´(ODBC)->ϵͳDSN->Ìí¼Ó,Èç¹ûÓÐ×°ÍêÕûµÄOracle¿Í»§¶Ë»á³öÏÖרÃŵÄÇý¶¯,ÎÒµÄÊǼò°æµÄ¾ÍÑ¡
"Microsoft ODBC for Oracl ......