Select to view content in your preferred language

How to edit sde connection file

1642
5
02-15-2023 04:10 AM
JanisT
by
Emerging Contributor

How to edit sde connection file?

Is there a standalone program to edit sde connection file?

Before pro there was ArcCatalog that was able to do that.

We need a way to edit sde files on ArcGIS server, where we do not want to install a lot of GB of desktop software just to edit sde file.

Tags (3)
5 Replies
Robert_LeClair
Esri Esteemed Contributor

Janis - so when you refer to edit an *.sde connection, are you referring to this or something else?  Please advise.

0 Kudos
JanisT
by
Emerging Contributor

JanisT_0-1676892771091.png

Need this from ArcCatalog

0 Kudos
Robert_LeClair
Esri Esteemed Contributor

It's there.  See my graphic below.


sde_connections.JPG

JanisT
by
Emerging Contributor

>We need a way to edit sde files on ArcGIS server, where we do not want to install a lot of GB of

>desktopsoftware just to edit sde file.

The whole point of my question is, how to edit this without installing full ArcGIS Pro.

Is there some small utility or something to do this?

0 Kudos
Victor_Centella
Emerging Contributor

You can try to edit them using Python. To edit an .sde file without using ArcGIS Pro, you can use Python scripting along with ArcPy, which is a Python site package that provides a useful and productive way to perform geographic data analysis, data conversion, data management, and map automation with Python.

 

import arcpy

# Define the connection parameters
connection_properties = {
    "DATABASE": "your_database_name",
    "USER": "your_username",
    "PASSWORD": "your_password",
    "SERVER": "your_server_name",
    "INSTANCE": "sde:oracle11g:your_server_name",  # Adjust the instance string for Oracle
    "VERSION": "SDE.DEFAULT"
}

# Create a .sde connection file
sde_file = arcpy.CreateDatabaseConnection_management(
    out_folder_path="C:/path/to/save",  # Specify the folder path where you want to save the .sde file
    out_name="my_connection.sde",       # Specify the name for the .sde file
    database_platform="ORACLE",         # Change this to ORACLE
    instance=connection_properties["INSTANCE"],
    account_authentication="DATABASE_AUTH",
    username=connection_properties["USER"],
    password=connection_properties["PASSWORD"],
    save_user_pass="SAVE_USERNAME",
    database=connection_properties["DATABASE"],
    version_type="TRANSACTIONAL",
    version=connection_properties["VERSION"]
)

print(f".sde file created at: {sde_file}")



 

0 Kudos