oracle的備份與恢複的批處理

來源:互聯網
上載者:User

================備份=================================
rman target /  cmdfile=/oracle/shell/cfg/bakDB.rcv trace /oracle/shell/logs/bakfull.log &

CONFIGURE DEVICE TYPE DISK PARALLELISM 8;
CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT   '/rman01/bak_ful/dbf_%T_%s_%p' MAXPIECESIZE 8 G;
CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT   '/rman02/bak_ful/dbf_%T_%s_%p' MAXPIECESIZE 8 G;
CONFIGURE CHANNEL 3 DEVICE TYPE DISK FORMAT   '/rman03/bak_ful/dbf_%T_%s_%p' MAXPIECESIZE 8 G;
CONFIGURE CHANNEL 4 DEVICE TYPE DISK FORMAT   '/rman04/bak_ful/dbf_%T_%s_%p' MAXPIECESIZE 8 G;
CONFIGURE CHANNEL 5 DEVICE TYPE DISK FORMAT   '/rman05/bak_ful/dbf_%T_%s_%p' MAXPIECESIZE 8 G;
CONFIGURE CHANNEL 6 DEVICE TYPE DISK FORMAT   '/rman06/bak_ful/dbf_%T_%s_%p' MAXPIECESIZE 8 G;
CONFIGURE CHANNEL 7 DEVICE TYPE DISK FORMAT   '/rman07/bak_ful/dbf_%T_%s_%p' MAXPIECESIZE 8 G;
CONFIGURE CHANNEL 8 DEVICE TYPE DISK FORMAT   '/rman08/bak_ful/dbf_%T_%s_%p' MAXPIECESIZE 8 G;
run
{
sql "Alter System Archive Log Current";
BACKUP FILESPERSET=32 DATABASE plus archivelog format '/rman02/arch_%d_%T_%s';
sql "alter database backup controlfile to ''/rman01/controlfile/copy_current_controlfile'' reuse";
}
=================恢複================================
rman target / nocatalog cmdfile=./restoreDB.rcv trace ./restoreDB.log &

------------------restoreDB.rcv----------------------------------------------
STARTUP NOMOUNT;
SET DBID 3658411712;    # required when restoring control file in NOCATALOG mode
run
{
CONFIGURE DEVICE TYPE DISK PARALLELISM 8;
CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT   '/rman01/bak_ful/dbf_%T_%s_%p' MAXPIECESIZE 8 G;
CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT   '/rman02/bak_ful/dbf_%T_%s_%p' MAXPIECESIZE 8 G;
CONFIGURE CHANNEL 3 DEVICE TYPE DISK FORMAT   '/rman03/bak_ful/dbf_%T_%s_%p' MAXPIECESIZE 8 G;
CONFIGURE CHANNEL 4 DEVICE TYPE DISK FORMAT   '/rman04/bak_ful/dbf_%T_%s_%p' MAXPIECESIZE 8 G;
CONFIGURE CHANNEL 5 DEVICE TYPE DISK FORMAT   '/rman05/bak_ful/dbf_%T_%s_%p' MAXPIECESIZE 8 G;
CONFIGURE CHANNEL 6 DEVICE TYPE DISK FORMAT   '/rman06/bak_ful/dbf_%T_%s_%p' MAXPIECESIZE 8 G;
CONFIGURE CHANNEL 7 DEVICE TYPE DISK FORMAT   '/rman07/bak_ful/dbf_%T_%s_%p' MAXPIECESIZE 8 G;
CONFIGURE CHANNEL 8 DEVICE TYPE DISK FORMAT   '/rman08/bak_ful/dbf_%T_%s_%p' MAXPIECESIZE 8 G;
restore controlfile from '/rman01/controlfile/copy_current_controlfile';
alter database mount;
RESTORE DATABASE;
recover database until cancel;
}

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.