oracle异地备份

一、安装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的文件)

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

转载于:https://www.cnblogs.com/zhenwei66/p/10498848.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值