Oracle用指令碼執行備份

zhenghaishu發表於2015-06-15

1 編寫指令碼/home/oracle/backup.rman

RUN {

 CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 30 DAYS;

 CONFIGURE CONTROLFILE AUTOBACKUP ON;

 CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/app/oracle/backup/%F';

 ALLOCATE CHANNEL C1 DEVICE TYPE DISK FORMAT '/u01/app/oracle/backup/bak_%T_%U';

 BACKUP DATABASE SKIP INACCESSIBLE

   PLUS ARCHIVELOG FILESPERSET 20

   DELETE ALL INPUT;

 RELEASE CHANNEL C1;

 }

 ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE DISK;

 CROSSCHECK BACKUPSET;

 DELETE NOPROMPT OBSOLETE;

 

2 RMAN環境中執行指令碼

RMAN> @/home/oracle/backup.rman

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

相關文章