rman backup script(引用)
某Oracle真實RMAN備份指令碼和策略分享:
【自動作業 crontab 內容】
#* * * * * /oradata3/oracle/rman/rman1
#10 10 03 * * /oradata3/oracle/rman/rman0
#20 10 * * 6 /oradata3/oracle/rman/rman1
20 10 * * 6 /oradata3/oracle/rman/rman0bak
#00 01 * * 0,1,2,3,4,5 /oradata3/oracle/rman/rman2
【各指令碼】
more /oradata3/oracle/rman/rman1
rman target / log=/oradata4/oracle/rman/$(date +%y%m%d%H%M)backup1.log <
delete noprompt obsolete;
run
{
allocate channel d1 device type disk;
backup incremental level 1
format '/oradata4/oracle/rman/%d_%s_%p.bak_1'
(database include current controlfile filesperset=2 );
sql 'alter system archive log current';
backup archivelog all format '/oradata4/oracle/rman/arc_%s_%p.bk_1' delete all input;
}
EOF
more /oradata3/oracle/rman/rman0
rman target / log=/oradata3/oracle/rman/$(date +%y%m%d%H%M)backup0.log <
run
{
backup incremental level 0
format '/oradata3/oracle/rman/%d_%s_%p.bak_0'
(database include current controlfile filesperset=2 );
sql 'alter system archive log current';
backup archivelog all format '/oradata3/oracle/rman/arc_%s_%p.bk_0' delete all input;
}
delete noprompt obsolete;
EOF
exit
more /oradata3/oracle/rman/rman1
rman target / log=/oradata4/oracle/rman/$(date +%y%m%d%H%M)backup1.log <
delete noprompt obsolete;
run
{
allocate channel d1 device type disk;
backup incremental level 1
format '/oradata4/oracle/rman/%d_%s_%p.bak_1'
(database include current controlfile filesperset=2 );
sql 'alter system archive log current';
backup archivelog all format '/oradata4/oracle/rman/arc_%s_%p.bk_1' delete all input;
}
EOF
exit
more /oradata3/oracle/rman/rman0bak
rman target / log=/oradata3/oracle/rman/$$(date +%y%m%d%H%M)backup0.log <
run
{
backup incremental level 0 database filesperset=3;
sql 'alter system switch logfile';
backup archivelog all delete all input;
delete noprompt obsolete;
}
EOF
exit
more /oradata3/oracle/rman/rman2
rman target / log=/oradata3/oracle/rman/$(date +%y%m%d%H%M)backup2.log <
delete noprompt obsolete;
run
{
allocate channel d1 device type disk;
backup incremental level 2 tag 'db_2'
format '/oradata3/oracle/rman/%d_%s_%p.bak_2'
(database include current controlfile filesperset=2 );
sql 'alter system archive log current';
backup archivelog all format '/oradata3/oracle/rman/arc_%s_%p.bk_2' delete all input;
}
EOF
exit
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/oradata3/orabak/rman/%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 4 BACKUP TYPE TO COMPRESSED BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT '/oradata3/orabak2/rman/%d_%T%t%p';
CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT '/oradata3/orabak1/rman/%d_%T%t%p';
CONFIGURE CHANNEL 3 DEVICE TYPE DISK FORMAT '/oradata5/oracle/rman1/%d_%T%t%p';
CONFIGURE CHANNEL 4 DEVICE TYPE DISK FORMAT '/oradata5/oracle/rman2/%d_%T%t%p';
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/opt/oracle/oracle/product/10.2.0/db_1/dbs/snapcf_bix.f'; # default
【自動作業 crontab 內容】
#* * * * * /oradata3/oracle/rman/rman1
#10 10 03 * * /oradata3/oracle/rman/rman0
#20 10 * * 6 /oradata3/oracle/rman/rman1
20 10 * * 6 /oradata3/oracle/rman/rman0bak
#00 01 * * 0,1,2,3,4,5 /oradata3/oracle/rman/rman2
【各指令碼】
more /oradata3/oracle/rman/rman1
rman target / log=/oradata4/oracle/rman/$(date +%y%m%d%H%M)backup1.log <
run
{
allocate channel d1 device type disk;
backup incremental level 1
format '/oradata4/oracle/rman/%d_%s_%p.bak_1'
(database include current controlfile filesperset=2 );
sql 'alter system archive log current';
backup archivelog all format '/oradata4/oracle/rman/arc_%s_%p.bk_1' delete all input;
}
EOF
more /oradata3/oracle/rman/rman0
rman target / log=/oradata3/oracle/rman/$(date +%y%m%d%H%M)backup0.log <
{
backup incremental level 0
format '/oradata3/oracle/rman/%d_%s_%p.bak_0'
(database include current controlfile filesperset=2 );
sql 'alter system archive log current';
backup archivelog all format '/oradata3/oracle/rman/arc_%s_%p.bk_0' delete all input;
}
delete noprompt obsolete;
EOF
exit
more /oradata3/oracle/rman/rman1
rman target / log=/oradata4/oracle/rman/$(date +%y%m%d%H%M)backup1.log <
run
{
allocate channel d1 device type disk;
backup incremental level 1
format '/oradata4/oracle/rman/%d_%s_%p.bak_1'
(database include current controlfile filesperset=2 );
sql 'alter system archive log current';
backup archivelog all format '/oradata4/oracle/rman/arc_%s_%p.bk_1' delete all input;
}
EOF
exit
more /oradata3/oracle/rman/rman0bak
rman target / log=/oradata3/oracle/rman/$$(date +%y%m%d%H%M)backup0.log <
{
backup incremental level 0 database filesperset=3;
sql 'alter system switch logfile';
backup archivelog all delete all input;
delete noprompt obsolete;
}
EOF
exit
more /oradata3/oracle/rman/rman2
rman target / log=/oradata3/oracle/rman/$(date +%y%m%d%H%M)backup2.log <
run
{
allocate channel d1 device type disk;
backup incremental level 2 tag 'db_2'
format '/oradata3/oracle/rman/%d_%s_%p.bak_2'
(database include current controlfile filesperset=2 );
sql 'alter system archive log current';
backup archivelog all format '/oradata3/oracle/rman/arc_%s_%p.bk_2' delete all input;
}
EOF
exit
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/oradata3/orabak/rman/%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 4 BACKUP TYPE TO COMPRESSED BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT '/oradata3/orabak2/rman/%d_%T%t%p';
CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT '/oradata3/orabak1/rman/%d_%T%t%p';
CONFIGURE CHANNEL 3 DEVICE TYPE DISK FORMAT '/oradata5/oracle/rman1/%d_%T%t%p';
CONFIGURE CHANNEL 4 DEVICE TYPE DISK FORMAT '/oradata5/oracle/rman2/%d_%T%t%p';
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/opt/oracle/oracle/product/10.2.0/db_1/dbs/snapcf_bix.f'; # default
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-732102/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle 11g rman backup scriptOracle
- RMAN Backup Shell Script Example (Doc ID 137181.1)
- Cold backup script
- Cold Database backup scriptDatabase
- Rman backup standby databaseDatabase
- DP rman backup scripts
- rman 0.1.2 備份 script
- Oracle 學習(Rman Backup)Oracle
- rman backup database force 功能Database
- V$RMAN_BACKUP_JOB_DETAILSAI
- RMAN cumulative and differential incremental backupREM
- How to use rman backup a noarchivelog databaseHiveDatabase
- 轉貼_RMAN-DBMS_BACKUP_RESTOREREST
- 【RMAN】Run Allocate Channel For Maintenance From Script FailsAINaN
- RMAN - backup archivelog all 與 backup database plus archivelog 區別HiveDatabase
- 理解RMAN backup database plus archivelog命令DatabaseHive
- NBU report error 6 when RMAN backupError
- RMAN : Consistent Backup, Restore and Recovery using RMAN (Doc ID 162855.1)REST
- Using V$BACKUP_ASYNC_IO / V$BACKUP_SYNC_IO to Monitor RMAN PerformanceORM
- How to restore and recover a database from an RMAN backup_881395.1RESTDatabase
- rman backup ENCRYPTION(備份加密特性)測試!加密
- RMAN backup validate database on databases in noarchivelog modeDatabaseHive
- rman backup as copy database format '/tmp/%U.dbf'DatabaseORM
- Backup And Recovery User's Guide-RMAN架構-RMAN庫(Repository)GUIIDE架構
- RMAN backup fails with Ora-00245 And Rman-08132 [ID 1365484.1]AI
- Backup And Recovery User's Guide-RMAN架構-關於RMAN環境GUIIDE架構
- Rman Backup Failed With Error Rman-00600 [8201] (Doc ID 412786.1)AIError
- Using RMAN REPORT NEED BACKUP with Different Retention Policies
- 使用RMAN backup和restore方式部署物理備庫REST
- Windows2003 + NFS For RMAN Backup standbydbWindowsNFS
- zt:Different type of RMAN backup compression in 11G
- Backup And Recovery User's Guide-RMAN架構-RMAN命令列客戶端及RMAN通道(channel)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環境GUIIDE
- 關於System.Web.Script.Serialization名稱空間的引用Web
- 理解RMAN backup database plus archivelog delete all input命令DatabaseHivedelete
- RMAN-06100: no channel to restore a backup or copy of datafileREST