資料庫全備份指令碼
1.資料庫全備份指令碼
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
backup full tag 'nb' format '/opt/app/orabak/nb_full_%u_%s_%p' database include current controlfile;
sql 'alter system archive log current';
backup tag 'nb' filesperset 3 format '/opt/app/orabak/nb_arch_%u_%s_%p' archivelog all delete input;
release channel c1;
release channel c2;
release channel c3;
}
delete archivelog until time 'sysdate- 7' backed up 2 times to disk;
或
run{
allocate channel db01 type disk ;
allocate channel db02 type disk ;
backup(database
include current controlfile
filesperset=2
format '/opt/app/orabak/nb_full_%u_%s_%p'
tag="nb");
backup(archivelog all
format '/opt/app/orabak/nb_arch_%u_%s_%p'
tag="nb");
release channel db01;
release channel db02;
}
delete archivelog until time 'sysdate- 7' backed up 2 times to disk;
或
run{
configure device type disk parallelism 2;
backup(database
include current controlfile
filesperset=2
format '/opt/app/orabak/nb_full_%u_%s_%p'
tag="nb");
backup(archivelog all
filesperset=10
format '/opt/app/orabak/nb_arch_%u_%s_%p'
tag="nb");
}
delete archivelog until time 'sysdate- 7' backed up 2 times to disk;
2.資料庫零級備份指令碼
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
backup incremental level 0 tag 'nb0' format '/opt/app/orabak/nb_full_%u_%s_%p' database skip readonly;
sql 'alter system archive log current';
backup tag 'nb0' filesperset 3 format '/opt/app/orabak/nb_arch_%u_%s_%p' archivelog all delete input;
release channel c1;
release channel c2;
release channel c3;
}
delete archivelog until time 'sysdate- 7' backed up 2 times to disk;
或
run{
allocate channel db01 type disk ;
allocate channel db02 type disk ;
backup incremental level = 0
(database
include current controlfile
filesperset=2
format '/opt/app/orabak/nb_full_%u_%s_%p'
tag="nb0");
backup(archivelog all
format '/opt/app/orabak/nb_arch_%u_%s_%p'
tag="nb0");
release channel db01;
release channel db02;
}
delete archivelog until time 'sysdate- 7' backed up 2 times to disk;
或
run{
configure device type disk parallelism 2;
backup incremental level = 0
(database
include current controlfile
filesperset=2
format '/opt/app/orabak/nb_full_%u_%s_%p'
tag="nb0");
backup(archivelog all
filesperset=10
format '/opt/app/orabak/nb_arch_%u_%s_%p'
tag="nb0");
}
delete archivelog until time 'sysdate- 7' backed up 2 times to disk;
3.資料庫一級備份指令碼
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
backup incremental level 1 tag 'nb1' format '/opt/app/orabak/nb_full_%u_%s_%p' database skip readonly;
sql 'alter system archive log current';
backup tag 'nb1' filesperset 3 format '/opt/app/orabak/nb_arch_%u_%s_%p' archivelog all delete input;
release channel c1;
release channel c2;
release channel c3;
}
delete archivelog until time 'sysdate- 7' backed up 2 times to disk;
或
run{
allocate channel db01 type disk ;
allocate channel db02 type disk ;
backup incremental level = 1
(database
include current controlfile
filesperset=2
format '/opt/app/orabak/nb_full_%u_%s_%p'
tag="nb1");
backup(archivelog all
format '/opt/app/orabak/nb_arch_%u_%s_%p'
tag="nb1");
release channel db01;
release channel db02;
}
delete archivelog until time 'sysdate- 7' backed up 2 times to disk;
或
run{
configure device type disk parallelism 2;
backup incremental level = 1
(database
include current controlfile
filesperset=2
format '/opt/app/orabak/nb_full_%u_%s_%p'
tag="nb1");
backup(archivelog all
filesperset=10
format '/opt/app/orabak/nb_arch_%u_%s_%p'
tag="nb1");
}
delete archivelog until time 'sysdate- 7' backed up 2 times to disk;
4.資料庫二級備份指令碼
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
backup incremental level 2 tag 'nb2' format '/opt/app/orabak/nb_full_%u_%s_%p' database skip readonly;
sql 'alter system archive log current';
backup tag 'nb2' filesperset 3 format '/opt/app/orabak/nb_arch_%u_%s_%p' archivelog all delete input;
release channel c1;
release channel c2;
release channel c3;
}
delete archivelog until time 'sysdate- 7' backed up 2 times to disk;
或
run{
allocate channel db01 type disk ;
allocate channel db02 type disk ;
backup incremental level = 2
(database
include current controlfile
filesperset=2
format '/opt/app/orabak/nb_full_%u_%s_%p'
tag="nb2");
backup(archivelog all
format '/opt/app/orabak/nb_arch_%u_%s_%p'
tag="nb2");
release channel db01;
release channel db02;
}
delete archivelog until time 'sysdate- 7' backed up 2 times to disk;
或
run{
configure device type disk parallelism 2;
backup incremental level = 2
(database
include current controlfile
filesperset=2
format '/opt/app/orabak/nb_full_%u_%s_%p'
tag="nb2");
backup(archivelog all
filesperset=10
format '/opt/app/orabak/nb_arch_%u_%s_%p'
tag="nb2");
}
delete archivelog until time 'sysdate- 7' backed up 2 times to disk;
或
run{
configure device type disk parallelism 2;
backup incremental level = 2 cumulative
(database
include current controlfile
filesperset=2
format '/opt/app/orabak/nb_full_%u_%s_%p'
tag="nb2");
backup(archivelog all
filesperset=10
format '/opt/app/orabak/nb_arch_%u_%s_%p'
tag="nb2");
}
delete archivelog until time 'sysdate- 7' backed up 2 times to disk;
案例如下:
su - oracle <
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
backup full tag 'nb' format '/opt/app/orabak/nb_full_%u_%s_%p' database include current controlfile;
sql 'alter system archive log current';
backup tag 'nb' filesperset 3 format '/opt/app/orabak/nb_arch_%u_%s_%p' archivelog all delete input;
release channel c1;
release channel c2;
release channel c3;
}
delete archivelog until time 'sysdate- 7' backed up 2 times to disk;
exit
EOF1
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25850100/viewspace-704111/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 資料庫備份指令碼資料庫指令碼
- MySQL資料庫備份的shell指令碼MySql資料庫指令碼
- oracle資料庫使用rman備份指令碼Oracle資料庫指令碼
- Liunx備份mysql資料庫的shell指令碼MySql資料庫指令碼
- SQL Server2019資料庫備份與還原指令碼,資料庫可批量備份SQLServer資料庫指令碼
- 使用shell 指令碼備份資料指令碼
- Shell多執行緒備份資料庫的指令碼執行緒資料庫指令碼
- Mysqldump備份說明及資料庫備份指令碼分享-運維筆記MySql資料庫指令碼運維筆記
- KOSQL Server2019資料庫備份與還原指令碼(批量備份)zrbSQLServer資料庫指令碼
- Mysql定時備份資料指令碼MySql指令碼
- BMMySQL定時備份資料庫(全庫備份)的實現meuMySql資料庫
- 自動定時備份 mysql 資料庫 的 shell 指令碼MySql資料庫指令碼
- MOGDB/openGauss資料庫gs_dump備份指令碼及清理資料庫指令碼
- [SQLServer]NetCore中將SQLServer資料庫備份為Sql指令碼SQLServerNetCore資料庫指令碼
- windows 全量+增量備份指令碼batWindows指令碼BAT
- 備份指令碼指令碼
- MySQL:Windows下分庫備份指令碼MySqlWindows指令碼
- 資料庫備份資料庫
- rman 備份指令碼指令碼
- mysql備份指令碼MySql指令碼
- ORACLE備份指令碼Oracle指令碼
- 全網資料備份方案
- mysql 資料庫 備份MySql資料庫
- 資料庫備份策略資料庫
- MongoDB資料庫備份MongoDB資料庫
- 【DATAPUMP】Oracle資料泵定時備份刪除指令碼Oracle指令碼
- oracle資料庫備份之exp增量備份Oracle資料庫
- 自動備份指令碼指令碼
- windows mysqldump備份指令碼WindowsMySql指令碼
- oracle 備份資料庫,匯出資料庫Oracle資料庫
- 使用RMAN備份資料庫資料庫
- 資料庫備份恢復資料庫
- SQL資料庫備份管理SQL資料庫
- innobackupex 備份MySQL資料庫MySql資料庫
- mysqlpump 資料庫備份程式MySql資料庫
- mysqldump 資料庫備份程式MySql資料庫
- expdp 邏輯備份指令碼指令碼
- 兩套mysql備份指令碼MySql指令碼
- Dedecms備份的資料檔案位置及備份資料庫的方法資料庫