AnsweredAssumed Answered

Where Do i get the geodatabases Connection for Python script

Question asked by dllamasgmtgis-esridist Employee on Jun 27, 2019
Latest reply on Jul 2, 2019 by VRamalingam-esristaff

Hello, I am not good with python, I am new. I am trying to synchronize changes from a replica between databases and i want this to run automatically every day with a task scheduler. In esri help i found this sintaxis

Sintaxis

SynchronizeChanges_management (geodatabase_1, in_replica, geodatabase_2, in_direction, conflict_policy, conflict_definition, reconcile)

And I did this script:

message = "Sync replicas CRIMPRDB to cdprdb01...";print message
# Process: Synchronize Changes (80)
arcpy.SynchronizeChanges_management(crim-oradb-01-sde:oracle$crim-oradb-01/cdprdb, "MAPUSER.CD_PARCELAS", cdprdb01-sde:sqlserver:cdprdb01-cdprgis, "FROM_GEODATABASE1_TO_2", "IN_FAVOR_OF_GDB1", "BY_OBJECT", "DO_NOT_RECONCILE")
message = "---Sync de replica CRIMPRDB to cdprdb01 successful";print message

arcpy.AnalyzeDatasets_management(input_database="Database Connections/gisadmin@cdprdb01.sde", include_system="NO_SYSTEM", in_datasets="cdprgis.GISADMIN.Parcelario/cdprgis.GISADMIN.Parcelario;cdprgis.GISADMIN.Parcelario_Web/cdprgis.GISADMIN.ParcelasContactos;cdprgis.GISADMIN.Parcelario_Web/cdprgis.GISADMIN.ParcelasContactos04242019_1", analyze_base="ANALYZE_BASE", analyze_delta="NO_ANALYZE_DELTA", analyze_archive="NO_ANALYZE_ARCHIVE")
arcpy.Compress_management(in_workspace="Database Connections/sde@cdprdb01.sde")
arcpy.RebuildIndexes_management(input_database="Database Connections/gisadmin@cdprdb01.sde", include_system="NO_SYSTEM", in_datasets="cdprgis.GISADMIN.Parcelario/cdprgis.GISADMIN.Parcelario;cdprgis.GISADMIN.Parcelario_Web/cdprgis.GISADMIN.ParcelasContactos;cdprgis.GISADMIN.Parcelario_Web/cdprgis.GISADMIN.ParcelasContactos04242019_1", delta_only="ALL")
print"Indices Reconstruidos para Parcelario"
message = "--Replica Sync Completed Succesfully";print message

My doubt is with geodatabase 1 and 2 part, where do I get the connections? how do I write those?

I found this in my syn changes wizard and I wrote those, Is that correct? 

Thanks for your help!

 

Diego Llamas

George Thompson

Outcomes