Automatic backup of Linux Oracle database automatic compression script code _linux shell

Source: Internet
Author: User

Copy Code code as follows:

#!
#backup. Sh
# #系统名称
Sysname=gz
syspath=/home/oracle/databak/$sysname/
v_date=$ (date ' +%y%m%d%h%m%s ')
logfile= $syspath/backup. $v _date.log
Echo backup_time>> $logfile
Date ' +%y-%m-%d%h:%m:%s ' >> $logfile
#数据库使用情况
echo "Backup Gznxt" >> $logfile
echo "Start_time" >> $logfile
Date ' +%y-%m-%d%h:%m:%s ' >> $logfile
cd/home/oracle/product/10.2.0
Export oracle_home=/home/oracle/product/10.2.0
Export path= $PATH:/home/oracle/product/10.2.0/bin
Export ORACLE_SID=DB
Echo $syspath
v_date=$ (date ' +%y%m%d%h%m%s ')
Exp gz/gz file= $syspath/gznxt$v_date.dmp compress=n >> $logfile
echo "End_time" >> $logfile
Date ' +%y-%m-%d%h:%m:%s ' >> $logfile
#压缩备份的数据文件
Gzip $syspath/*.dmp

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.