0

I would like to register database with ArcGIS Server. I know it is done through ArcGIS Server Manager under Site / Data Stores / Register: Database.

I am also aware there can be different connection files (.sde or .odc) imported for Publisher database connection and Server database connection. I understand this option is primarily meant for access of different databases.

In my case I do need to access same database by both connections but Publisher database connection must be set through external IP (as desktop can only connect through external IP to DB server), while Server database connection through internal IP (ArcGIS Server can connect to DB Server only internally, can't see external IP). I hope till this point I get it right.

Now how do I create Server database connection (.sde file)? Is the only way to get .sde file (with internal IP) to install ArcGIS Desktop on the server machine? Is not that an awful thing to do to be able to create a tiny .sde file? Am I missing something?

  • 1
    ArcGIS Server installs include ArcPy, so you could just create connection files without Desktop. But the determination of whether the connection is equivalent is by string comparison, so I doubt your plan will work. Maybe if you have the fully qualified name on the server point to a different IP, in which case you can use the same file. – Vince Aug 23 at 11:06
  • @Vince thank you for ArcPy tip, I knew there must be a better way than installing desktop. With the domain/IPs it is a temporary solution which I believe we will sort out differently eventually. For now hopefully two different sde files will do. – Miro Aug 24 at 14:42
  • 1
    @Vince thank you, creating sde file on server with ArcPy, and using it as different "Server database connection" to "Publisher database connection" works perfectly fine. Going to turn this into an answer. – Miro Aug 27 at 0:12
0

As Vince suggested in his comment, it is possible to get sde file using ArcPy installed with ArcGIS Server.

So for complete setup of registering database which runs on database server accessed through different IP's (e.g. internal/external IP) from ArcGIS Server and clients (publishers) it is needed to:

  1. Create sde file (Publisher database connection) for publisher in some desktop software (ArcMap, ArcGIS Pro...) which will be used for publishing

  2. Create sde file on server using ArcPy. On Windows server:

Code example for MS SQL server connection running on the same machine (dev only, not recommended for production):

import arcpy
# CreateArcSDEConnectionFile(out_folder_path, out_name, server, service, {database}, {account_authentication}, {username}, {password}, {save_username_password}, {version}, {save_version_info})
arcpy.CreateArcSDEConnectionFile_management(r'c:\temp', 'arcgis_server_sde_file', '127.0.0.1', 'sde:sqlserver:127.0.0.1', 'database_name', 'DATABASE_AUTH', 'user_name', 'user_password', 'SAVE_USERNAME')
  1. Login into ArcGIS Server Manager, and under Site / Data Stores / Register: Database register database with the two different SDE files created above - unchecked Same as publisher database connection

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.