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

Guide of oracle expdp backup under liunx centos

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

Share

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

1. Reference to set environment variables

two。 Record execution time and user

3. Delete old backup

4. Data pump extraction backup

5. Compressed backup

6. Delete pre-compressed files

#! / bin/sh

. / etc/profile

Source / .bash_profile

ORACLE_BASE=/data/u01/app/oracle; export ORACLE_BASE

ORACLE_HOME=/data/u01/app/oracle/product/11.2.0/dbhome_1; export ORACLE_HOME

PATH=/data/u01/app/oracle/product/11.2.0/dbhome_1/bin:/usr/local/bin:/usr/ccs/bin:$PATH:/usr/sbin

Export PATH

Echo $PATH

Date > > / data/u01/app/oracle/exp/zktime10backrun.log

Whoami > > / data/u01/app/oracle/exp/zktime10backrun.log

Find / data/u01/app/oracle/exp-mtime + 5-name "bak_expdp*.zip" | xargs rm-rf

Dmpfile=bakexpdp$ (date +% Y%m%d) .dmp

Logfile=bakexpdp$ (date +% Y%m%d) .log

Zipfile=zktime10bakexpdp$ (date +% Y%m%d) .zip

Expdp user/passwd@127.0.0.1/zktime directory=data_dir dumpfile=$dmpfile full=y log=$logfile

Zip "/ data/u01/app/oracle/exp/$zipfile"/ data/u01/app/oracle/exp/$dmpfile" / data/u01/app/oracle/exp/$logfile "

Rm-rf / data/u01/app/oracle/exp/$dmpfile

Rm-rf / data/u01/app/oracle/exp/$logfile

~

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: 292

*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