Generating DMP files with the date under Unix

Generating DMP files with the date under Unix

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

    Requires Free Membership to View

    By submitting your registration information to SearchOracle.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchOracle.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

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.

This was first published in June 2002

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.

    Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.