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

Oracle backup script

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

#! / bin/sh

Export ORACLE_BASE=/app/oracle/

Export ORACLE_HOME=/app/oracle/product

Export PATH=$ORACLE_HOME/bin:$HOME/bin:$PATH

Export ORACLE_OWNER=oracle

Export ORACLE_SID=orcl

# Database backup storage directory

# BACKUP_DIR=/home/oracle/databack

# make a backup

# backup database name

BACKUP_USER=test_bak

# Database password

BACKUP_PASSWORD=oracle

Su-oracle-c "/ u01/app/ora10/product/bin/expdp $BACKUP_USER/$BACKUP_PASSWORD schemas=$BACKUP_USER directory=my_dir dumpfile=$BACKUP_USER.dmp log=$BACKUP_USER.log"

# compress and archive the backup

Cd $BACKUP_DIR

Tar-zcvf $BACKUP_USER- `date +% y% m% d% H% M`.tar.gz $BACKUP_USER- `date +% y% m% d% H% M`.dmp $BACKUP_USER- `date +% y% d% H% M`.log

List= `find $BACKUP_DIR-mtime + 10`

Echo $list

Rm-f $list

ALTER SYSTEM SET db_recovery_file_dest_size=5g scope=both

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