1:
在/home/oracle (安裝帳號)中,修改 .bash_profile 文件查看環境變量
# User specific environment and startup programs
ORACLE_BASE=/usr/local/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
ORACLE_SID=mrp
LC_CTYPE=en_US.UTF-8
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
22
[1]+ Stopped more .bash_profile
[oracle@cnsrv161 ~]$
2:
調用0級備份腳本:
[oracle@cnsrv161 ~]$ more backup_0_sun.sh
PATH=$PATH:$HOME/bin
ORACLE_BASE=/usr/local/oracle
ORACLE_SID=mrp
LD_LIBRARY_PATH=$ORACLE_HOME/lib
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_HOME
export ORACLE_BASE
export ORACLE_SID
export LD_LIBRARY_PATH
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export PATH
unset USERNAME
$ORACLE_HOME/bin/rman target / @/home/oracle/backup_0_sun.rms log=/home/oracle/`
date +%y-%m-%d`_full.log
3:
0 級備份腳本:
[oracle@cnsrv161 ~]$ more backup_0_sun.rms
run{
allocate channel c1 type disk maxpiecesize=8G;
allocate channel c2 type disk maxpiecesize=8G;
allocate channel c3 type disk maxpiecesize=8G;
allocate channel c4 type disk maxpiecesize=8G;
BACKUP INCREMENTAL level 0 database filesperset=10;
BACKUP archivelog all delete all input;
delete obsolete;
}
[oracle@cnsrv161 ~]$
4:
linux 中配置任務,自動運新
[root@cnsrv161 etc]# more crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
01 * * * * root nice -n 19 run-parts --report /etc/cron.hourly
02 1 * * * root nice -n 19 run-parts --report /etc/cron.daily
22 4 * * 0 root nice -n 19 run-parts --report /etc/cron.weekly
42 4 1 * * root nice -n 19 run-parts --report /etc/cron.monthly
01 00 * * 7 oracle . /home/oracle/backup_0_sun.sh
01 00 * * 1-6 oracle . /home/oracle/backup_1_sun.sh
[root@cnsrv161 etc]#
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/701141/viewspace-404394/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/701141/viewspace-404394/