临时发起个
-
-
#!/bin/sh
-
. /home/oracle/.bash_profile
-
dir=/u02/rman/$ORACLE_SID
-
mkdir -p $dir
-
-
rman target / log=$dir/rman_backup.log<<EOF
-
run {
-
allocate channel c1 type disk;
-
allocate channel c2 type disk;
-
allocate channel c3 type disk;
-
allocate channel c4 type disk;
-
allocate channel c5 type disk;
-
allocate channel c6 type disk;
-
backup as compressed backupset database filesperset 3 format '$dir/prod_full_%U';
-
sql 'alter system archive log current';
-
backup as compressed backupset archivelog all format '$dir/prod_arch_%U';
-
backup current controlfile format '$dir/prod_ctl_%U';
-
release channel c1;
-
release channel c2;
-
release channel c3;
-
release channel c4;
-
release channel c5;
-
release channel c6;
-
}
-
exit
-
EOF
-
rman 每日20点 备份aix平台的oracle数据库
计划任务
0 20 * * * sh /home/oracle/rman_db_full.sh
脚本内容;
-
#!/bin/sh
-
. /home/oracle/.profile
-
-
rman target / log=/dbbak/rman_backup.log<<EOF
-
run {
-
allocate channel c1 type disk;
-
allocate channel c2 type disk;
-
allocate channel c3 type disk;
-
allocate channel c4 type disk;
-
allocate channel c5 type disk;
-
allocate channel c6 type disk;
-
backup as compressed backupset database filesperset 3 format '/dbbak/prod_full_%U';
-
sql 'alter system archive log current';
-
backup as compressed backupset archivelog all format '/dbbak/prod_arch_%U';
-
backup current controlfile format '/dbbak/prod_ctl_%U';
-
release channel c1;
-
release channel c2;
-
release channel c3;
-
release channel c4;
-
release channel c5;
-
release channel c6;
-
}
-
exit
-
EOF
每日备份归档脚本
-
#!/bin/sh
-
. /home/oracle/.profile
-
-
rman target / log=/dbbak/rman_arch.log append <<EOF
-
run {
-
allocate channel c1 type disk;
-
allocate channel c2 type disk;
-
allocate channel c3 type disk;
-
allocate channel c4 type disk;
-
allocate channel c5 type disk;
-
allocate channel c6 type disk;
-
backup as compressed backupset archivelog from time 'sysdate-1' format '/dbbak/prod_arch1_%U';
-
release channel c1;
-
release channel c2;
-
release channel c3;
-
release channel c4;
-
release channel c5;
-
release channel c6;
-
}
-
exit
-
EOF
阅读(1504) | 评论(0) | 转发(0) |