Backup And Recovery User's Guide-從RMAN開始-指令碼化RMAN操作
RMAN支援使用命令檔案來管理迴圈的任務,例如每週的備份。
命令檔案是一個包含RMAN命令的客戶端文字檔案,和你在RMAN提示符下輸入的命令完全一致。
命令檔案可以使用任何副檔名。RUN命令在指令碼中提供了一種流控制等級。
練習:建立並執行命令檔案
--練習:建立並執行命令檔案 --1. 建立RMAN命令檔案/home/oracle/CommandFile.txt,內容如下 CONNECT TARGET / BACKUP DATABASE PLUS ARCHIVELOG; LIST BACKUP; EXIT;
--2. 啟動RMAN之後執行命令檔案,或在啟動時直接指定要執行的命令檔案(rman @CommandFile.txt) oracle@Redhat55.cuug.net:/home/oracle> rman
Recovery Manager: Release 11.2.0.3.0 - Production on Sat Jul 6 20:21:20 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
RMAN> @CommandFile.txt --2.1 連線 RMAN> CONNECT TARGET * connected to target database: TESTDB12 (DBID=2811829300) --2.2 備份 RMAN> BACKUP DATABASE PLUS ARCHIVELOG;
Starting backup at 06-JUL-13 current log archived using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=44 device type=DISK channel ORA_DISK_1: starting archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=9 RECID=1 STAMP=820095695 channel ORA_DISK_1: starting piece 1 at 06-JUL-13 channel ORA_DISK_1: finished piece 1 at 06-JUL-13 piece handle=/u01/app/oracle/fast_recovery_area/TESTDB12/backupset/2013_07_06/o1_mf_annnn_TAG20130706T202136_8xkf4jno_.bkp tag=TAG20130706T202136 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 06-JUL-13
Starting backup at 06-JUL-13 using channel ORA_DISK_1 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00001 name=/u01/app/oracle/oradata/TestDB12/system01.dbf input datafile file number=00002 name=/u01/app/oracle/oradata/TestDB12/sysaux01.dbf input datafile file number=00005 name=/u01/app/oracle/oradata/TestDB12/example01.dbf input datafile file number=00003 name=/u01/app/oracle/oradata/TestDB12/undotbs01.dbf input datafile file number=00004 name=/u01/app/oracle/oradata/TestDB12/users01.dbf channel ORA_DISK_1: starting piece 1 at 06-JUL-13 channel ORA_DISK_1: finished piece 1 at 06-JUL-13 piece handle=/u01/app/oracle/fast_recovery_area/TESTDB12/backupset/2013_07_06/o1_mf_nnndf_TAG20130706T202137_8xkf4l36_.bkp tag=TAG20130706T202137 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:03:56 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set including current control file in backup set including current SPFILE in backup set channel ORA_DISK_1: starting piece 1 at 06-JUL-13 channel ORA_DISK_1: finished piece 1 at 06-JUL-13 piece handle=/u01/app/oracle/fast_recovery_area/TESTDB12/backupset/2013_07_06/o1_mf_ncsnf_TAG20130706T202137_8xkfd4fb_.bkp tag=TAG20130706T202137 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 06-JUL-13
Starting backup at 06-JUL-13 current log archived using channel ORA_DISK_1 channel ORA_DISK_1: starting archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=10 RECID=2 STAMP=820095941 channel ORA_DISK_1: starting piece 1 at 06-JUL-13 channel ORA_DISK_1: finished piece 1 at 06-JUL-13 piece handle=/u01/app/oracle/fast_recovery_area/TESTDB12/backupset/2013_07_06/o1_mf_annnn_TAG20130706T202541_8xkfd5tj_.bkp tag=TAG20130706T202541 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 06-JUL-13
RMAN> LIST BACKUP;
List of Backup Sets ===================
BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 1 Full 1.08G DISK 00:01:49 06-JUL-13 BP Key: 1 &n |
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17013648/viewspace-1080535/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Backup And Recovery User's Guide-從RMAN開始-概覽RMAN環境GUIIDE
- Backup And Recovery User's Guide-從RMAN開始-RMAN操作報表-列表顯示備份GUIIDE
- Backup And Recovery User's Guide-從RMAN開始-顯示預設的RMAN配置GUIIDE
- Backup And Recovery User's Guide-從RMAN開始-恢復表空間GUIIDE
- Backup And Recovery User's Guide-從RMAN開始-備份資料庫GUIIDE資料庫
- Backup And Recovery User's Guide-從RMAN開始-開始使用RMAN並連線到資料庫GUIIDE資料庫
- Backup And Recovery User's Guide-從RMAN開始-恢復整個資料庫GUIIDE資料庫
- Backup And Recovery User's Guide-從RMAN開始-RMAN操作報表-資料庫檔案和備份報告GUIIDE資料庫
- Backup And Recovery User's Guide-從RMAN開始-維護RMAN備份-cross-checking備份GUIIDEROS
- Backup And Recovery User's Guide-從RMAN開始-恢復單個的資料塊GUIIDE
- Backup And Recovery User's Guide-從RMAN開始-備份資料庫-增量備份GUIIDE資料庫
- Backup And Recovery User's Guide-從RMAN開始-維護RMAN備份-刪除過期的備份GUIIDE
- Backup And Recovery User's Guide-從RMAN開始-還原和恢復資料庫檔案GUIIDE資料庫
- Backup And Recovery User's Guide-從RMAN開始-驗證資料庫檔案和備份GUIIDE資料庫
- Backup And Recovery User's Guide-從RMAN開始-使用閃回資料庫來回退資料庫GUIIDE資料庫
- Backup And Recovery User's Guide-從RMAN開始-練習:對資料庫進行增量備份GUIIDE資料庫
- Backup And Recovery User's Guide-從RMAN開始-備份資料庫-典型的備份選項GUIIDE資料庫
- Backup And Recovery User's Guide-從RMAN開始-備份處於非歸檔模式的資料庫GUIIDE模式資料庫
- Backup And Recovery User's Guide-備份RMAN備份-使用RMAN備份備份集GUIIDE
- Backup And Recovery User's Guide-從RMAN開始-使用資料恢復指導診斷和修復錯誤GUIIDE資料恢復
- Backup And Recovery User's Guide-使用RMAN備份歸檔重做日誌GUIIDE
- Backup And Recovery User's Guide-執行完全自動的RMAN TSPITRGUIIDE
- Backup And Recovery User's Guide-RMAN資料修復概念-RMAN還原操作GUIIDE
- Backup And Recovery User's Guide-備份RMAN備份-用RMAN備份映象拷貝備份GUIIDE
- Backup And Recovery User's Guide-RMAN架構-RMAN庫(Repository)GUIIDE架構
- Backup And Recovery User's Guide-RMAN資料修復概念-RMAN還原操作-還原優化GUIIDE優化
- Backup And Recovery User's Guide-從RMAN開始-備份資料庫-備份處於歸檔模式的資料庫GUIIDE資料庫模式
- Backup And Recovery User's Guide-RMAN TSPITR模型GUIIDE模型
- Backup And Recovery User's Guide-備份資料庫-RMAN備份概覽-RMAN備份的目的GUIIDE資料庫
- Backup And Recovery User's Guide-RMAN架構-關於RMAN環境GUIIDE架構
- Backup And Recovery User's Guide-備份資料庫-RMAN備份概覽-為RMAN備份指定TAGGUIIDE資料庫
- Backup And Recovery User's Guide-RMAN架構-RMAN通道-通道和裝置GUIIDE架構
- Backup And Recovery User's Guide-備份RMAN備份-備份集的多重拷貝GUIIDE
- Backup And Recovery User's Guide-備份RMAN備份-關於備份的備份GUIIDE
- Backup And Recovery User's Guide-備份資料庫-使用RMAN備份控制檔案GUIIDE資料庫
- Backup And Recovery User's Guide-執行RMAN表空間時間點恢復(TSPIRT)GUIIDE
- Backup And Recovery User's Guide-備份資料庫-RMAN備份概覽-為RMAN備份指定格式GUIIDE資料庫
- Backup And Recovery User's Guide-RMAN資料修復概念-RMAN還原操作-還原failoverGUIIDEAI