临时发起个
-
-
#!/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
阅读(1310) | 评论(0) | 转发(0) |