如何在vb.net中备份和还原Oracle数据库

问题描述:


我在vb.net中遇到备份和还原Oracle数据库的问题,
请帮助...........


I am facing problems to BackUp and Restore Oracle Database in vb.net,
Please Help...........

txtPwd =User Password
txtHS =Host String
filename =e.g. c:\BackupFile.dmp
 Collapse | Copy Code
<pre lang="vb">

Shell("exp " & txtUser.Text.ToString.Trim & "/" & txtPwd.Text.ToString & "@" & txtHS.Text.ToString & " buffer=4096 grants=Y file=" & filename, vbNormalFocus)



将上述代码写在按钮上执行.它从oracle数据库中备份一位用户的所有数据.

OR



Write above code on a button to execute. It takes backup of all data of one user from oracle database.

OR

StreamWriter sw = new StreamWriter("reports\\backup.bat");
string name = "backUP-"+".dmp";string code1 = "exp "+orclUser+"/"+orclPass+"@"+orclService+" file = Backup\\"+name+" ";sw.WriteLine(code1);
sw.Close();
string strFilePath = System.IO.Path.GetFullPath("C:\\backup.bat");ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo();psi.FileName = strFilePath ;
psi.Arguments = "1 2 3 4";
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo = psi;
p.EnableRaisingEvents = true;p.Start();


看看此链接- ^ ](此链接在C#中,但您应该可以转换为VB.Net)
Take a look at this links - http://rockingtechnology.blogspot.in/2011/06/oracle-backup-and-restore-code-in-cnet.html[^] (this link is in C# but you should be able to convert to VB.Net)