Automatic backup of oracle9i database files under Windows

Source: Internet
Author: User
Tags date log variables backup
oracle|window| Backup | data | Database FIRST step:

In the D-Packing directory to create a new folder backup, this directory can be arbitrary, copy exp.exe files to this directory, the directory under the new file Expbkup.bat

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

SID is test, username/password is test/test, the exp command is invoked to generate the corresponding data file and log file in the D:\backup directory.

Step Two:

Under Task scheduling in Control Panel, create a new Task Plan Wizard, select the file to perform the task Expbkup.bat, the task name at random Expbkup, choose to perform this task every day, starting 18:00, the starting date defaults to starting from the day, enter username and password, point completion can be added every afternoon 6 : 00 Scheduled tasks for backing up Oracle databases once.

Call Linux date functions 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) #调用linux日期函数, the implementation file is named by date one backup per day
/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 the crontab

NOTE: Oracle automatic backup is key to adding Oracle's environment variables to the backup script and adding $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.