WINDOWS2003 on 10G Oracle Backup

Source: Internet
Author: User

Today you need to write a oracle10g backup script on an old Windows2003.

IP1 is a Windows2003 system with a 10G database installed (D:dbbackup is the database backup directory), IP2 to a normal Windows2003 system without installation (D:DBBACKUP2 is the database backup directory). Make a backup on the Oracle-installed machine and write a bat script that reads:

@echo off Echo is backing up the Oracle database, wait a moment ... set mydate=%date:~0,10%//2016-1-6 date format exp user/[email protected] full=y File=d : \dbbackup\orc_%mydate%.dmp buffer=655350000 Log=d:\dbbackup\orc_%mydate%.log//Not explained very simple forfiles/p "D:\dbbackup"/s/m * */d-7//"cmd/c del @path"//delete files from 7 days ago Echo task complete!

Just add the bat to the scheduled task.

I have shared a directory of IP2 to ip1 mapped to x disk, ip1 backup database file copy to IP2 for backup, dual backup purposes.

The script is as follows

@echo off Echo is copying the database, wait a moment ... set mydate=%date:~0,10%copy d:\dbbackup\orc_%mydate%.dmp \\192.168.1.2\dbbackup2copy D:\dbbackup\orc_%mydate%.log \\192.168.1.2\dbbackup2//This can not directly write the mapped x disk because the Windows2003 scheduled task will not be executed, must write the network URC address echo task complete!

then I added a task on the IP2 to delete the 7-day backup, I added a ip1 on the non-implementation, had to use this method, on the local delete

The script is as follows:

@echo off ECHO is deleting the Oracle database 7 days ago, please wait ... forfiles/p "D:\dbbackup2"/s/m * * */d-7/"cmd/c del @path" Echo task completed!

The use of the Windows console's copy command to modify the file creation time can be used to test the successful operation of the Forfiles script, as follows:

1. Modify the system time for the target time you need to change to;

2. Run the command: Copy file name +, (note is two consecutive commas).


WINDOWS2003 on 10G Oracle Backup

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.