Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Share a script EXP that backs up ORACLE to local disk under LINUX, and keep it for 7 days

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Please do not put the backup script under backup_dir, add it to crontab and run it regularly.

#! / 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/system@ORACLE_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 backs up the system user data, then compresses it into a TAR package, and then deletes files in the backup directory that are longer than 7 days.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report