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?
-
1ArcGIS 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– Vince2019年08月23日 11:06:38 +00:00Commented Aug 23, 2019 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– Miro2019年08月24日 14:42:03 +00:00Commented Aug 24, 2019 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– Miro2019年08月27日 00:12:37 +00:00Commented Aug 27, 2019 at 0:12
1 Answer 1
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:
Create sde file (Publisher database connection) for publisher in some desktop software (ArcMap, ArcGIS Pro...) which will be used for publishing
Create sde file on server using ArcPy. On Windows server:
- Run python command in command prompt / PowerShell (e.g. C:\python27\ArcGISx6410.7\python)
- Import arcpy and run Create ArcSDE Connection File:
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')
- 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
Explore related questions
See similar questions with these tags.