Windows下设置oracle数据库定时备份

1编写备份脚本

  1 echo backup oracle database......
2 echo %~dp0
3 set file_dir=%~dp0
4
5 echo backup time......
6 set "year=%date:~0,4%"
7 set "month=%date:~5,2%"
8 set "day=%date:~8,2%"
9 set "hour_ten=%time:~0,1%"
10 set "hour_one=%time:~1,1%"
11 set "minute=%time:~3,2%"
12 set "second=%time:~6,2%"
13
14 set mydate
15
16 if "%hour_ten%" == " " (
17 mydate=%year%%month%%day%0%hour_one%%minute%%second%
18 ) else (
19 mydate=%year%%month%%day%%hour_ten%%hour_one%%minute%%second%
20 )
21
22 exp USER/PWD@SID file=file_dir\yr_database_backup_%mydate%.dmp owner=OWNER
23

2设置windows定时任务

打开 控制面板-》管理工具-》任务计划程序-》创建基本任务

选择任务的执行时间和相应的脚本

Windows下设置oracle数据库定时备份

上一篇:一个帖子学会Android开发四大组件


下一篇:[Laravel] 13 - WEB API : update & error tracking