When I create an SDE-file using arcpy I get the following warning:
WARNING 000565: Could not connect to server.
This is the appropriate code
temp = r'C:\Users\admin\AppData\Local\Temp' host = "myServer" sdeFileName = "mySdeFile.sde" service = "sde:oracle11g:myHost/myInstance:" + user arcpy.CreateArcSDEConnectionFile_management(temp, sdeFileName, myHost, service, username = user, password = password, version = version)
However the file itself was created successfully and I can even put it into ArcCatalogs sde-connections-folder and open it in ArcCatalog. Thus I doubt the error occurs because of any missing privileges.
As this message is quite generic and can be caused by many different problems I don´t want to swallow it.
Has anyone a solution or at least an explanation for this?
I am using ArcGIS 10.2 and Python 2.7 for 32bit.
EDIT: When I use
arcpy.CreateDatabaseConnection_management(temp, sdeFileName, "ORACLE", service, username = user, password = password, version = version)
instead it works without any problems.
However as I also have some customers that still use Application-Server-connections I cannot use this function as there´s no information on the actual host given within the
service-paramater as opposed to the DirectConnect-syntax, where the paramater includes both the host and the database-instance.
So what I need is a function that works with all the following inputs:
host = "myServer"
service = "5151:mySdeInstance"
service = "sde:oracle11g:tnsName:user"
tnsNamecorresponds the name for that connection within
service = "sde:oracle11g:myServer/user:user"