You are here: > ESRI Forums > esri developer network (edn) forums > Thread Replies

ESRI Developer Network (EDN) Forums

EDN: Subscriptions and program information forum

Pre requisites to schedule Python scripts (...   Sheethal R A Sep 14, 2011
Report Inappropriate Content • Top • Print • Reply    
Subject Pre requisites to schedule Python scripts (Geoprocessing) in ArcSDE server 
Author Sheethal R A 
Date Sep 14, 2011 
Message Hi guys,

My requirement is somewhat as below :

A replica would be created between from an ArcSDE server to a remote server.
I have written a python script to synchronize changes between the ArcSDE server and the remote server.
Also I am calling a stored procedure from this python script to update some fields in the replica with a default string value.

And I need to schedule this python script from ArcSDE server. But the status of the scheduler is updated as "Could Not Start".
I am not getting to know the reason for failure.
If at all I can get to know the exact error, I can install supporting extensions for the same. 
 
My python script looks as below : 

IDLE 1.2.1      
>>> import arcgisscripting , sys, os
>>> gp = arcgisscripting.create(9.3)
>>> gp.AddToolbox("Data Management Tools.tbx")
>>> gp.SynchronizeChanges("Database Connections\UK Server 10.125.20.102.sde","SDE.BangToUK_Rep", "Database Connections\Bangalore Server 10.175.224.87.sde", "FROM_GEODATABASE2_TO_1", "IN_FAVOR_OF_GDB2", "BY_OBJECT","TRUE")

host = 'v-bnwsihsdv09.ihs.internal.corp'
    port = 1521
    dbase = 'iris21'
    login = 'sde'
    passwrd = 'sde'
    dsn = cx_Oracle.makedsn(host, port, dbase)
    connection = cx_Oracle.connect(login, passwrd, dsn)
c = connection.cursor()
result = c.execute("""UPDATE SDE_PRV_LIN_1_H1 SET USERNAME = 'IHS' WHERE USERNAME <> 'IHS'""")
result = c.fetchall()
print result
res = c.execute("""UPDATE SDE_PRV_LIN_1_H1 SET DESCRIPTION = 'www.ihs.com' WHERE DESCRIPTION <> 'www.ihs.com'""")
res = c.fetchall()
print res