Python Script uses Ole Db Connection does not work on production server....

Discussion created by AnastasiaAourik on Feb 20, 2012
Latest reply on Mar 21, 2016 by AnastasiaAourik
I have python scripts that read oracle table and recreates spatial featureclass (sde is  on sql server) each night...
My connection to oracle table 'must be' ole db connection since I have no sde on oracle.
First, I noticed my script does not work when deployed to a production server
windows 2003 x64 -
I saw oracle client installed on this machine, by someone else, before I got here.

sql plus works fine to connect, even oracle enterprise manager works fine,
but in ArccATALOG try to set up new old db connection and I can't set this up.

Would like to confirm that I can use oracle client 32 bit on windows 2003 64 bit machine
and would also like to confirm my assumption that since ArcCatalog/ArcMap.exe are 32-bit apps
I MUST use oracle client 32 bit...

Here's my python script...
# ---------------------------------------------------------------------------
# Created on: 2011-09-29 11:35:46.00000
#   (generated by ArcGIS/ModelBuilder)
# Description:
# Make Event Layer from ORACLE WCSS.BITREC_MV
# ---------------------------------------------------------------------------

# Import arcpy module
import arcpy

# Local variables:
WCSS_BITREC_MV = "Database Connections\\OLE DB ConnectionMYETAK.odc\\WCSS.BITREC_MV"
WCSS_Layer = "WCSS_Layer"
siiview_SIIGIS_WG_BITREC = "Database Connections\\Connection to sql04.sde\\siiview.SIIGIS.WELLSGENERAL\\siiview.SIIGIS.WG_BITREC"


    if arcpy.Exists(WCSS_BITREC_MV):
# Process: Make XY Event Layer
arcpy.AddMessage("WCSS.BITREC Materialized View Exists so Proceed")
arcpy.MakeXYEventLayer_management(WCSS_BITREC_MV, "longitude", "latitude", WCSS_Layer, "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];-400 -400 1000000000;-100000 10000;-100000 10000;8.98315284119522E-09;0.001;0.001;IsHighPrecision", "")
arcpy.AddMessage("Done MakeXY Event Layer")
if arcpy.Exists(WCSS_Layer):
  arcpy.AddMessage("Internal Scratch Layer Exists")
  # Process: Copy Features
  if arcpy.Exists(siiview_SIIGIS_WG_BITREC):
   arcpy.AddMessage("Delete Previous GIS FeatureClass")
   arcpy.AddMessage("Done Delete")
  arcpy.CopyFeatures_management(WCSS_Layer, siiview_SIIGIS_WG_BITREC, "", "0", "0", "0")
  arcpy.AddMessage("All Features Copied Done")

   arcpy.AddError("Python Messages: " + arcpy.GetMessages())

I welcome feedback.