首页 > 数据库技术 > 详细

oracle异地备份

时间:2019-03-09 00:06:56      阅读:227      评论:0      收藏:0      [点我收藏+]

一、安装oracle客户端


右键以管理员身份运行

技术分享图片

 

选择管理员

技术分享图片


跳过软件更新

技术分享图片


选择语言,默认中文

技术分享图片


指定安装位置

技术分享图片


检查当前环境

技术分享图片


安装

技术分享图片

 

二、使用exp命令备份

exp 用户名/密码@IP地址/数据库 owner=所有者 file=%filename%.dmp log=%filename%.log
 
三、新建批处理文件
@echo off
set logfile=.\oraback.log      (指定备份日志文件名)
set filename=.\%date:~0,4%%date:~5,2%%date:~8,2%    (指定备份文件名,以当前日期命名)
set nowdate=%date:~0,4%%date:~5,2%%date:~8,2%       (获取当前日期)
echo the BK is begining,Pls Waiting.... >>%logfile%         (echo内容到日志文件)
echo The Time is %nowdate%---%time% now! >> %logfile%       (把当前时间输入到日志文件)
exp 用户名/密码@IP地址/数据库  owner=所有者  file=%filename%.dmp log=%filename%.log     (执行备份命令)
echo The Oracle Backup has completed.Bye! >>%logfile%         (echo内容到日志文件)
echo the Completed time is %nowdate%---%time% >>%logfile%     (把当前时间输入到日志文件)
echo line of demarcation*******************************>>%logfile%      (echo内容到日志文件)
echo ***>>%logfile%    (echo内容到日志文件)
echo ***>>%logfile%    (echo内容到日志文件)
forfiles /p "." /s /m *.dmp /d -15 /c "cmd /c del @path"       (删除15天前,后缀名为dmp的文件)
forfiles /p "." /s /m *.log /d -15 /c "cmd /c del @path"       (删除15天前,后缀名为log的文件)

三、添加批处理文件到任务计划

技术分享图片

oracle异地备份

原文:https://www.cnblogs.com/zhenwei66/p/10498848.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!