㈠ oracle鏁版嵁搴撳備綍澶囦喚鍜岃繕鍘
Oracle鏁版嵁搴撶殑澶囦喚鍜岃繕鍘熸槸涓涓娑夊強澶氫釜姝ラょ殑榪囩▼錛岄氬父鍖呮嫭瀹屾暣澶囦喚銆佸為噺澶囦喚銆佸綊妗f棩蹇楀囦喚浠ュ強鍒╃敤榪欎簺澶囦喚榪涜屾暟鎹搴撴仮澶嶃備笅闈㈢畝榪癘racle鏁版嵁搴撶殑澶囦喚涓庤繕鍘熺殑鍩烘湰嫻佺▼錛
澶囦喚
1. 瀹屾暣澶囦喚 (Full Backup)•鎵嬪伐澶囦喚錛•瀵逛簬鏁版嵁鏂囦歡錛屽彲浠ョ洿鎺ュ湪鎿嶄綔緋葷粺綰у埆澶嶅埗鏁版嵁鏂囦歡 (.dbf) 鍜屾帶鍒舵枃浠 (.ctl)錛屽苟澶囦喚鍒濆嬪寲鍙傛暟鏂囦歡 (spfile.ora 鎴 init.ora)銆•瀵逛簬褰掓。鏃ュ織錛屽湪Oracle鏁版嵁搴撻厤緗涓哄綊妗fā寮忔椂錛屼篃瑕佸嶅埗褰掓。鏃ュ織鏂囦歡 (.arc 鎴 .log) 鍒板畨鍏ㄤ綅緗銆•RMAN錛圧ecovery Manager錛夊囦喚錛•浣跨敤Oracle Recovery Manager宸ュ叿鎵ц屽叏搴撳囦喚錛屼緥濡傦細 RUN {
BACKUP DATABASE;
-- 濡傛灉鏄褰掓。妯″紡錛岃繕闇瑕佸囦喚褰掓。鏃ュ織
BACKUP ARCHIVELOG ALL;
}
2. 澧為噺澶囦喚 (Incremental Backup)•RMAN鏀鎸佷笉鍚岀駭鍒鐨勫為噺澶囦喚錛屽傜瘡璁″為噺澶囦喚鍜屽樊寮傚為噺澶囦喚錛屽彲浠ユ牴鎹鏇存敼閲忔潵鍑忓皯澶囦喚鎵闇鐨勭┖闂村拰鏃墮棿銆傝繕鍘熶笌鎮㈠3. 榪樺師 (Restore)•褰撴暟鎹搴撻渶瑕佹仮澶嶆椂錛岄栧厛瑕佹牴鎹鎯呭喌閫夋嫨鍚堥傜殑澶囦喚榪涜岃繕鍘熸搷浣溿 •鎵嬪伐榪樺師錛•灝嗗畬鏁寸殑鏁版嵁鏂囦歡浠庡囦喚浣嶇疆澶嶅埗鍥炲師濮嬫暟鎹鏂囦歡璺寰勩•濡傛湁蹇呰侊紝榪樺師褰掓。鏃ュ織銆•RMAN榪樺師錛•浣跨敤RMAN鍛戒護鎮㈠嶆暟鎹鏂囦歡錛 RESTORE DATABASE;
•鎴栬呴拡瀵圭壒瀹氭枃浠訛細 RESTORE DATAFILE 'file_name.dbf';
4. 鎮㈠ (Recover)•榪樺師鍙鏄灝嗗囦喚鐨勬暟鎹鏂囦歡鏀懼洖姝g『鐨勪綅緗錛岃屾仮澶嶅垯鏄搴旂敤蹇呰佺殑redo鏃ュ織錛岀『淇濇暟鎹搴撹兘鎮㈠嶈嚦涓鑷存х姸鎬併•鍦ㄥ畬鎴愯繕鍘熷悗錛屼嬌鐢≧MAN鎵ц屾仮澶嶆搷浣滐細RECOVER DATABASE;
•濡傛灉鏄浠庡囦喚鐐規仮澶嶈嚦鐗瑰畾鏃墮棿鐐癸紝鍒欓渶瑕佹寚瀹歎NTIL閫夐」錛屽苟緇撳悎褰掓。鏃ュ織榪涜屾椂闂寸偣鎮㈠嶃5. 浠嬭川鎮㈠•鍦ㄥ彂鐢熶粙璐ㄦ晠闅滄椂錛屽彲鑳介渶瑕佺粨鍚堝綊妗f棩蹇楄繘琛屽墠婊氭仮澶嶏紙Forward Recovery錛夛紝紜淇濇暟鎹搴撳寘鍚鎵鏈夊凡鎻愪氦浜嬪姟鐨勬暟鎹錛屽苟涓旀竻鐞嗘湭鎻愪氦浜嬪姟銆•浣跨敤RMAN榪涜屼粙璐ㄦ仮澶嶇ず渚嬶紙綆鍖栫増錛夛細RESTORE DATABASE FROM DISK '/backup/full_backup';
RECOVER DATABASE UNTIL TIME 'SYSDATE - 1'; -- 鎮㈠嶅埌鍓嶄竴澶╃殑緋葷粺鏃墮棿
6. 鎵撳紑鏁版嵁搴•瀹屾垚鎮㈠嶅悗錛屾e父鎯呭喌涓嬶紝闇瑕佹敼鍙樻暟鎹搴撶殑鐘舵佷互渚垮簲鐢ㄥ彲浠ヨ塊棶錛 ALTER DATABASE OPEN;
璇鋒敞鎰忎互涓婃ラや粎涓哄熀鏈嫻佺▼姒傝堪錛屽疄闄呮搷浣滀腑闇瑕佹牴鎹鍏蜂綋鐨凮racle鐗堟湰銆佹暟鎹搴撻厤緗銆佸囦喚絳栫暐鍜岀伨闅炬仮澶嶉渶奼傝皟鏁村叿浣撳懡浠ゅ拰鎿嶄綔銆傛ゅ栵紝澶囦喚鍜屾仮澶嶈繃紼嬩腑錛岃繕瑕佸厖鍒嗚冭檻澶囦喚楠岃瘉銆佹祴璇曟仮澶嶈″垝絳夊洜緔狅紝紜淇濇暟鎹瀹夊叏鍜屽彲鐢ㄦ
㈡ oracle有哪些備份方式
三種方法:冷備份、熱備份和Export導出資料庫對象備份