zoukankan      html  css  js  c++  java
  • 备份Oracl数据库.bat

    ===========================
    @echo off   
    echo ================================================   
    echo  Windows环境下Oracle数据库的自动备份脚本  
    echo  1. 使用当前日期命名备份文件。  
    echo ================================================    
    ::设置用户名、密码和要备份的数据库。  
    ::set USER=detection1  
    ::set PASSWORD=detection1  
    ::set DATABASE=orcl  
    ::以“YYYYMMDD”格式取出当前时间。
    set year=%DATE:~0,4%
    rem get month 
    set month=%DATE:~5,2%
    rem get data 
    set date=%DATE:~8,2%
    rem get mydate 
    set mydate=%year%%month%%date%  
    ::创建备份目录。
    if not exist "D:YtForeverYTPQMDBackup"       mkdir D:YtForeverYTPQMDBackup   
    set DATADIR=D:YtForeverYTPQMDBackup  
    exp detection1/detection1@127.0.0.1/orcl  file=%DATADIR%detection1_%mydate%.dmp
    exp ytdetection1/ytdetection1@127.0.0.1/orcl  file=%DATADIR%ytdetection1_%mydate%.dmp
    
    exit  

    删除>7天的文件

    forfiles /p "D:YtForeverYTPQMDBackup" /s /m *.* /d -7 /c "cmd /c del @path"

    Oracle导出空表语句

    --执行查询
    select 'alter table '||table_name||' allocate extent;' from user_tables;
    
    --执行查询结果中的语句,完成
  • 相关阅读:
    HappyLeetcode45:Divide Two Integers
    HappyLeetcode44:Plus One
    HappyLeetcode43:Symmetric Tree
    HappyLeetcode42:Intersection of Two Linked Lists
    特征向量中心性(从文献中摘抄)
    二叉树(普通无规律)
    链式队列
    链式栈
    链表
    指针
  • 原文地址:https://www.cnblogs.com/zl0828/p/11846952.html
Copyright © 2011-2022 走看看