1

I'm using ArcGIS 10.0, and I've already created my database using "ArcSDE for PostgreSQL Post installation" ..

My database is successfully created in PostgreSQL and now that I'm trying to create a spatial database connection from ArcMap, so I went to :

ArcCatalog ==> Database connections ==> Add spatial Database connection..

I've filled all the textboxes with the needed information and when I test the connexion before I submit, I get this error :

Failed to connect to the specified server.

Entry for SDE instance not found in services file.

Although I think I've provided the right information as below :

Server : localhost

Service : sde:postgres:localhost

Database : my_project

  • are you trying to connect on the same computer that postgres is installed on? – Michael Stimson Jun 14 '14 at 5:03
1

Your Direct Connect database reference is incorrect -- ArcSDE expects "sde:postgresql:hostname" for PostgreSQL, so it's falling back to a network services entry, and not finding that either.

The syntax is much easier at 10.1 and 10.2, since the "sde:rdbmskey:options" instance is replaced with a dynamic form.

  • Thank you for your response @Vince.. I've corrected it but I still have the same error, what could be wrong ? – GeoSal Jun 14 '14 at 10:04
1

It's talking about the services file C:\WINDOWS\system32\drivers\etc\services:

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This file contains port numbers for well-known services defined by IANA
#
# Format:
#
# <service name>  <port number>/<protocol>  [aliases...]   [#<comment>]
#

echo                7/tcp
echo                7/udp
discard             9/tcp    sink null
discard             9/udp    sink null
systat             11/tcp    users                  #Active users
systat             11/tcp    users                  #Active users
daytime            13/tcp
daytime            13/udp
qotd               17/tcp    quote                  #Quote of the day
qotd               17/udp    quote                  #Quote of the day

add the line ESRI_SDE <PORT>/TCP ESRI_SDE_CONNECTION at the end of the file - substitute your port number of course. I had issues editing this on win 7 as it's a protected system file, it wouldn't let me overwrite, I had to save as text, rename the services to services.old and then services.txt to services. Note services has no extension.

This entry should be on both sides, so check that it's in your server as well. This instructs windows as to what ports to listen to, which could be for security reasons but either way if it's not in the list windows wont communicate over it.

ESRI reccomends the direct connection to SDE rather than the services connection, however the client files are not installed by default, you may recieve an error message: ERROR .. Cursor_Tuple_Fraction... If this occurs you need to get these from your ESRI global account \ software download \ DBMS client files and follow the install directions

Here is the contents of the batch files. Assuming DBname is set to the name of the database, host is set to the computername and Port is set to the port you want to use. Passwords and paths are masked, use your own. The batch file should be run from the sdehome\bin directory or the system may not find the programs to run.

Set your parameters by using set param= like this:

set DBname=sde
set host=fred
set port=9999

Don't use those parameters, they're fake. You need to put your own parameters in. Note also there is no spaces between the parameter and its value.

SDEsetup -o install -d POSTGRESQL -u sde -p ############# -D %DBname% -l c:\path\to\license.file
:: now ready for direct connection

:: write to the SDE services and System Services the port numbers
echo sde_%DBname% %Port%/tcp #ArcSDE for PostgreSQL on %DBname% >> %sdehome%etc\services.sde
echo sde_%DBname% %Port%/tcp #ArcSDE for PostgreSQL on %DBname% >> SystemServices=%SystemRoot%\system32\drivers\etc\services

:: create the DBinit for this service
:: double arrows append to the file
echo set PGHOST = %host% > %sdehome%etc\dbinit_sde_%DBname%.sde
echo set PGPORT = %Port% >> %sdehome%etc\dbinit_sde_%DBname%.sde
echo set SDE_DATABASE = %DBname% >> %sdehome%etc\dbinit_sde_%DBname%.sde

:: register the service
sdeservice -o create -d POSTGRESQL -p ############# -i sde_%DBname% -s %host%
:: Set the ADMIN_DATABASE for this service
sdeservice -o modify -r ADMIN_DATABASE -v %DBname% -d postgresql -i sde_%DBname% -p ############# 

As you can see there's a lot more to creating a service. It needs to be registered in the SDE services, system services and a dbinit file created. If you put this into a batch file you can change the parameters. Note: 5151 is the default SDE port, each new database MUST have a new port number. I googled for a port list and found some free space in the high numbers but later abandoned the use of services in favor of the less complicated direct connection.

  • Thank you so much for your response @Michael Miles-Stimson I will try that and see if it solves the problem – GeoSal Jun 14 '14 at 10:08
  • Please refer my previous question, are you trying to connect on the same computer postgresql is installed on? – Michael Stimson Jun 14 '14 at 10:10
  • I just edited the services file and I actually found this line : esri_sde 5151/tcp #ArcSDE for PostgreSQL but when I checked in PostgreSQL I found that my port was 5432, so I changed that.. I've retested the database connection and yet I still have the same error :( – GeoSal Jun 14 '14 at 10:16
  • Yes I'm tryin to connect on the same computer – GeoSal Jun 14 '14 at 10:17
  • 1
    I agree that you're lost. At this point you should uninstall all the software and start over again. Next time, do not change any port numbers from their defaults, and do not bother trying to install an ArcSDE service. All you were missing was a proper pg_hba.conf entry, which will probably involve whatever network you are on besides loopback (127.0.0.1). At this point, talking to Tech Support is strongly advised. – Vince Jun 14 '14 at 21:13

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.