在VB中用shell调用
exp user/password@数据ID owner=方案名 file=c:\a.dmp log=c:\a.log

解决方案 »

  1.   

    这是我在DELPH里的语句:ShellExecute(0, 'open',PCHAR('exp gpsdata/sa FILE='+backfile+' owner=(gpsdata)'),'','', SW_SHOW);和freddy2003() 说的差不多,定义个API,用来执行ORACAL的备份命令。
      

  2.   

    存储过程
    create or replace prodedure pro_1 (.....) as
    ..
    ..
    begin
     insert into tbname(...) select ....from tbname2;
    end;
      

  3.   

    wylwyl1130(落雪山林) ,我说的是数据库备份恢复的存储过程不是你那个,你那个太easy了吧
      

  4.   

    1,用vb.net写个程序。主要代码如下,(请根据你的数据库的情况,对数据库实例名等做适当修改)Public Class Backup
        Shared Sub Main()
            FileOpen(1, "c:\DBbackup\exp_comwin.txt", OpenMode.Output)
            Dim line1$
            Dim d As Date = Date.Today
            Dim strToday As String = d.Year.ToString & d.Month.ToString.PadLeft(2, "0") & d.Day.ToString.PadLeft(2, "0")        line1$ = "file=c:\DBbackup\comwin_" & strToday & ".dmp"
            PrintLine(1, line1$)        Dim line2$
            'line2$ = "log=c:\DBbackup\comwin_" & strToday & ".log"        PrintLine(1, line2$)
            PrintLine(1, "userid=comwin2/comwin2@bfssys")
            PrintLine(1, "buffer=50000000")
            PrintLine(1, "grants=y")
            PrintLine(1, "indexes=y")
            PrintLine(1, "rows=y")
            PrintLine(1, "consistent=y")
            PrintLine(1, "constraints=y")
            PrintLine(1, "owner=comwin2")
            FileClose(1)    End Sub
    End Class2 个程序执行后生成exp_comwin.txt文件,文件内容如下
    file=c:\DBbackup\comwin_20040811.dmp
    userid=comwin2/comwin2@bfssys
    buffer=50000000
    grants=y
    indexes=y
    rows=y
    consistent=y
    constraints=y
    owner=comwin23 接着做成批处理文件backup.bat,内容如下:
    exp parfile=d:\backup\exp_comwin.txt
    最后,到控制面板的任务计划中设置为每天执行即可
      

  5.   

    樓主看看
    http://community.csdn.net/Expert/topic/3262/3262615.xml?temp=.7830622