OracleµÄredo ºÍundoµÄÇø±ð
дµÄ´ÎÐò:
redo--> undo-->datafile
insertÒ»Ìõ¼Ç¼ʱ, ±í¸úundoµÄÐÅÏ¢¶¼»á·Å½ø redo ÖÐ, ÔÚcommit »ò֮ǰ, redo µÄÐÅÏ¢»á·Å½øÓ²ÅÌÉÏ. ¹ÊÕÏʱ, redo ±ã¿É»Ö¸´ÄÇЩÒѾcommit Á˵ÄÊý¾Ý.
redo->ÿ´Î²Ù×÷¶¼ÏȼǼµ½redoÈÕÖ¾ÖУ¬µ±³öÏÖʵÀý¹ÊÕÏ£¨Ïñ¶Ïµç£©£¬µ¼ÖÂÊý¾ÝδÄܸüе½Êý¾ÝÎļþ£¬ÔòÊý¾Ý¿âÖØÆôʱÐëredo£¬ÖØаÑÊý¾Ý¸üе½Êý¾ÝÎļþ
undo->¼Ç¼¸ü¸ÄÇ°µÄÒ»·Ýcopy£¬µ«Äãϵͳrollbackʱ£¬°ÑÕâ·ÝcopyÖØи²¸Çµ½ÔÀ´µÄÊý¾Ý
redo->¼Ç¼ËùÓвÙ×÷£¬ÓÃÓÚ»Ö¸´£¨redo records all the database transaction used for recovery£©
undo->¼Ç¼ËùÓеÄÇ°Ó¡Ïó£¬ÓÃÓڻعö£¨undo is used to store uncommited data infor used for rollback£©
redo->Òѵݽ»µÄÊÂÎñ,ʵÀý»Ö¸´Ê±ÒªÐ´µ½Êý¾ÝÎļþÈ¥µÄ
undo->δµÝ½»µÄÊÂÎñ.
redoµÄÔÒòÊÇ£ºÃ¿´Îcommitʱ£¬½«Êý¾ÝµÄÐÞ¸ÄÁ¢¼´Ð´µ½online redoÖУ¬µ«ÊDz¢²»Ò»¶¨Í¬Ê±½«¸ÃÊý¾ÝµÄÐÞ¸Äдµ½Êý¾ÝÎļþÖС£ÒòΪ¸ÃÊý¾ÝÒѾÌá½»£¬µ«ÊÇÖ»´æÔÚÁª»úÈÕÖ¾ÎļþÖУ¬ËùÒÔÔÚ»Ö¸´Ê±ÐèÒª½«Êý¾Ý´ÓÁª»úÈÕÖ¾ÎļþÖÐÕÒ³öÀ´£¬ÖØÐÂÓ¦ÓÃһϣ¬Ê¹ÒѾ¸ü¸ÄÊý¾ÝÔÚÊý¾ÝÎļþÖÐÒ²¸Ä¹ýÀ´£¡
undoµÄÔÒòÊÇ£ºÔÚoracleÕý³£ÔËÐÐʱ£¬ÎªÁËÌá¸ßЧÂÊ£¬¼ÓÈëÓû§»¹Ã»ÓÐcommit,µ«ÊÇ¿ÕÏÐÄÚ´æ²»¶àʱ£¬»áÓÉDBWR½ø³Ì½«Ôà¿éдÈëµ½Êý¾ÝÎļþÖУ¬ÒÔ±ãÌÚ³ö±¦¹óµÄÄڴ湩ÆäËü½ø³ÌʹÓá£Õâ¾ÍÊÇÐèÒªUNDOµÄÔÒò¡£ÒòΪ»¹Ã»Óз¢³öcommitÓï¾ä£¬µ«ÊÇoracleµÄdbwr½ø³ÌÒѾ½«Ã»ÓÐÌá½»µÄÊý¾Ýдµ½Êý¾ÝÎļþÖÐÈ¥ÁË¡£
undo Ò²ÊÇÒ²ÊÇdatafile£¬ ¿ÉÄÜdirty buffer ûÓÐд»Øµ½´ÅÅÌÀïÃæÈ¥¡£
Ö»ÓÐÏÈredo apply ³É¹¦ÁË£¬²ÅÄܱ£Ö¤undo datafile ÀïÃæµÄ¶«Î÷¶¼ÊÇÕýÈ·µÄ£¬È»ºó²ÅÄÜrollback
×öundoµÄÄ¿µÄÊÇʹϵͳ»Ö¸´µ½ÏµÍ³±ÀÀ£Ç°(¹Ø»úÇ°)µÄ״̬,ÔÙ½øÐÐredoÊDZ£Ö¤ÏµÍ³µÄÒ»ÖÂÐÔ.
²»×öundo,ϵͳ¾Í²»»áÖªµÀ֮ǰµÄ״̬,redo¾ÍÎÞ´Ó̸Æð
ËùÒÔinstance crash recovery µÄʱºò×ÜÊÇÏÈrollforward£¬ ÔÙrollback
undo
»ØÍ˶ÎÖеÄÊý¾ÝÊÇÒÔ“»ØÍËÌõÄ¿”·½Ê½´æ´¢¡£
»ØÍËÌõÄ¿=¿éÐÅÏ¢(ÔÚÊÂÎñÖз¢Éú¸Ä¶¯µÄ¿éµÄ±àºÅ)+ÔÚÊÂÎñÌύǰ´æ´¢ÔÚ¿éÖеÄÊý¾Ý
ÔÚÿһ¸ö»ØÍ˶ÎÖÐoracle¶¼ÎªÆäά»¤Ò»ÕÅ“ÊÂÎñ±í”
ÔÚÊÂÎñ±íÖмǼ×ÅÓë¸Ã»ØÍ˶ÎÖÐËùÓлØÍËÌõÄ¿Ïà¹ØµÄÊÂÎñ±àºÅ£¨ÊÂÎñSCN&»ØÍËÌõÄ¿£©
redo
ÖØ×ö¼Ç¼ÓÉÒ»×铱ä¸üÏòÁ¿”×é³É¡£
ÿ¸ö±ä¸ü±äÁ¿ÖмǼÁËÊÂÎñ¶ÔÊý¾Ý¿âÖÐij¸ö¿éËù×öµÄÐ޸ġ£
µ±Óû§Ìá½»Ò»ÌõcommitÓï¾äʱ£¬LGWR½ø³Ì»áÁ¢¿Ì½«Ò»ÌõÌá½»¼Ç¼дÈëµ½ÖØ×öÈÕÖ¾Îļ
Ïà¹ØÎĵµ£º
Oracle´æ´¢¹ý³Ì°üº¬Èý²¿·Ö£º¹ý³ÌÉùÃ÷£¬Ö´Ðйý³Ì²¿·Ö£¬´æ´¢¹ý³ÌÒì³£¡£
Oracle´æ´¢¹ý³Ì¿ÉÒÔÓÐÎÞ²ÎÊý´æ´¢¹ý³ÌºÍ´ø²ÎÊý´æ´¢¹ý³Ì¡£
Ò»¡¢Î޲γÌÐò¹ý³ÌÓï·¨
1 create or replace procedure NoParPro
2 as ;
3 begin
4 ;
5 exception &nb ......
½ñÌìдÓйØOracleÖк¯ÊýÓë´¥·¢Æ÷µÄÄÚÈÝ£¬ÔÚÊý¾Ý¿âÖж¨Ò岢ʹÓô洢¹ý³Ì¡¢º¯Êý¡¢´¥·¢Æ÷£¬¿ÉÒÔÌá¸ßÓû§·ÃÎÊÊý¾Ý¿âµÄЧÂÊ¡£
Êý¾Ý¿âÖк¯Êý°üº¬Ëĸö²¿·Ö£ºÉùÃ÷¡¢·µ»ØÖµ¡¢º¯ÊýÌåºÍÒì³£´¦Àí¡£
1 create or replace function getname(sno varchar2 )
2 &nbs ......
oracleÖÐpro*cµÄѧϰ
¡¡Ò» Pro*C ³ÌÐò¸ÅÊö£º
1£®Ê²Ã´ÊÇPro*C³ÌÐò
ÔÚORACLEÊý¾Ý¿â¹ÜÀíºÍϵͳÖУ¬ ÓÐÈýÖÖ·ÃÎÊÊý¾Ý¿âµÄ·½·¨£»
£¨1£© ÓÃSQL*Plus£¬ ËüÓÐSQLÃüÁîÒÔ½»»¥µÄÓ¦ÓóÌÐò·ÃÎÊÊý¾Ý¿â£»
£¨2£© ÓõÚËÄ´úÓïÑÔÓ¦Óÿª·¢¹¤¾ß¿ª·¢µÄÓ¦ÓóÌÐò·ÃÎÊÊý¾Ý¿â£¬ÕâЩ¹¤¾ßÓÐSQL*froms£¬QL*Reportwriter,SQL*MenuµÈ£»
£¨3£© ÀûÓÃÔÚ ......
Åú´¦Àí£¨batÎļþ£© ×Ô¶¯Æô¶¯/¹Ø±Õoracle·þÎñ
ÅжÏoracle ·þÎñ״̬
Èç¹û·þÎñ´¦ÓÚÆô¶¯×´Ì¬£¬¾Í¹Ø±Õ·þÎñ£»
Èç¹û·þÎñ´¦ÓڹرÕ״̬£¬¾ÍÆô¶¯·þÎñ¡£
@ECHO OFF
for /f "skip=3 tokens=4" %%i in ('sc query OracleServiceORCL') do set "zt=%%i" &goto :next
:next
if /i "%zt%"=="RUNNING" (
ECHO Stoping Oracle ......
1.´´½¨±í£º
a. ´´½¨xs±íÖмÆËã»úרҵѧÉúµÄ±¸·Ý
Create table xs_jsj as select * from xs where zym=’¼ÆËã»ú’;
b.ÍêÕûµÄÀý×Ó£º
¡¡¡¡¡¡¡¡¡¡ Create table test ......