Home > Database > Mysql Tutorial > windows下定期执行rman备份(脚本+方法介绍)

windows下定期执行rman备份(脚本+方法介绍)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 15:28:15
Original
1370 people have browsed it

备份是最重要的,很多测试环境都搭建在windows下,博主的电脑上就有一个,为了保证它的安全性,决定执行定期的备份。 例子中讲述了如何在windows下使用 脚本+windows定时任务实现 定期执行全备的方法。 备份脚本 C:\rman_backup\rman_bk.bat文件内容: rman

备份是最重要的,很多测试环境都搭建在windows下,博主的电脑上就有一个,为了保证它的安全性,决定执行定期的备份。

例子中讲述了如何在windows下使用 脚本+windows定时任务实现 定期执行全备的方法。

备份脚本

C:\rman_backup\rman_bk.bat文件内容:

rman target sys/xiaojun@startrek cmdfile 'c:/rman_backup/rman_bk_script.txt' log 'c:/rman_backup/%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%".log'

C:\rman_backup\rman_bk_script.txt文件内容(根据自己的需求可以自行修改)

RUN {
delete noprompt obsolete ;
allocate channel c1 type disk;
backup database format 'c:/rman_backup/db_%U' plus archivelog delete all input format 'c:/rman_backup/arch_%U';
release channel c1;
}
exit

执行rman_bk.bat输出:

C:\Users\fengjun>rman target sys/xiaojun@startrek cmdfile 'c:/rman_backup/rman_bk_script.txt' log 'c:/rman_backup/20140121".log'
RMAN> 2> 3> 4> 5> 6> 7>
C:\Users\fengjun>
C:\Users\fengjun>
Copy after login
相应的C:\rman_backup目录下会生成如下文件:

 

\

设置windows定时任务了

cmd 下 执行

taskschd.msc

进入到windows的任务计划界面

新建基本任务

\

输入任务名称

\

选择周期

\

选择周期启动时间

\

操作类型选择启动程序

\

设置脚本位置

\

\

然后可以直接运行一下进行测试

\

如需转载,请注明出处:

blog.csdn.net/renfengjun 或者

www.orcl.cc

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Can Windows be learned?
From 1970-01-01 08:00:00
0
0
0
Install PHP in windows environment
From 1970-01-01 08:00:00
0
0
0
zookeeper extension under windows
From 1970-01-01 08:00:00
0
0
0
Can I play vim happily on Windows?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template