1.在/home/nacec/backupdatabase/下建立backuplevel0.sh和backuplevel1.sh指令碼
backuplevel0.sh內容:
#!/bin/bash
# script.:bakuplevel0.sh
# creater:liu shiming
# date:2010/6/28
# desc:backup level0 database datafile in archive with rman
# connect database
export oracle_base=/home/dbsoftware/oracle
export oracle_home=$oracle_base/product/10.2.0/db_1
export oracle_sid=nacec
export path=/home/dbsoftware/oracle/product/10.2.0/db_1/bin:$path
rman target / << eof_rman
run# end
backuplevel1.sh內容:
#!/bin/bash
# script.:bakuplevel1.sh
# creater:liu shiming
# date:2010/6/27
# desc:backup level1 database datafile in archive with rman
# connect database
#!/bin/bash
export oracle_base=/home/dbsoftware/oracle
export oracle_home=$oracle_base/product/10.2.0/db_1
export oracle_sid=nacec
export path=/home/dbsoftware/oracle/product/10.2.0/db_1/bin:$path
rman target/ << eof_rman
run# end
2.給這兩個指令碼授予執行的許可權
[oracle@nacec backupdatabase]$ chmod +x *.rcv
(注意:要試執行指令碼:./backuplevel1.sh)
3.建立基於資料庫的自動備份,使用job完成(策略是週日、週三執行0級增量,其他時間執行1級增量)
begin
dbms_scheduler.create_job(
job_name=>'nacec_job0',
job_type=>'executable',
job_action=>'/home/nacec/backupdatabase/backuplevel0.sh',
repeat_interval=>'freq=weekly;byday=sun,wed;byhour=01;byminute=00');
end;
/exec dbms_scheduler.enable('nacec_job0');
如果想確定該job是否能執行,可以使用下面命令
exec dbms_scheduler.run_job('nacec_job0');進行驗證
begin
dbms_scheduler.create_job(
job_name=>'nacec_job1',
job_type=>'executable',
job_action=>'/home/nacec/backupdatabase/backuplevel1.sh',
repeat_interval=>'freq=weekly;byday=mon,tus,the,fri,sat;byhour=01;byminute=00');
end;
/exec dbms_scheduler.enable('nacec_job1');
如果想確定該job是否能執行,可以使用下面命令
exec dbms_scheduler.run_job('nacec_job1');進行驗證
rman增量備份指令碼
配置rman 登入rman rman target rman show all 2 using target database control file instead of recovery catalog rman configuration parameters for database wi...
rman備份方法之 增量備份
使用型別 系統負載集中在某那個時間段,如白天8小時,晚上基本很閒,所以在晚上就可以對資料進行備份 與之相對應的是全庫備份 1 env ip 10.244.171.180 181 oracle database oracle 11.2.0.3 os rhel 5.5 backup toos rman,...
RMAN 增量備份 的 物件測試
在練習 rman incremental backup 時 參照 ocp tk 042 對於 rman 增量備份的物件 官網摘入如下 you can make incremental backups of databases,individual tablespaces or datafiles.顯...