一个ubuntu server下的oracle10g简单生产库全库备份脚本

 

#!/bin/sh

### W.X.Z

### 2010.08.20

### http://my.oschina.net/fengboli/blog

### Oracle10g expdp autobackup bash

### beijing

 

###--- Set backup database env 

export TMP=/tmp

export TMPDIR=/tmp

export ORACLE_BASE=/opt/oracle

export ORACLE_SID='database' # you database

export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1

export PATH=$PATH:$ORACLE_HOME/bin:$CATALINA_HOME/bin

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

 

###--- Rollback database files 

rm /opt/bak/export.log;rm /opt/bak/data3.dmp

mv /opt/bak/data2.dmp /opt/bak/data3.dmp

mv /opt/bak/data1.dmp /opt/bak/data2.dmp

 

###--- DataBase full exp use EXPDP tools  

expdp  system/password directory=dump_dir dumpfile=data1.dmp full=y

你可能感兴趣的:(oracle,linux,server,ubuntu,backup)