自动逻辑备份oracle

 

自动备份脚本:

oracle@linux:~/back_dmp> more backup_dmp.sh
#!/bin/bash
export ORACLE_HOME=/opt/oracle/product/10.2/db_1
export ORACLE_SID=oracle_sid
export PATH=/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/opt/oracle/product/10.2/db_1/bin:/usr/java/jdk1.6.0_16/bin:/usr/java/jdk1.6.0_16/jre/bin
export NLS_LANG=american_america.ZHS16GBK
exp user/passwd owner=user file=/opt/oracle/back_dmp/user$(date +%F).dmp
 

oracle用户cron自动执行

oracle@linux:~/back_dmp> crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.XXXXPJgyOQ installed on Thu Aug 11 10:14:55 2011)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
16 10 * * * sh /opt/oracle/back_dmp/backup_dmp.sh

根据需要设置备份的时间

有时,可以利用ftp、同步目录数据、共享服务器目录、或者sshd等效性的方法,把备份的dmp包转移到其他服务器上。

你可能感兴趣的:(oracle,自动备份,oracle备份,休闲,逻辑备份)