AnsweredAssumed Answered

Enabling a SQL Server Database as Enterprise Geodatabase from arcpy in ArcGIS Server 10.6

Question asked by dwaipayana23 on Mar 19, 2018
Latest reply on Mar 26, 2018 by dwaipayana23

Hi all,

I tried enabling a SQL Server (Express Edition: 14.0.3022.28) database as an Enterprise Geodatabase from arcpy in ArcGIS Server (10.6 on Ubuntu 16.04 LTS) on Linux machine, which fails. Here goes the details:

 

 

I did the following to first create the Database Connection (.sde) file in ArcGIS Server machine's arcpy:

 

  • Created a database testsde in the SQL Server instane
  • Installed MS SQL Server ODBC client (v13.1) on the Linux machine where ArcGIS Server is installed.
  • Open Python interactive in ArcGIS Server machine: <Server Installation Directory>/tools/python
  • Executed the logic:
import arcpy

arcpy.CreateDatabaseConnection_management('<ArcGIS Installation Directory>/temp', 'sqlconn.sde', 'SQL_SERVER', '<host_ip>', 'DATABASE_AUTH', 'sa', '<password>', 'SAVE_USERNAME', 'testsde')

# N.B.: I've already copied the ArcGIS Server authorization file to /home/<user>/ directory

arcpy.EnableEnterpriseGeodatabase_management('<ArcGIS Installation Directory>/temp/sqlconn.sde', '/home/<user>/keycodes')

 

The code threw the following error:

 

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\ArcGIS\Server\ArcPy\arcpy\management.py", line 5311, in EnableEnterpriseGeodatabase
    raise e
arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000837: The workspace is not the correct workspace type.
Failed to execute (EnableEnterpriseGeodatabase).

 

Now, since the error said The workspace is not the correct workspace type, I checked the properties of the SDE file created using arcpy.Describe():

 

desc = arcpy.Describe('<path_to>/sqlconn.sde')

desc.workspaceType

desc.ConnectionProperties.is_geodatabase

 

 

Python threw the following error:

 

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: DescribeData: Method workspaceType does not exist

So, this did not work as well.

 

Does connecting to a SQL Server database work at all from ArcGIS Server on Linux? Can I enable SQL Server DB as an enterprise Geodatbase from ArcGIS Server on Linux?

 

Thank You for Your time.

 

(P.S.: Do let me now if you need further details to understand the questions.)

 

Regards,

Lakshmi Kanthan M.

Outcomes