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.