The automatic backup of Oracle9i files is running in Windows.

Source: Internet
Author: User

The following article describes how to perform automatic backup for Oracle9i database files in Windows. If you are curious about this operation, the following articles will unveil its mysteries. I hope it will help you in this regard.

Step 1:

Create a new folder backupin under the d directory. This directory can copy the exp.exe file to this directory, and create a new file expbkup. bat under this directory.

 
 
  1. exp test/test@test file=d:\backup\%date:~0,10%.dmp log=
    d:\backup\%date:~0,10%.log compress=n buffer=8092 consistent=
    y direct=n constraints=y feedback=10000 grants=y record=y indexes=y triggers=y rows=y 

The sid is test, and the username/password is test/test. Call the exp command to generate corresponding data files and log files in the d: \ backup Directory.

Step 2:

In the task scheduler of the control panel, create a task scheduler wizard and select the file expbkup for the task to be executed. bat, the task name expbkup at will, select to execute this task every day, start time, start date is from the day by default, enter the user name and password, click to complete the scheduled task of backing up the Oracle database at every day.

Call the linux date function to automatically generate an oracle backup every day.

 
 
  1. -bash-2.05b$ more /opt/oracle/product/movedata/movedata1.sh  
  2. ORACLE_HOME=/opt/oracle/product/9.0.2  
  3. export ORACLE_HOME  
  4. . /opt/oracle/product/.bash_profile  
  5. export DATE=$(date +%Y%m%d)  

Call the linux date function to implement a daily backup of a file named by date

 
 
  1. /opt/oracle/product/9.0.2/bin/exp goldring/123456@szdb file=/data/OracleDB_Backup/goldring.dmp log=/data/OracleDB_Back  
  2. up/loggoldring.dmp consistent=yes 
  3. /opt/oracle/product/9.0.2/bin/exp jltgame/123456@szdb file=/data/OracleDB_Backup/jltgame$DATE.dmp log=/data/OracleDB_Ba  
  4. ckup/logjltgame.dmp consistent=yes 
  5. /opt/oracle/product/9.0.2/bin/exp userid=oraclebackup/"abcd456&*("@szdb owner=moonprincess file=/data/OracleDB_Backup/moon  
  6. princess.dmp log=/data/OracleDB_Backup/logmoonprincess.dmp consistent=yes 
  7. #ftp -n 10.0.0.3 < /opt/oracle/product/movedata/ftpcommand  

Put the above script in crontab.

Note: In Windows, the key to automatic backup of Oracle9i database files is to add oracle environment variables to the backup script and $ DATE variables to the backup file name.

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.