zoukankan      html  css  js  c++  java
  • 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的文件)

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

  • 相关阅读:
    红楼梦 + 写入 MySQL + MongoDB
    糗事百科 + 微信自动回复
    验证码处理
    IP 代理池
    Ajax工作原理
    php做APP接口开发,接口的安全性
    http与https区别
    mysql 索引优化
    php+ajax+jquery实现jsonp跨域
    SpringBoot中文乱码解决方案
  • 原文地址:https://www.cnblogs.com/zhenwei66/p/10498848.html
Copyright © 2011-2022 走看看