Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Object required for (Wscript.sleep 15000)
Dear Howard,
I got your backup code from the Dizwell web site. It seems a very good way to perform backup via macro but it may contains some bug,which one can found initially when it run through the Excel.
For Example:
When we run the following macro in Excel, we got errors like:
I am using the following code, which checks you are in archivelog mode, and abort the entire thing if not. No point in trying to perform a hot backup unless you are.
I set the password for system according to my requirement.
For testing purpose I also put my database in no archive log and the
change the mode to archive log but I can’t able to run the macro
successfully.
I think we have to define some variables in order to run that macro
successfully.
Could you please suggest about it?
Regards
Benazir
CODE: Sub ArchivelogChk
'This module checks you are in archivelog mode, and aborts the entire
thing
'if not. No point in trying to perform a hot backup unless you are.
strFileOut="archive.sql" strBp="set trimspool on" & chr(10) & "set heading off" & chr(10)&"set feedback off" & chr(10) & "set echo off" & chr(10) & "spool arcchk.txt"
set objFS=CreateObject("Scripting.FileSystemObject") set objOutFile=objFS.OpenTextFile(strFileOut,2,1) strOutput=strBp & chr(10) & "select log_mode from v$database;" & chr(10) & "spool off" & chr(10) & "exit" objOutFile.WriteLine strOutput Set WshShell=CreateObject("WScript.Shell") WshShell.Run "sqlplus system/manager @archive.sql" Wscript.sleep 15000 strArchive="arcchk.txt" set objArchive=objFS.OpenTextFile(strArchive,1,0) While Not objArchive.AtEndOfStream strInput=objArchive.ReadLine if strInput="" then else If strInput<>"ARCHIVELOG" Then title = "Fatal Error!" Wscript.Echo "Not in Archivelog Mode! Hot Backups not possible! Aborting!" set objFile=Nothing set objOutFile=Nothing set objArchive=Nothing set objFS=CreateObject("Scripting.FileSystemObject") objFS.DeleteFile "arcchk.txt" objFS.DeleteFile "archive.sql" Wscript.Quit 1 End If End If wend set objFile=Nothing set objOutFile=Nothing set objArchive=Nothing
End Sub Received on Wed May 05 2004 - 02:14:35 CDT