主庫模型調整需要做一個全庫備份,備份與恢復指令碼

shilei1發表於2011-08-20
主庫模型調整需要做一個全庫備份,備份與恢復指令碼如下:
一、備份指令碼:
jldcdb01:/home/oracle$ rman target /

Recovery Manager: Release 10.2.0.4.0 - Production on Fri Aug 19 16:49:09 2011

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database: DCMDS01 (DBID=410194126)

RMAN> run{
2> ALLOCATE CHANNEL CH1 DEVICE TYPE DISK FORMAT '/orabk/rman/full_%T_%s_%p';
3> ALLOCATE CHANNEL CH2 DEVICE TYPE DISK FORMAT '/orabk/rman/full_%T_%s_%p';
BACKUP DATABASE SKIP INACCESSIBLE FILESPERSET 10
   INCLUDE CURRENT CONTROLFILE
4> 5> 6>    PLUS ARCHIVELOG FILESPERSET 20
7>    DELETE ALL INPUT;
8> RELEASE CHANNEL CH1;
9> RELEASE CHANNEL CH2;
10> }


二、恢復指令碼如下:
1、
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/orabk/rman/full_%T_%s_%p';b  #配置到目標備份集位置的通道

2、恢復指令碼
run
{
startup force mount;
set until time "to_date('2011-08-19 16:49:09','YYYY-MM-DD hh24:mi:ss')";
restore database;
recover database;
sql 'alter database open resetlogs';
 }

3、CONFIGURE CHANNEL DEVICE TYPE DISK clear; #恢復正常的備份集目擊地

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/196700/viewspace-705451/,如需轉載,請註明出處,否則將追究法律責任。

相關文章