Oracle Automatic Backup detailed steps
Background: Oracle 10g Server, Oracle 10g client, Windows XP operating platform
Requirements: The Oracle database server automatically backs up the database YTCN once a day.
Solution: Automatically generate Oracle backup files based on dates with task scheduling, batch files, and Oracle's EXP export capabilities. Detailed steps:
1 Creating batch Files Ytcn.bat
The details of Ytcn.bat are as follows:
@echo off
Echo is backing up the Silver Network Oracle database, please wait a moment ...
Exp userid= ' YTCN/YTCN@YTCN as Sysdba ' File=e:/bak/ytcn/oracle/ytcn/ytcn%date:~0,4%%date:~5,2%%date:~8,2%.dmp log=e :/bak/ytcn/oracle/ytcn/ytcn%date:~0,4%%date:~5,2%%date:~8,2%.log full=y
The Echo task is complete.
Where the red part is changed according to the need, such as the author's project name "Silver Pass Net", database YTCN username YTCN, password ytcn, to create the form such as "Ytcn20090711.dmp" and "under the Directory" E:/BAK/YTCN/ORACLE/YTCN " Ytcn20090711.log "Backup and log files, full table export.
In addition: The value of%date% in different systems, language versions may not be the same, control panel inside the setting of the regional options will also change the value of%date%. Test the Echo%date% return value on the command line first. %date:~4,10% is the return date function, the first parameter is the starting position to intercept (starting from 0), the second parameter is the length to intercept, if no is intercepted to the last, parameters can be modified as appropriate. If you need accurate time to do the file name, please use the%time% function, parameter ibid.
2 Add a task schedule YTCN
Start > All Programs > Attachments > System Tools > Task Scheduler > Add Task Schedule > Next > Browse to find just written ytcn.bat file > Task Name Input YTCN, perform this task select every day, next > Start 12:00, start date 2009-7-11, Next > enter username and password, username requires Administrator privileges username, Next > complete
After clicking "Finish", a task plan named "YTCN" will be added under the task plan to indicate that it has been configured.
Note: Sometimes after clicking "Finish", the system warns
"A new task has been created, but may not run because account information cannot be set.
The specified error is:
Ox80041315: The Task Scheduler service is not running
This is because the computer's Task Scheduler service does not start up. Start > All Programs > Admin tools > Services, find the "task Scheduler" service, find the startup type is disabled, right-click to change to "auto", and start it up, and then add the task schedule again YTCN on it.