晕啊,这几天事情太多了,小事多的让我头都晕了,呵呵,不急,不急,一件件来,先把ORACLE数据库本身的备份搞得,要不然,我睡觉都不安份啊.那个VERITAS能不能用,我心里都没底.(:()
第一步建立备份脚本:
root@sun-jwgl #
#cd /dbbackup/
#vi erverbackup.sh
ORACLE_HOME=/oracle/oracle/oracle817
ORACLE_SID=jw
NLS_LANG="simplified chinese"_china.zhs16gbk
PATH=$PATH:/usr/sbin:/$ORACLE_HOME/bin
export ORACLE_HOME
export ORACLE_SID
export NLS_LANG
export PATH
DATE=`date +%Y%m%d`
cd /$ORACLE_HOME/backup
exp 用户名/密码@主机字符串 file=JW${DATE}.dmp log=JW${DATE}.log
上面除了最后一行用户名密码和主机字符串要自己写之外,其它应该差不多,不过,大多数人把oracle装在/export/home/oracle中的,我们比较例外一点.
#chmod +x erver.sh 让脚本可执行的说
第二步运行一下看看root@sun-jwgl # ./erverbackup.sh
Export: Release 8.1.7.0.0 - Production on 星期三 10月 27 09:06:51 2004
(c) Copyright 2000 Oracle Corporation. All rights reserved.
Connected to: Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
With the Partitioning option
JServer Release 8.1.7.0.0 - Production
Export done in ZHS16GBK character set and ZHS16GBK NCHAR character set
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user JW
. exporting object type definitions for user JW
About to export JW's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export JW's tables via Conventional Path ...
. . exporting table A 244 rows exported
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting snapshots
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully without warnings.
一切OK,那么就进入
第三步放入crontab中
root@sun-jwgl # crontab -l
#ident "@(#)root 1.19 98/07/06 SMI" /* SVr4.0 1.1.3.1 */
#
# The root crontab should be used to perform accounting data collection.
#
# The rtc command is run to adjust the real time clock if and when
# daylight savings time changes.
#
10 3 * * 0,4 /etc/cron.d/logchecker
10 3 * * 0 /usr/lib/newsyslog
15 3 * * 0 /usr/lib/fs/nfs/nfsfind
1 2 * * * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1
30 3 * * * [ -x /usr/lib/gss/gsscred_clean ] && /usr/lib/gss/gsscred_clean
42 18 * * * /dbbackup/erverbackup.sh
root@sun-jwgl # crontab -e 18 * * * /dbbackup/erverbackup.sh
一切搞定,哈哈
星期二, 三月 13, 2007
订阅:
博文评论 (Atom)

没有评论:
发表评论