基於非歸檔的冷備份恢復
基於非歸檔的冷備份恢復—為離線恢復,不完全恢復,在冷備份之後發生的資料庫變化將無法恢復,而且冷備份恢復必須是全庫恢復,包括資料檔案、聯機日誌、控制檔案的restore,不能做資料庫的區域性恢復,比如只恢復某個表空間或某個資料檔案。
冷備能恢復成功的先決條件是,當你在做冷備的時候,資料庫是shutdown已關閉的狀態,這樣才能保證一致性。
下面是執行步驟,因該步驟比較簡單,就只列出指令碼沒有實際操作的結果:
1. shutdown immediate –這一步是必須放在第一步的 2. select name from v$datafile; 3. select member from v$logfile; 4. select name from v$controlfile; 5. show parameter spfile; 6. 根據以上四步操作,取得要備份的檔案清單,然後做冷拷貝 cp /u01/app/oracle/oradata/PROD/disk1/system001.dbf /home/oracle/coldbackup/20140125-1 cp /u01/app/oracle/oradata/PROD/disk1/undotbs01.dbf /home/oracle/coldbackup/20140125-1 cp /u01/app/oracle/oradata/PROD/disk1/sysaux01.dbf /home/oracle/coldbackup/20140125-1 cp /u01/app/oracle/oradata/PROD/disk1/example1.dbf /home/oracle/coldbackup/20140125-1 cp /u01/app/oracle/oradata/PROD/disk1/indx1.dbf /home/oracle/coldbackup/20140125-1 cp /u01/app/oracle/oradata/PROD/disk1/tools1.dbf /home/oracle/coldbackup/20140125-1 cp /u01/app/oracle/oradata/PROD/disk1/users1.dbf /home/oracle/coldbackup/20140125-1 cp /u01/app/oracle/oradata/PROD/disk1/oltp1.dbf /home/oracle/coldbackup/20140125-1 cp /u01/app/oracle/oradata/PROD/disk1/tbs_tommie01.dbf /home/oracle/coldbackup/20140125-1 cp /u01/app/oracle/oradata/PROD/disk1/redo101.log /home/oracle/coldbackup/20140125-1 cp /u01/app/oracle/oradata/PROD/disk2/redo102.log /home/oracle/coldbackup/20140125-1 cp /u01/app/oracle/oradata/PROD/disk3/redo103.log /home/oracle/coldbackup/20140125-1 cp /u01/app/oracle/oradata/PROD/disk1/redo201.log /home/oracle/coldbackup/20140125-1 cp /u01/app/oracle/oradata/PROD/disk2/redo202.log /home/oracle/coldbackup/20140125-1 cp /u01/app/oracle/oradata/PROD/disk3/redo203.log /home/oracle/coldbackup/20140125-1 cp /u01/app/oracle/oradata/PROD/disk1/redo301.log /home/oracle/coldbackup/20140125-1 cp /u01/app/oracle/oradata/PROD/disk2/redo302.log /home/oracle/coldbackup/20140125-1 cp /u01/app/oracle/oradata/PROD/disk3/redo303.log /home/oracle/coldbackup/20140125-1 cp /u01/app/oracle/oradata/PROD/disk4/redo104.log /home/oracle/coldbackup/20140125-1 cp /u01/app/oracle/oradata/PROD/disk4/redo204.log /home/oracle/coldbackup/20140125-1 cp /u01/app/oracle/oradata/PROD/disk1/control01.ctl /home/oracle/coldbackup/20140125-1 cp /u01/app/oracle/oradata/PROD/disk2/control02.ctl /home/oracle/coldbackup/20140125-1 cp /u01/app/oracle/product/10.2.0/db_1/dbs/spfilePROD.ora /home/oracle/coldbackup/20140125-1 7. 當資料庫冷備份恢復時,先將資料庫shutdown(可能是正常關閉immediate,也可能是異常關閉abort),然後執行資料庫檔案刪除,再將冷備份拷貝到對應的資料庫目錄 rm -f /u01/app/oracle/oradata/PROD/disk1/system001.dbf rm -f /u01/app/oracle/oradata/PROD/disk1/undotbs01.dbf rm -f /u01/app/oracle/oradata/PROD/disk1/sysaux01.dbf rm -f /u01/app/oracle/oradata/PROD/disk1/example1.dbf rm -f /u01/app/oracle/oradata/PROD/disk1/indx1.dbf rm -f /u01/app/oracle/oradata/PROD/disk1/tools1.dbf rm -f /u01/app/oracle/oradata/PROD/disk1/users1.dbf rm -f /u01/app/oracle/oradata/PROD/disk1/oltp1.dbf rm -f /u01/app/oracle/oradata/PROD/disk1/tbs_tommie01.dbf rm -f /u01/app/oracle/oradata/PROD/disk1/redo101.log rm -f /u01/app/oracle/oradata/PROD/disk2/redo102.log rm -f /u01/app/oracle/oradata/PROD/disk3/redo103.log rm -f /u01/app/oracle/oradata/PROD/disk1/redo201.log rm -f /u01/app/oracle/oradata/PROD/disk2/redo202.log rm -f /u01/app/oracle/oradata/PROD/disk3/redo203.log rm -f /u01/app/oracle/oradata/PROD/disk1/redo301.log rm -f /u01/app/oracle/oradata/PROD/disk2/redo302.log rm -f /u01/app/oracle/oradata/PROD/disk3/redo303.log rm -f /u01/app/oracle/oradata/PROD/disk4/redo104.log rm -f /u01/app/oracle/oradata/PROD/disk4/redo204.log rm -f /u01/app/oracle/oradata/PROD/disk1/control01.ctl rm -f /u01/app/oracle/oradata/PROD/disk2/control02.ctl rm -f /u01/app/oracle/product/10.2.0/db_1/dbs/spfilePROD.ora
cp /home/oracle/coldbackup/20140125-1/system001.dbf /u01/app/oracle/oradata/PROD/disk1/system001.dbf cp /home/oracle/coldbackup/20140125-1/undotbs01.dbf /u01/app/oracle/oradata/PROD/disk1/undotbs01.dbf cp /home/oracle/coldbackup/20140125-1/sysaux01.dbf /u01/app/oracle/oradata/PROD/disk1/sysaux01.dbf cp /home/oracle/coldbackup/20140125-1/example1.dbf /u01/app/oracle/oradata/PROD/disk1/example1.dbf cp /home/oracle/coldbackup/20140125-1/indx1.dbf /u01/app/oracle/oradata/PROD/disk1/indx1.dbf cp /home/oracle/coldbackup/20140125-1/tools1.dbf /u01/app/oracle/oradata/PROD/disk1/tools1.dbf cp /home/oracle/coldbackup/20140125-1/users1.dbf /u01/app/oracle/oradata/PROD/disk1/users1.dbf cp /home/oracle/coldbackup/20140125-1/oltp1.dbf /u01/app/oracle/oradata/PROD/disk1/oltp1.dbf cp /home/oracle/coldbackup/20140125-1/tbs_tommie01.dbf /u01/app/oracle/oradata/PROD/disk1/tbs_tommie01.dbf cp /home/oracle/coldbackup/20140125-1/redo101.log /u01/app/oracle/oradata/PROD/disk1/redo101.log cp /home/oracle/coldbackup/20140125-1/redo102.log /u01/app/oracle/oradata/PROD/disk2/redo102.log cp /home/oracle/coldbackup/20140125-1/redo103.log /u01/app/oracle/oradata/PROD/disk3/redo103.log cp /home/oracle/coldbackup/20140125-1/redo201.log /u01/app/oracle/oradata/PROD/disk1/redo201.log cp /home/oracle/coldbackup/20140125-1/redo202.log /u01/app/oracle/oradata/PROD/disk2/redo202.log cp /home/oracle/coldbackup/20140125-1/redo203.log /u01/app/oracle/oradata/PROD/disk3/redo203.log cp /home/oracle/coldbackup/20140125-1/redo301.log /u01/app/oracle/oradata/PROD/disk1/redo301.log cp /home/oracle/coldbackup/20140125-1/redo302.log /u01/app/oracle/oradata/PROD/disk2/redo302.log cp /home/oracle/coldbackup/20140125-1/redo303.log /u01/app/oracle/oradata/PROD/disk3/redo303.log cp /home/oracle/coldbackup/20140125-1/redo104.log /u01/app/oracle/oradata/PROD/disk4/redo104.log cp /home/oracle/coldbackup/20140125-1/redo204.log /u01/app/oracle/oradata/PROD/disk4/redo204.log cp /home/oracle/coldbackup/20140125-1/control01.ctl /u01/app/oracle/oradata/PROD/disk1/control01.ctl cp /home/oracle/coldbackup/20140125-1/control02.ctl /u01/app/oracle/oradata/PROD/disk2/control02.ctl cp /home/oracle/coldbackup/20140125-1/spfilePROD.ora /u01/app/oracle/product/10.2.0/db_1/dbs/spfilePROD.ora 8. 拷貝完成後,啟動資料庫 startup up |
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26521853/viewspace-1083928/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 基於歸檔的冷備份恢復
- 冷備份+歸檔日誌的恢復
- 基於歸檔的熱備份完全恢復
- 備份&恢復之四:非歸檔模式下的備份與恢復模式
- 只有冷備和歸檔,能否恢復?
- 非歸檔無備份下控制檔案丟失的恢復
- rman 非歸檔模式下停庫備份與恢復模式
- 【備份恢復】非歸檔模式下丟失任意資料檔案 恢復操作模式
- 無備份恢復(歸檔模式)模式
- Oracle冷備份級冷備份的不完全恢復Oracle
- rman 非歸檔模式下open庫備份與mount恢復模式
- 備份與恢復--從備份的歸檔日誌中恢復資料
- 冷備份應用歸檔
- 【備份恢復】無備份線上恢復非關鍵資料檔案
- MySQL備份與恢復——基於Xtrabackup物理備份恢復MySql
- 使用冷備份與冷備份後的資料庫歸檔日誌檔案進行資料庫不完整恢復資料庫
- 恢復之非歸檔模式下資料庫非正常關閉的備份與恢復模式資料庫
- oracle冷備份、恢復和異機恢復Oracle
- dataguard 歸檔丟失,備庫基於SCN恢復
- 恢復之非歸檔模式下的恢復模式
- 用冷備份+歸檔日誌執行不完全恢復一例
- Oracle資料庫的冷備份及冷備份異地恢復方法Oracle資料庫
- ORACLE非歸檔下的恢復Oracle
- 無檔案備份、擁有所有歸檔的恢復
- 【備份恢復】恢復 丟失已歸檔重做日誌檔案
- 物理冷備份與恢復的操作命令
- RMAN基於備份控制檔案恢復失敗
- rman恢復--歸檔模式有備份,丟失資料檔案的恢復模式
- rman恢復--歸檔模式無備份,丟失資料檔案的恢復模式
- Rman Crosscheck刪除失效歸檔-備份恢復ROS
- MySQL備份與恢復——基於MyDumper/MyLoader 邏輯備份恢復MySql
- 【管理篇備份恢復】備份恢復基礎
- RMAN備份、恢復實驗室 之 備份篇 【歸檔模式】模式
- 備份與恢復--利用備份的控制檔案恢復
- 歸檔模式,恢復沒有備份的資料檔案模式
- Oracle使用備份檔案集恢復歸檔日誌Oracle
- MySQL備份與恢復——基於OUTFILE /LOAD DATA 邏輯備份恢復MySql
- RMAN備份及恢復歸檔日誌的語法