1:
#00 21 * * * /opt/ora10/product/10.2.0/rman-script/bossdb_backup.sh >> /rmanbackup/log.rman
15,45 6-23 * * * /opt/ora10/product/10.2.0/rman-script/bossdb_backup_arch.sh >> /rmanbackup/archive_log.rman
2:more /opt/ora10/product/10.2.0/rman-script/bossdb_backup.sh
#!/bin/bash
ORACLE_BASE=/opt/ora10/product
export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/10.2.0
export ORACLE_HOME
ORACLE_SID=starboss
export ORACLE_SID
ORACLE_TERM=sun5
export ORACLE_TERM
#NLS_LANG='SIMPLIFIED CHINESE_CHINA'.ZHS16GBK .......
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export NLS_LANG
ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export ORA_NLS33
CLASSPATH=$ORACLE_HOME/jdbc/lib/classes111.zip
export CLASSPATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib32:$ORACLE_HOME/rdbms/lib:$ORACLE_HOME/rdbms/demo:/usr/lib:/usr/openwin/lib:/usr/dt/lib
export LD_LIBRARY_PATH
PATH=/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/ucb:/usr/dt/bin:/usr/openwin/bin:/opt/NSCPcom:/usr/local/bin:/usr/ccs/bin:$ORACLE_HOME/bin:$PATH
export PATH
echo "Single Backup Beginning time:" `date +'%Y-%m-%d %H:%M'`
#env
/opt/ora10/product/10.2.0/bin/rman target / nocatalog @/opt/ora10/product/10.2.0/rman-script/backup.rman
cp $ORACLE_HOME/dbs/lkSTARBOSS* /bossrman0.67
cp $ORACLE_HOME/dbs/orapwstarboss /bossrman0.67
echo "Single Backup End time:" `date +'%Y-%m-%d %H:%M'`
3:
report obsolete;
delete noprompt obsolete;
delete obsolete redundancy = 1;
run{
allocate channel ch1 type disk ;
allocate channel ch2 type disk ;
allocate channel ch3 type disk ;
allocate channel ch4 type disk ;
allocate channel ch5 type disk ;
backup filesperset 10 database tag tsbossdb format '/rmanbackup/rmanbackup/rmanbackup/bossdb20140421%d%U.dbf.%T';
sql 'alter system archive log current';
sql 'alter system archive log current';
backup filesperset 10 format '/rmanbackupm5000/rmandata/bossdblog20140421_t%t_s%s_p%p' archivelog all;
release channel ch1;
release channel ch2;
release channel ch3;
release channel ch4;
release channel ch5;
}
delete archivelog until time 'sysdate-2';
quit
4:
run{
Crosscheck archivelog all;
delete noprompt archivelog until time 'SYSDATE-8';
allocate channel d1 type disk;
sql 'alter system archive log current';
sql 'alter system archive log current';
backup filesperset 20 format '/rmanbackupm5000/archbak/archlog_t%t_s%s_p%p' archivelog all delete input;
backup current controlfile format '/rmanbackupm5000/archbak/controlfile%d%U.dbf.%T';
release channel d1;
}
quit
阅读(812) | 评论(0) | 转发(0) |