Home > Database > Mysql Tutorial > Ubuntu 定时备份Oracle数据库实现

Ubuntu 定时备份Oracle数据库实现

WBOY
Release: 2016-06-07 17:17:36
Original
1252 people have browsed it

最近开发需要在Ubuntu里面定时备份Oracle数据库的需要,采用cron,具体步骤如下:为oracle用户配置环境变量 /home/oracle/.profile

最近开发需要在Ubuntu里面定时备份Oracle数据库的需要,采用cron,具体步骤如下:

1,为oracle用户配置环境变量 /home/oracle/.profile

#for oracle  
export ORACLE_HOME=/opt/ora10  
export ORACLE_SID=orcl  
export ORACLE_OWNER=oracle  
export PATH=$PATH:$ORACLE_HOME/bin  
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/lib32:/usr/lib  
export DISABLE_HUGETLBFS=1 
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK 

2,写好导数据脚本 存为 expdb.sh

source /home/oracle/.profile  
exp xx/xx file=/usr/local/aaa.dmp 

给脚本授权

chmod 777 expdb.sh 

3,写定时任务 crontab -u oracle -e

00 17 * * 1-5 /usr/local/cjd/expdb.sh  #表示 周一至周五 每天 17点运行 

4,查看该用户定时任务

crontab -u -l 

5,一切完毕。

linux

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template