execute in the context of ArcCatalog? (URGENT)

Discussion created by muhannad.shabaitah-gistec-esridist on Jul 27, 2012
Good day,

I am facing kind of a strange issue, I have a Python script that migrates data sequentially from an earlier version of SDE 9.1 to 10, like the below:
1)execute an SQL file in an external batch file
2)import data into Oracle 11g
3)execute upgrade to 9.3.1 (using the sde setup in a batch file)
4)migrate to 10 using arcpy.upgradeGeodatabase_management()

now the problem is it fails in step # 4 when executed through the script with the error "unable to pause the database, there are other active connections!", but at this point if I execute this line in Arccatalog's Python window, it works fine.

so in the attempt to solve the problem, I have rewritten the upgrade to 10 part in ArcObjects (using GeoProcessor & UpgradeGdb classes, compiled to an exe) & called it using subprocess instead of arcpy's function in the script but fails with a COM error when it is just about to perform the upgrade.

now the question is, what is the difference between calling the upgrade function in ArcCatalog or outside it? can I "simulate" ArcCatalog session in the external script to solve this issue?

what do you suggest & thanks in advance.