Configuration of Oracle Database dmp file regular backup in SCO Unix System

Source: Internet
Author: User

Oracle DatabaseModerate timingDmp FileBackup can improve the security and stability of the database and facilitate recovery in the event of a fault. This article describes how to regularly back up the dmp file of an oracle database in SCO Unix. Let's take a look at it.

Prerequisites for backing up dmp files:

1. required information:

  • Oracle system password and account name and password for backing up database accounts
  • Sco unix root password and oracle Password

2. Files are edited by vi, folders are created by mkdir, file permissions are changed by chmod, users are switched by su, and files are executed.

3. Understand sco unix users, groups, permissions, crontab usage, and oracle dmp file generation.

1. Create a directory for storing database dmp files

 
 
  1. #su - oracle   
  2.  
  3. $cd /dbf   
  4.  
  5. $mkdir dmpbak   
  6.  
  7. $cd dmpbak   
  8.  
  9. $mkdir zd   
  10.  
  11. $mkdir cm  

2. Create an exported database dmp File

1. Specify a directory

 
 
  1. #su - oracle   
  2.  
  3. $cd bin  

2. Use vi to edit the exp_t File

$ Vi exp_t

Exp_t content:

 
 
  1. ORACLE_HOME=/oracle   
  2.  
  3. ORACLE_SID=ora7   
  4.  
  5. ORACLE_TERM=ansi   
  6.  
  7. export ORACLE_HOME ORACLE_SID ORACLE_TERM   
  8.  
  9. MENU5PATH=$ORACLE_HOME/forms30/admin/resource   
  10.  
  11. export MENU5PATH   
  12.  
  13. ORATERMPATH=$ORACLE_HOME/forms30/admin/resource   
  14.  
  15. export ORATERMPATH   
  16.  
  17. NLS_LANG=American_America.ZHS16CGB231280   
  18.  
  19. export NLS_LANG   
  20.  
  21. ORA_NLS=/oracle/ocommon/nls/admin/data   
  22.  
  23. export ORA_NLS   
  24.  
  25. home1='/dbf/dmpbak'   
  26.  
  27. dt1=`date "+%H%M"`   
  28.  
  29. echo ' ' >'$home1/'new_record   
  30.  
  31. file_name="$home1"/zd/zd"$dt1"   
  32.  
  33. echo $file_name >>'$home1'/new_record   
  34.  
  35. $ORACLE_HOME/bin/exp zd/zdzd file=$file_name.dmp owner=zd grants=y buffer=204800 rows=y indexes=y compress=y    
  36.  
  37. file_name="$home1"/cm/cm"$dt1"   
  38.  
  39. echo $file_name >>'$home1'/new_record   
  40.  
  41. $ORACLE_HOME/bin/exp common/cmcm file=$file_name.dmp owner=common grants=y buffer=204800 rows=y indexes=y compress=y    
  42.  
  43. file='/dbf/dmpbak/new_record'   
  44.  
  45. backup_dir='/oracle/sec_back'   
  46.  
  47. if [ -d $backup_dir ]   
  48.  
  49. then   
  50.  
  51. for i in `cat $file`   
  52.  
  53. do   
  54.  
  55. cp $i $backup_dir/   
  56.  
  57. done   
  58.  
  59. echo ' '>$file   
  60.  
  61. fi  

3. Grant the exp_t permission

$ Chmod 755 exp_t

4. Test exp_t

 
 
  1. $cd /oracle/bin   
  2.  
  3. $exp_t  

5. Check whether the dmp file is generated.

 
 
  1. $cd /dbf/dmpbak/zd   
  2.  
  3. $ls 

For example, the file generated at is 1135.dmp. if the dmp file is generated, it is proved that exp_t can be used.

3. Edit crontab

# Add a line to crontab-e: 35 * su-oracle-c/oracle/bin/exp_t, which means that the dmp file is backed up every 35 minutes every day, the data on the first day will overwrite the data on the first day.

This article describes how to regularly back up the dmp files of oracle databases in SCO Unix systems. We hope this article will help you.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.