Oracle数据库导出命令EXP写入批处理文件不能运行! 10
Oracle数据库导出命令EXP写入批处理文件不能运行!直接在运行CMD里用命令:expsystem/manager@basefile=c:\back.dmp可以正常运行...
Oracle数据库导出命令EXP写入批处理文件不能运行!
直接在运行CMD里用命令:
exp system/manager@base file=c:\back.dmp
可以正常运行
但是这句命令写入批处理文件里 执行却没反应 和解啊?! 展开
直接在运行CMD里用命令:
exp system/manager@base file=c:\back.dmp
可以正常运行
但是这句命令写入批处理文件里 执行却没反应 和解啊?! 展开
1个回答
展开全部
你分别建如下三个文件,执行OracleBackup.bat,就可以备份了。
1、exp.txt
userid=system/system@ordb
owner=scott
INDEXES=y
grants=y
rows=y
constraints=y
compress=N
2、OracleBackup.bat
OracleBackup.vbs
3、OracleBackup.vbs
Option Explicit
On Error Resume Next
Dim fname, tnow, cmd
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
'调整备份文件名
tnow = Now()
fname = Year(tNow) & FormatNumber(Month(tNow)/100,2,false) & FormatNumber(Day(tNow)/100,2,false) & FormatDateTime(tNow,3)
fname = Replace(Replace(fName,".",""),":","")
cmd = "exp log=../backup/" & fname & ".log file=../backup/" & fname & ".dmp parfile=exp.txt"
'fname = Date
'cmd = "exp log=../backup/" & fname & "_OracleDB_Bak.log file=../backup/" & fname & "_OracleDB_Bak.dmp parfile=exp.txt"
WshShell.run cmd
Set WshShell = Nothing
'WScript.Echo cmd
1、exp.txt
userid=system/system@ordb
owner=scott
INDEXES=y
grants=y
rows=y
constraints=y
compress=N
2、OracleBackup.bat
OracleBackup.vbs
3、OracleBackup.vbs
Option Explicit
On Error Resume Next
Dim fname, tnow, cmd
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
'调整备份文件名
tnow = Now()
fname = Year(tNow) & FormatNumber(Month(tNow)/100,2,false) & FormatNumber(Day(tNow)/100,2,false) & FormatDateTime(tNow,3)
fname = Replace(Replace(fName,".",""),":","")
cmd = "exp log=../backup/" & fname & ".log file=../backup/" & fname & ".dmp parfile=exp.txt"
'fname = Date
'cmd = "exp log=../backup/" & fname & "_OracleDB_Bak.log file=../backup/" & fname & "_OracleDB_Bak.dmp parfile=exp.txt"
WshShell.run cmd
Set WshShell = Nothing
'WScript.Echo cmd
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询