Share a script to backup Oracle to local disk under Linux exp, reserved for 7 days

Source: Internet
Author: User

Please do not put the backup script under the Backup_dir, add to the crontab timer run

#!/bin/sh
Export Oracle_home=/u01/app/oracle/product/10.2.0/db_1
Export ORACLE_SID=ORCL
Export Nls_lang=american_america. Zhs16gbk
Export Path=/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin :/u01/app/oracle/product/10.2.0/db_1/bin
Export Backup_dir=/orabackup
Export now=$ (date ' +%y%d%m ')
Exp system/[email protected]_sid file= $BACKUP _dir/system$now.dmp log= $BACKUP _dir/system$now.log full=y
CD $BACKUP _dir
Tar zcvf system$now.tar.gz system$now.dmp system$now.log--remove-files
find/orabackup/-mtime +7-exec/bin/rm-rf ' {} ';

This script is to back up the system user data, then compress it into a tar package, and then delete files larger than 7 days in the backup directory

This article is from the "It~ Migrant Workers" blog, please be sure to keep this source http://429268437.blog.51cto.com/4870929/1773908

Share a script to backup Oracle to local disk under Linux exp, reserved for 7 days

Related Article

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.