<p>Hi all,<br><br>I'm about to implement a backup process using a VB script to putthe DBs on Read Only Mode, do the back up then switch the DBs backto readwrite mode. My question is what would happen if this scriptstarts when calculations or other batch files are running.<br>I just like to see the results of what would happen if the backupprocess started in the middle of a calculation or batch load, etc.Not sure if this will cause the backup process to fail or cause thebatch load to fail or both.<br>Any thoughts?<br><br>thanks<br></p>
Hi,<BR>Firstly, you can not put the app in archive mode (readonly) if any calc or data load is running on any of the app DB.<BR>I use following process to backup the DB :<BR>1. Logout all users<BR>2. Disable the connects to db<BR>3. Wait for 10 mins so that if any calc or dataload is running, it get completed <BR>4. Kill any requests running "forcefully"<BR>5. Start bkup<BR><BR>Once bkup is done allow connect to the app.<BR><BR>Hope this helps.<BR><BR>Regards,<BR>- Sandeep
If you try to put the database into backup mode while a calc is running, it will fail. Your coding to handle the error should pause for a duration and then try again. Once the calc is done, it will successfully put the database into backup mode and then you can proceed with the rest of your backup routine.<BR>
<p>Thanks Gary,<br><br>I know that my VBscript will fail if the MaxL command can not putthe DB on read only mode, I thought about it and thought the timemy script will run it's likely hard to see anyone doing such a tasklike calculation or load at that time. But when one of theapplication designers mentined that could be an error when thishappens, so we don't want to take any risk on this.<br>Since the rad only command is the first command that will touch thedatabase, is there anyway to to make it retry? I can Spool theerror and use sleep 600 (for 10 mns). I checked the MAxLdocumentation, but I couldn't find the way check for thaterror.<br>Anyone has any idea how make the MaxL script wait for sometime andretry? I don't really want to do any changes to my VBscript.<br>Thanks</p>
<p>Gary,<br><br>Thanks for yuor quick feedback.<br>Yes, I looked around for a way to do this with MaxL, the only thingis to spool errors. Even ESSCMD has something in handling CommandErrors in a script File, but it doesn't help much either.<br><br>So I guess I may have to fix this in my VBscript file.<br><br>Does anyone has a samples of : in case of a function that callsanother command script (CMD > M<axl )fails, in other owrdsthe read only cammand fails, it sleeps for few minutes thanretry?<br>I know it's a kind of scripting issue, but any thought would behelpful.<br><br>Thanks Gary,<br><br>Thank to all</p>
<p>Sandeep,<br><br>I can call the sleep command from MaxL: Shell sleep"600";<br><br>but that's not the issue. The problem is how to check if the erroroccurs, then sleep for sometime, then retry, in other words, if thebegin archive command fails the script should retry after sometimewhen the databases is freed and no caculations or loads are beingexecuted.<br><br>Thanks though.</p>
There is an error trapping function in MAXL -- I don't have the documentation with me now, but it uses an ifferror call.<BR><BR>It doesn't work for all functions, but it works in more places in every release. It is documented. I'll try to look it up when I get back to my work computer.
The error trapping is IfError. you can then goto a label to do something. The label must be after the statement there is no looping. So you could do something like on the error go to a label that uses the shell command to write an error file. In your batch script look for the existance of the error file. If it exists, delete it, and loop back to retry your command.