oracle rman 备份脚本
2016-01-28 15:01
639 查看
[oracle@qyxxmh_db1 ~]$ cat /home/oracle/orabackup/fullbackup.sh
#!/bin/sh
. /home/oracle/.bash_profile
rman log ='/home/oracle/orabackup/fulltmp.log' <<EOF
connect target /
run {
allocate channel d1 type disk;
allocate channel d2 type disk;
allocate channel d3 type disk;
allocate channel d4 type disk;
backup as compressed backupset format 'full_%d_%t_%s_%p_%T.dbf' database;
release channel d1;
release channel d2;
release channel d3;
release channel d4;
}
run {
allocate channel d1 type disk;
allocate channel d2 type disk;
allocate channel d3 type disk;
crosscheck backup;
crosscheck archivelog all;
delete noprompt obsolete;
delete noprompt expired backup;
delete noprompt expired archivelog all;
release channel d1;
release channel d2;
release channel d3;
}
exit;
EOF
cat /home/oracle/orabackup/fulltmp.log >>/home/oracle/orabackup/fullbackup.log
cd /u01/app/oracle/product/11.2.0/dbhome_1/dbs
cp *.dbf /sharedisk/rman_bak/
find /sharedisk/rman_bak/ -mtime +2 -type f -name "full*.dbf" -exec rm -rf {} \;
----------------------------------------------------------------------------------------
[oracle@qyxxmh_db1 ~]$ cat /home/oracle/orabackup/archbackup.sh
. /home/oracle/.bash_profile
rman log ='/home/oracle/orabackup/archtmp.log' <<EOF
connect target /
run {
allocate channel d1 type disk;
backup as compressed backupset archivelog all format 'al_%d_%t_%s_%p_%T.dbf';
allocate channel d2 type disk;
crosscheck backup;
crosscheck archivelog all;
delete noprompt obsolete;
delete noprompt expired backup;
delete noprompt expired archivelog all;
release channel d1;
release channel d2;
}
exit;
EOF
cat /home/oracle/orabackup/archtmp.log >> /home/oracle/orabackup/archfull.log
cd /u01/app/oracle/product/11.2.0/dbhome_1/dbs
cp al*.dbf /sharedisk/rman_bak/
find /sharedisk/rman_bak/ -mtime +2 -type f -name "al*.dbf" -exec rm -rf {} \;
#!/bin/sh
. /home/oracle/.bash_profile
rman log ='/home/oracle/orabackup/fulltmp.log' <<EOF
connect target /
run {
allocate channel d1 type disk;
allocate channel d2 type disk;
allocate channel d3 type disk;
allocate channel d4 type disk;
backup as compressed backupset format 'full_%d_%t_%s_%p_%T.dbf' database;
release channel d1;
release channel d2;
release channel d3;
release channel d4;
}
run {
allocate channel d1 type disk;
allocate channel d2 type disk;
allocate channel d3 type disk;
crosscheck backup;
crosscheck archivelog all;
delete noprompt obsolete;
delete noprompt expired backup;
delete noprompt expired archivelog all;
release channel d1;
release channel d2;
release channel d3;
}
exit;
EOF
cat /home/oracle/orabackup/fulltmp.log >>/home/oracle/orabackup/fullbackup.log
cd /u01/app/oracle/product/11.2.0/dbhome_1/dbs
cp *.dbf /sharedisk/rman_bak/
find /sharedisk/rman_bak/ -mtime +2 -type f -name "full*.dbf" -exec rm -rf {} \;
----------------------------------------------------------------------------------------
[oracle@qyxxmh_db1 ~]$ cat /home/oracle/orabackup/archbackup.sh
. /home/oracle/.bash_profile
rman log ='/home/oracle/orabackup/archtmp.log' <<EOF
connect target /
run {
allocate channel d1 type disk;
backup as compressed backupset archivelog all format 'al_%d_%t_%s_%p_%T.dbf';
allocate channel d2 type disk;
crosscheck backup;
crosscheck archivelog all;
delete noprompt obsolete;
delete noprompt expired backup;
delete noprompt expired archivelog all;
release channel d1;
release channel d2;
}
exit;
EOF
cat /home/oracle/orabackup/archtmp.log >> /home/oracle/orabackup/archfull.log
cd /u01/app/oracle/product/11.2.0/dbhome_1/dbs
cp al*.dbf /sharedisk/rman_bak/
find /sharedisk/rman_bak/ -mtime +2 -type f -name "al*.dbf" -exec rm -rf {} \;
相关文章推荐
- sqlserver oracle 时间加减
- Oralce 重建EM服务,OracleDBConsoleOracle
- PLSQL中配置Oracle方法
- Oracle11g 32位安装步骤
- Win7安装Oracle10g详解
- KETTLE 从oracle将表导入mysql
- oracle 行转列-WMSYS. wm_contact的运用
- OracleDatabase.cs
- Oracle 语句常见错误
- Oracle中的job的定时任务
- oracle chr(0) 隐藏字符串
- 晦涩的oracle X$
- oracle设置定时任务job调度执行存储过程或pl/sql代码块
- Oracle 的几种 分页查询
- oracle中nvl()函数有什么用啊?
- oracle强制索引(转)
- Oracle 11g 数据库详细安装说明
- oracle里IW和WW 区别
- ORACLE百万记录SQL语句优化技巧
- Aix Oracle11g裸设备建库