This set of three scripts will do the following:
- Generate export dmp files with the date in the name.
- Automatically compress the dmp files.
- 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
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