Subject Re: [IBO] Using IBOScrpt to update databases remotely?
Author Lee Jenkins
Helen Borrie wrote:
> At 04:25 PM 21/11/2003 -0500, you wrote:
>
>
>>Hey all,
>>
>>I've been using IBX to update remote database when updates are required.
>> I don't know if its me or the component, but sometimes the update
>>process just flakes out and we end up having to roll back everything and
>>the update can't happend until we remote in and fix everything manually.
>> Its a real pain.
>>
>>So, I'm thinking of taking a whack at it with IBOScript to see if I have
>>any better luck.
>>
>>We have a field in the database that is a numeric which indicates the
>>database's current version such as 6.6. The software downloads a script
>
>>from us that is modified with header info so that the software can parse
>
>>through. For instance:
>>
>>#5.5%
>>// Statements
>>#5.6%
>>// Statements
>>#5.7%
>>// Statements
>>#5.8%
>>// Statements
>>
>>The software loops through and tests when it comes to a "#", parses the
>>line to see if the numeric value is greater than the current database
>>version. If it is, then we read in everything past that, updating an
>>internal variable as lines with "#" are encountered. Finally, we run
>>the script and if everything goes ok, we update the current dataabase
>>version with the internal variable that was tracking the "#" lines with
>>the version.
>>
>>Anyone done anything like this?
>>
>>We have over 500 customers and it important that as updates to the
>>software are made that require metadata changes, we can successfully
>>update the database so that the operation does not require user invention.
>>
>>Any tips, advise, suggestions are appreciated.
>
>
> Any metadata changes affecting objects that are currently in use are going
> to make the script fail (except triggers and SPs - they will be
> deferred). The script will also fail in some cases where a change isn't
> committed before a later statement that relies on a dependency.
>
> To make it bombproof, they need to perform a database shutdown before
> running DDL. I know you don't want user intervention but you're probably
> going to need to print them a how-to for doing a gfix -shutdown and going
> online again after the script completes. You could put this in a command
> file.
>
> Helen

Yes, I've run into these problems in the past, even when using "Commit
Work;" after updating data during the script. There just seems to be no
simple way of doing this...

What is the best way to see if there are connections to the database so
that I can prevent the script from running?

--

Warm Regards,

Lee