Problem solve Get help with specific problems with your technologies, process and projects.

Generating DMP files with the date under Unix

Generate Oracle export dmp files with the date in the name, then compress and export them.

This set of three scripts will do the following:

  1. Generate export dmp files with the date in the name.
  2. Automatically compress the dmp files.
  3. Schedule export by crontab.

1. Generate export dmp files with the date in the name.

## Shell for generating Full Export dmp files with Log for O816 SID 
ORACLE_HOME=/oracle1/home
export ORACLE_HOME
ORACLE_TERM=vt100
export ORACLE_TERM
ORACLE_SID=o816
export ORACLE_SID
PATH=$ORACLE_HOME/bin:/usr/local/bin:$PATH
export PATH
ORACLE_DOC=/oracle/home/doc
export ORACLE_DOC
cd /data11/orabackup
day=`date '+%b%d' `
exp sysopr/sysopr full=y file=F1$day,F2$day,F3$day,F4$day,F5$day,F6$day filesize
=800000000 log=LO$day
echo "Full Export of O816 Over"

2. Automatically compress the dmp files.

## Shell - zipfiles1 to compress Full Export dmp files
cd /data11/orabackup
day=`date '+%b%d' `
compress F1$day.dmp
compress F2$day.dmp
echo "Compression 1 Over"
##

## Shell - zipfiles2 to compress Full Export dmp files
cd /data11/orabackup
day=`date '+%b%d' `
compress F3$day.dmp
compress F4$day.dmp
echo "Compression 2 Over"
##

3. Schedule export by crontab.

## Script O816cronjob for submit to crontab--------------------

#min    hour    daymo   month   daywk   cmd
#--------------------------------------------------------------
30      02       *       *       1-6    /data11/orabackup/o816full
00      03       *       *       1-6    /data11/orabackup/zipfiles1
00      04       *       *       1-6    /data11/orabackup/zipfiles2
#--------------------------------------------------------------
#  1 - Monday,   2 - Tuesday, 3 - Wednesday, 4 - Thursday, 5 - Friday,
#  6 - Saturday, 7 - Sunday

For More Information

  • What do you think about this tip? E-mail the editor at tdichiara@techtarget.com with your feedback.
  • The Best Oracle Web Links: tips, tutorials, scripts, and more.
  • Have an Oracle tip to offer your fellow DBAs and developers? The best tips submitted will receive a cool prize--submit your tip today!
  • Ask your technical Oracle questions--or help out your peers by answering them--in our live discussion forums.
  • Check out our Ask the Experts feature: Our SQL, database design, Oracle, SQL Server, DB2, metadata, and data warehousing gurus are waiting to answer your toughest questions.

Dig Deeper on Oracle database backup and recovery

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close