Oracle ÁÙʱ±í
1.ÁÙʱ±íµÄ»ù´¡ÖªÊ¶
ÁÙʱ±íÖ»ÔÚOracle 8i ÒÔ¼°ÒÔÉϲúÆ·ÖÐÖ§³Ö¡£ORACLEÊý¾Ý¿â³ýÁË¿ÉÒÔ±£´æÓÀ¾Ã±íÍ⣬»¹¿ÉÒÔ½¨Á¢ÁÙʱ±ítemporary tables¡£ÕâЩÁÙʱ±íÓÃÀ´±£´æÒ»¸ö»á»°SESSIONµÄÊý¾Ý£¬»òÕß±£´æÔÚÒ»¸öÊÂÎñÖÐÐèÒªµÄÊý¾Ý¡£µ±»á»°Í˳ö»òÕßÓû§Ìá½»commitºÍ»Ø¹örollbackÊÂÎñµÄʱºò£¬ÁÙʱ±íµÄÊý¾Ý×Ô¶¯Çå¿Õ£¬µ«ÊÇÁÙʱ±íµÄ½á¹¹ÒÔ¼°ÔªÊý¾Ý»¹´æ´¢ÔÚÓû§µÄÊý¾Ý×ÖµäÖС£
OracleµÄÁÙʱ±í´´½¨Ö®ºó»ù±¾²»Õ¼Óñí¿Õ¼ä£¬ÁÙʱ±í²¢·Ç´æ·ÅÔÚÓû§µÄ±í¿Õ¼äÖУ¬¶øÊÇ´æ·ÅÔÚ Schema ËùÖ¸¶¨µÄÁÙʱ±í¿Õ¼äÖС£Èç¹ûÄãûÓÐÖ¸¶¨ÁÙʱ±í£¨°üÀ¨ÁÙʱ±íµÄË÷Òý£©´æ·ÅµÄ±í¿ÕµÄʱºò£¬Äã²åÈëµ½ÁÙʱ±íµÄÊý¾ÝÊÇ´æ·ÅÔÚORACLEϵͳµÄÁÙʱ±í¿Õ¼äÖУ¨TEMP£©¡£
¿ÉÒÔ¶ÔÁÙʱ±í´´½¨Ë÷Òý£¬ÊÓͼ£¬´¥·¢Æ÷£¬¿ÉÒÔÓÃexportºÍimport¹¤¾ßµ¼Èëµ¼³ö±íµÄ¶¨Ò壬µ«ÊDz»Äܵ¼³öÊý¾Ý¡£±íµÄ¶¨Òå¶ÔËùÓеĻỰ¿É¼û¡£½¨Á¢ÔÚÁÙʱ±íÉϵÄË÷ÒýÒ²ÊÇÁÙʱµÄ,Ò²ÊÇÖ»¶Ôµ±Ç°»á»°»òÕßÊÂÎñÓÐЧ.
¾¡¹Ü¶ÔÁÙʱ±íµÄDML²Ù×÷ËٶȱȽϿ죬µ«Í¬ÑùÒ²ÊÇÒª²úÉú Redo Log £¬Ö»ÊÇͬÑùµÄDMLÓï¾ä£¬±È¶Ô PERMANENT µÄDML ²úÉúµÄRedo Log ÉÙ¡£
ÁÙʱ±íµÄ²»×ãÖ®´¦£º
1.²»Ö§³Ölob¶ÔÏó£¬ÕâÒ²ÐíÊÇÉè¼ÆÕß»ùÓÚÔËÐÐЧÂʵĿ¼ÂÇ£¬µ«Êµ¼ÊÓ¦ÓÃÖÐȷʵÐèÒª´Ë¹¦ÄÜʱ¾ÍÎÞ·¨Ê¹ÓÃÁÙʱ±íÁË¡£
2.²»Ö§³ÖÖ÷Íâ¼ü¹ØÏµ
ÌØÐÔºÍÐÔÄÜ(ÓëÆÕͨ±íºÍÊÓͼµÄ±È½Ï)
¡¡1.ÁÙʱ±íÖ»ÔÚµ±Ç°Á¬½ÓÄÚÓÐЧ
¡¡2.ÁÙʱ±í²»½¨Á¢Ë÷Òý,ËùÒÔÈç¹ûÊý¾ÝÁ¿±È½Ï´ó»ò½øÐжà´Î²éѯʱ,²»ÍƼöʹÓÃ
¡¡3.Êý¾Ý´¦Àí±È½Ï¸´ÔÓµÄʱºòʱ±í¿ì,·´Ö®ÊÓͼ¿ìµã
4.ÔÚ½ö½ö²éѯÊý¾ÝµÄʱºò½¨ÒéÓÃÓαê: open cursor for 'sql clause';
ÁÙʱ±íµÄÓ¦Óãº
¶ÔÓÚÒ»¸öµç×ÓÉÌÎñÀàÍøÕ¾£¬²»Í¬Ïû·ÑÕßÔÚÍøÕ¾ÉϹºÎ¾ÍÊÇÒ»¸ö¶ÀÁ¢µÄ SESSION£¬Ñ¡¹ºÉÌÆ··Å½ø¹ºÎï³µÖУ¬×îºó½«¹ºÎï³µÖеÄÉÌÆ·½øÐнáËã¡£Ò²¾ÍÊÇ˵£¬±ØÐëÔÚÕû¸öSESSIONÆÚ¼ä±£´æ¹ºÎï³µÖеÄÐÅÏ¢¡£Í¬Ê±£¬»¹´æÔÚÓÐЩÏû·ÑÕߣ¬ÍùÍù×îÖÕ½áÕËʱ·ÅÆú¹ºÂòÉÌÆ·¡£Èç¹û£¬Ö±½Ó½«Ïû·ÑÕßÑ¡¹ºÐÅÏ¢´æ·ÅÔÚ×îÖÕ±í£¨PERMANENT£©ÖУ¬±ØÈ»¶Ô×îÖÕ±íÔì³É·Ç³£´óµÄѹÁ¦¡£Òò´Ë£¬¶ÔÓÚÕâÖÖ°¸Àý£¬¾Í¿ÉÒÔ²ÉÓô´½¨ÁÙʱ±í(ON COMMIT PRESERVE ROWS)µÄ·½·¨À´½â¾ö¡£Êý¾ÝÖ»ÔÚ SESSION ÆÚ¼äÓÐЧ£¬¶ÔÓÚ½áËã³É¹¦µÄÓÐЧÊý¾Ý£¬×ªÒƵ½×îÖÕ±íÖкó£¬ORACLE×Ô¶¯TRUNCATE ÁÙʱÊý¾Ý£»¶ÔÓÚ·ÅÆú½áËãµÄÊý¾Ý£¬ORACLE ͬÑù×
Ïà¹ØÎĵµ£º
ORACLEÀïËøÓÐÒÔϼ¸ÖÖģʽ:
0£ºnone
1£ºnull ¿Õ
2£ºRow-S Ðй²Ïí(RS)£º¹²Ïí±íËø£¬sub share
3£ºRow-X ÐжÀÕ¼(RX)£ºÓÃÓÚÐеÄÐ޸ģ¬sub exclusive
4£ºShare ¹²ÏíËø(S)£º×èÖ¹ÆäËûDML²Ù×÷£¬share
5£ºS/Row-X ¹²ÏíÐжÀÕ¼(SRX)£º×èÖ¹ÆäËûÊÂÎñ²Ù×÷£¬share/sub exclusive
6£ºexclusive ¶ÀÕ¼(X)£º¶ÀÁ¢·ÃÎÊʹÓã¬exclusive
......
OracleϵÁУºLOB´ó¶ÔÏó´¦Àí
Ö÷ÒªÊÇÓÃÀ´´æ´¢´óÁ¿Êý¾ÝµÄÊý¾Ý¿â×ֶΣ¬×î´ó¿ÉÒÔ´æ´¢4G×ֽڵķǽṹ»¯Êý¾Ý¡£
Ö÷Òª½éÉÜ×Ö·ûÀàÐͺͶþ½øÖÆÎļþÀàÐÍLOBÊý¾ÝµÄ´æ´¢£¬µ¥¶À½éÉܶþ½øÖÆÀàÐÍLOBÊý¾ÝµÄ´æ´¢¡£
Ò»£¬OracleÖеÄLOBÊý¾ÝÀàÐÍ·ÖÀà
1£¬°´´æ´¢Êý¾ÝµÄÀàÐÍ·Ö£º
¢Ù×Ö·ûÀàÐÍ£º
&nbs ......
OracleϵÁУº¼Ç¼£¨Record£©
Ò»£¬Ê²Ã´ÊǼǼ£¨Record£©£¿
Óɵ¥ÐжàÁеıêÁ¿¹¹³ÉµÄ¸´ºÏ½á¹¹¡£¿ÉÒÔ¿´×öÊÇÒ»ÖÖÓû§×Ô¶¨ÒåÊý¾ÝÀàÐÍ¡£×é³ÉÀàËÆÓÚ¶àάÊý×é¡£
½«Ò»¸ö»ò¶à¸ö±êÁ¿·â×°³ÉÒ»¸ö¶ÔÏó½øÐвÙ×÷¡£ÊÇÒ»ÖÖÁÙʱ¸´ºÏ¶ÔÏóÀàÐÍ¡£
¼Ç¼¿ÉÒÔÖ±½Ó¸³Öµ¡£RECORD1 :=RECORD2£»
¼Ç¼²»¿ÉÒÔÕûÌå±È½Ï. ......
1)½¨Á¢²Ù×÷ϵͳĿ¼e:\test£¬×¼±¸Êý¾ÝÎļþdept.txt²¢ÖÃÓÚe:\testÖ®ÏÂ
"10","ACCOUNTING","NEW
YORK"
"20","RESEARCH","DALLAS"
"30","SALES","CHICAGO"
"40","OPERATIONS","BOSTON"
2)´´ ......
ǰ¼¸ÌìÃæÊÔµÄʱºòÃæÊÔ¹Ù²ÅÎʹýÎÒORACLEµÄÌåϵ½á¹¹£¬ÈÃÎÒÔÚÒ»ÕŰ×Ö½ÉÏ»³öÀ´¡£»ØÍ·ÏëÏ뵱ʱ´ðµÃ»¹²»´í£¬´ó²¿·ÖÄÚÈݶ¼ÃèÊö³öÀ´ÁË£¬ºÇºÇ£¬¸Õ²ÅÔÚÍøÉÏ¿´µ½Ò»Æª½²½âORACLEÌåϵ½á¹¹µÄÎÄÕ£¬¾õµÃ²»´í£¬×ª¹ýÀ´´æ×Å£¬½«À´¿ÉÄÜ»áÓõ½¡£
=================================================================================
ÔÚ±¾ÎÄÀ ......