Oracle之RMAN資料庫在非歸檔模式下的備份和恢複

來源:互聯網
上載者:User

Oracle之RMAN資料庫在非歸檔模式下的備份和恢複

1.資料庫在非歸檔模式下的備份

SQL> archive log list;
資料庫記錄模式 非存檔模式
自動封存 禁用
存檔終點 USE_DB_RECOVERY_FILE_DEST
最早的聯機日誌序列 3244
當前日誌序列 3246

RMAN> run
2> {
3> allocate channel t1 type disk;
4> backup database format 'E:\rman_bak\20111103\df_%t_%s_%p.bak';
5> }

使用目標資料庫控制檔案替代恢複目錄
分配的通道: t1
通道 t1: SID=14 裝置類型=DISK

啟動 backup 於 03-11月-11
通道 t1: 正在啟動全部資料檔案備份組
通道 t1: 正在指定備份組內的資料檔案
RMAN-03009: backup 命令 (t1 通道上, 在 11/03/2011 10:21:43 上) 失敗
ORA-19602: 無法按 NOARCHIVELOG 模式備份或複製活動檔案
繼續執行其他作業步驟, 將不重新運行失敗的作業
通道 t1: 正在啟動全部資料檔案備份組
通道 t1: 正在指定備份組內的資料檔案
備份組內包括當前控制檔案
備份組內包括當前的 SPFILE
通道 t1: 正在啟動段 1 於 03-11月-11
通道 t1: 已完成段 1 於 03-11月-11
段控制代碼=E:\RMAN_BAK\20111103\DF_766232503_2_1.BAK 標記=TAG20111103T102143 注釋=NONE
通道 t1: 備份組已完成, 經過時間:00:00:01
釋放的通道: t1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================

RMAN-03009: backup 命令 (t1 通道上, 在 11/03/2011 10:21:43 上) 失敗
ORA-19602: 無法按 NOARCHIVELOG 模式備份或複製活動檔案


RMAN> shutdown immediate

資料庫已關閉
資料庫已卸裝
Oracle 執行個體已關閉

RMAN> startup mount

已串連到目標資料庫 (未啟動)
Oracle 執行個體已啟動
資料庫已裝載

系統全域地區總計 535662592 位元組

Fixed Size 1375792 位元組
Variable Size 411042256 位元組
Database Buffers 117440512 位元組
Redo Buffers 5804032 位元組

RMAN> run
2> {
3> allocate channel t1 type disk;
4> backup database format 'E:\rman_bak\20111103\df_%t_%s_%p.bak';
5> }

分配的通道: t1
通道 t1: SID=133 裝置類型=DISK

啟動 backup 於 03-11月-11
通道 t1: 正在啟動全部資料檔案備份組
通道 t1: 正在指定備份組內的資料檔案
輸入資料檔案: 檔案號=00004 名稱=D:\ORACLE\ORADATA\ORCL\USERS01.DBF
輸入資料檔案: 檔案號=00001 名稱=D:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF
輸入資料檔案: 檔案號=00005 名稱=D:\ORACLE\ORADATA\ORCL\TEST01.DBF
輸入資料檔案: 檔案號=00006 名稱=D:\ORACLE\ORADATA\ORCL\UNDOTBS02.DBF
輸入資料檔案: 檔案號=00002 名稱=D:\ORACLE\ORADATA\ORCL\SYSAUX01.DBF
通道 t1: 正在啟動段 1 於 03-11月-11
通道 t1: 已完成段 1 於 03-11月-11
段控制代碼=E:\RMAN_BAK\20111103\DF_766232799_3_1.BAK 標記=TAG20111103T102639 注釋=NONE
通道 t1: 備份組已完成, 經過時間:00:01:55
通道 t1: 正在啟動全部資料檔案備份組
通道 t1: 正在指定備份組內的資料檔案
備份組內包括當前控制檔案
備份組內包括當前的 SPFILE
通道 t1: 正在啟動段 1 於 03-11月-11
通道 t1: 已完成段 1 於 03-11月-11
段控制代碼=E:\RMAN_BAK\20111103\DF_766232915_4_1.BAK 標記=TAG20111103T102639 注釋=NONE
通道 t1: 備份組已完成, 經過時間:00:00:01
完成 backup 於 03-11月-11
釋放的通道: t1

2.非歸檔模式資料庫恢複

RMAN> shutdown immediate

database closed
database dismounted
Oracle instance shut down

RMAN> startup mount

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area 535662592 bytes

Fixed Size 1375792 bytes
Variable Size 411042256 bytes
Database Buffers 117440512 bytes
Redo Buffers 5804032 bytes

RMAN> restore database;

Starting restore at 03-NOV-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=133 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to D:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF
channel ORA_DISK_1: restoring datafile 00002 to D:\ORACLE\ORADATA\ORCL\SYSAUX01.DBF
channel ORA_DISK_1: restoring datafile 00004 to D:\ORACLE\ORADATA\ORCL\USERS01.DBF
channel ORA_DISK_1: restoring datafile 00005 to D:\ORACLE\ORADATA\ORCL\TEST01.DBF channel ORA_DISK_1: restoring datafile 00006 to D:\ORACLE\ORADATA\ORCL\UNDOTBS02.DBF
channel ORA_DISK_1: reading from backup piece E:\RMAN_BAK\20111103\DF_766235030_5_1.BAK
channel ORA_DISK_1: piece handle=E:\RMAN_BAK\20111103\DF_766235030_5_1.BAK tag=TAG20111103T110349
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:02:35
Finished restore at 03-NOV-11

RMAN> alter database open;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 11/03/2011 14:10:03
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: 'D:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF'

RMAN> recover database;

Starting recover at 03-NOV-11
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 3246 is already on disk as file D:\ORACLE\ORADATA\ORCL\REDO03.LOG archived log for thread 1 with sequence 3247 is already on disk as file D:\ORACLE\ORADATA\ORCL\REDO01.LOG
archived log file name=D:\ORACLE\ORADATA\ORCL\REDO03.LOG thread=1 sequence=3246
archived log file name=D:\ORACLE\ORADATA\ORCL\REDO01.LOG thread=1 sequence=3247
media recovery complete, elapsed time: 00:00:09
Finished recover at 03-NOV-11

RMAN> alter database open;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 11/03/2011 14:10:30
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

RMAN> alter database open resetlogs;

database opened

--------------------------------------推薦閱讀 --------------------------------------

RMAN 配置歸檔日誌刪除策略

Oracle基礎教程之通過RMAN複製資料庫

RMAN備份策略制定參考內容

RMAN備份學習筆記

OracleDatabase Backup加密 RMAN加密

--------------------------------------分割線 --------------------------------------

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.