zoukankan      html  css  js  c++  java
  • asp.net和c#实现定时备份数据库(SQL Server2000)

    其实很简单,只需要用到javascript,因为.net的webform的后台代码无法调用cmd.exe。  
    你最多在用脚本在添加点时间控制的代码。  
    我这里是对orcle的备份  
    ----------------------------------------------------------------------------  
    <script   language   =vbscript>  
    dim   expstr  
    select   case   Weekday(date)  
    case   1    
    expstr   =   "jlsbgis/jlsbgis@sj   owner=jlsbgis   file=D:\database\sj"   &   year(date)   &   month(date)   &   day(date)   &   ".dmp   log=c:\temp\expost.log"    
    case   2    
    expstr   =   "jlsbgis/jlsbgis@spgd   owner=jlsbgis   file=D:\database\spgd"   &   year(date)   &   month(date)   &   day(date)   &   ".dmp   log=c:\temp\expost.log"  
    case   3  
    expstr   =   "jlsbgis/jlsbgis@jlgd   owner=jlsbgis   file=D:\database\jlgd"   &   year(date)   &   month(date)   &   day(date)   &   ".dmp   log=c:\temp\expost.log"    
    case   4    
    expstr   =   "jlsbgis/jlsbgis@spgd   owner=jlsbgis   file=D:\database\spgd"   &   year(date)   &   month(date)   &   day(date)   &   ".dmp   log=c:\temp\expost.log"    
    case   5  
    expstr   =   "jlsbgis/jlsbgis@bsgd   owner=jlsbgis   file=D:\database\bsgd"   &   year(date)   &   month(date)   &   day(date)   &   ".dmp   log=c:\temp\expost.log"    
    case   6  
    expstr   =   "jlsbgis/jlsbgis@sj   owner=jlsbgis   file=D:\database\sj"   &   year(date)   &   month(date)   &   day(date)   &   ".dmp   log=c:\temp\expost.log"    
    case   7  
    expstr   =   "jlsbgis/jlsbgis@thgd   owner=jlsbgis   file=D:\database\thgd"   &   year(date)   &   month(date)   &   day(date)   &   ".dmp   log=c:\temp\expost.log"    
    end   select  
    set   objshell   =   CreateObject("Shell.Application")  
    objshell.shellexecute   "exp",   expstr  
    if   err.number   <>   0   then  
    msgbox   "oracle   可能出现问题,请询问黄总。"   &   chr(10)   &chr(10)   &   "错误代码:"   &   err.Description   ,,"提示"  
    end   if  
    set   objShell   =   nothing  
    </script>

  • 相关阅读:
    超市帐单系统
    JavaOOP
    拦截器的工作原理是什么?
    struts2
    500错误
    idea添加struts框架后报错
    2019春第九周作业
    2019春第八周作业
    2019春第七周作业
    2019春第六周作业
  • 原文地址:https://www.cnblogs.com/skyshenwei/p/1642020.html
Copyright © 2011-2022 走看看