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.
- 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.
- -bash-2.05b$ more /opt/oracle/product/movedata/movedata1.sh
- ORACLE_HOME=/opt/oracle/product/9.0.2
- export ORACLE_HOME
- . /opt/oracle/product/.bash_profile
- export DATE=$(date +%Y%m%d)
Call the linux date function to implement a daily backup of a file named by date
- /opt/oracle/product/9.0.2/bin/exp goldring/123456@szdb file=/data/OracleDB_Backup/goldring.dmp log=/data/OracleDB_Back
- up/loggoldring.dmp consistent=yes
- /opt/oracle/product/9.0.2/bin/exp jltgame/123456@szdb file=/data/OracleDB_Backup/jltgame$DATE.dmp log=/data/OracleDB_Ba
- ckup/logjltgame.dmp consistent=yes
- /opt/oracle/product/9.0.2/bin/exp userid=oraclebackup/"abcd456&*("@szdb owner=moonprincess file=/data/OracleDB_Backup/moon
- princess.dmp log=/data/OracleDB_Backup/logmoonprincess.dmp consistent=yes
- #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.