Optional EGDB management functionality
The enterprise geodatabase (EGDB) Amazon Machine Instance (AMI) does not require any configuration before you can access it from an ArcGIS Server AMI instance. However, you can perform some administration tasks, such as creating another geodatabase, creating new roles or groups, or moving data between EGDB instances, if your workflow requires it. Listed here are some of these optional advanced administration tasks, tools used to perform them, and links to documentation with further instructions.
Manage login roles
EGDB AMI comes with default roles to administer, load, and view spatial data. (See What's in the EGDB AMI? for a list of these default roles.) You may require additional roles to manage your spatial data. For example, you may want each person who connects to the EGDB instance to use his or her own login role. In that case, you need to add new login roles to the PostgreSQL database cluster and assign them specific permissions. If you have many login users, you might want to create group roles, assign the permissions to the group roles, and grant the group roles to specific login roles.
A sample script is provided under the ArcSDE installation directory (%SDEHOME%): C:\Program Files (x86)\ArcGIS\ArcSDE\pgexe. You can modify this script and run it using PostgreSQL psql tools to create new login and group roles or change permissions on existing roles.
For more information on managing login and group roles in PostgreSQL, see the Database Roles and Privileges chapter in the PostgreSQL documentation at http://www.postgresql.org/docs/8.3/interactive/user-manag.html.
Create additional geodatabases
The EGDB instance comes with a geodatabase named sdegdb. To create additional geodatabases—for example, if you want a geodatabase with a different name than sdegdb or you require additional geodatabases for different services or applications to access—you can use the Create ArcSDE Geodatabase wizard.
Run the wizard on your EGDB instance server, providing the information requested. After the additional geodatabase is created, connect to it in pgAdmin III and add any schemas you require.
Register tables with ArcSDE and the geodatabase
You might use SQL or another client to create tables in the PostgreSQL database. You have the option to register those tables with ArcSDE and the geodatabase to use geodatabase functionality such as replication. There are two administration command line tools provided with ArcSDE—sdelayer and sdetable—to register tables with a spatial column or those without a spatial column, respectively. Once registered with ArcSDE, use the ArcGIS Desktop client on the ArcGIS Server instance to register the table with the geodatabase.
See Registering tables to be used by ArcGIS Desktop in the ArcGIS online help for instructions. For more information on the sdelayer or sdetable commands, see the ArcSDE Administration Command Reference on the EGDB instance (Start > ArcGIS > ArcSDE > Command Reference).
Move enterprise data between EGDB instances
The EGDB AMI PostgreSQL database cluster uses a separate elastic block storage location for the PostgreSQL data location (also referred to as PGDATA). Therefore, the PostgreSQL software is stored in a different location than the data.
The PGDATA directory contains information about the PostgreSQL database cluster including information about the master system catalog and database data files. It can be moved around and used by different PostgreSQL database clusters as long as the PostgreSQL database clusters are at the same release and you follow certain guidelines.
PostgreSQL allows you to point a server to a preexisting PGDATA directory. This allows you to make a snapshot of data on one database cluster and start another PostgreSQL database cluster on another EDGB instance with the same data in a very short time. Some key things to note when moving the data from one location to another are
- The PostgreSQL service for the database cluster containing the existing data must be stopped before copying the data to the new PostgreSQL server.
- The postgres system user must be given full privileges to the copied PGDATA directory.
- Care should be taken that the tablespace location on the target instance machine is the same as the tablespace location of the source instance machine. For example, if a tablespace was created on e:\tablespaces on the source machine, the tablespace directory must be copied to e:\tablespace on the target machine.
If you have PostGIS installed in your local PostgreSQL server instance, you must also install PostGIS on your PostgreSQL server Amazon EC2 instance before you move the PGDATA directory.
If tablespaces are created under the d:\pgdata directory that is set up as part of the EGDB AMI, copying the PGDATA directory between EGDB instances is much simpler.
There is an article on the PostgreSQL wiki page—Change the default PGDATA directory on Windows—that explains how the PGDATA directory can be moved.
Install PostGIS
ESRI supports the use of the PostGIS geometry type in ArcSDE geodatabases. You can download a supported version of PostGIS and install it on your EGDB server. See the ArcGIS Server System Requirements page on the ESRI Resource Center for the version of PostGIS supported with the version AMI you are using.
To use PostGIS geometry, the database that contains your geodatabase must be enabled to use PostGIS. Since PostGIS is not part of the basic AMI, the default geodatabase is not enabled to use PostGIS. Therefore, after you install PostGIS, you must enable your geodatabase to use it. Once it is enabled, new data you add to the geodatabase can use the PostGIS geometry type by specifying the PG_GEOMETRY configuration keyword when you create or import the data. Existing data continues to use the ST_Geometry storage type.
After you have installed PostGIS and enabled a database to use it, you may want to create your own AMI to preserve the current state of your machine. See Creating your own ArcGIS Server or EGDB AMI for more information.
Tune EGDB or PostgreSQL configuration settings
In most cases, the default settings for the EGDB configuration are sufficient. However, if you have a more complex system with many users and large amounts of data and are using multiple EBS volumes, you have the option to alter the configuration of the geodatabase and the PostgreSQL database cluster.
The PostgreSQL database cluster installed as part of EGDB AMI has been configured for an Amazon standard large instance (7.5 GB memory). However, you may choose a different EGDB AMI type with a larger memory footprint or have a different workflow for which you require nondefault PostgreSQL configuration settings. In either of those cases, you may need to modify PostgreSQL configuration parameters, such as shared_buffers, work_mem, or effective cache size in the postgresql.conf file, located under PGDATA directory to meet their workflow. Refer to the server configuration section of the PostgreSQL documentation at http://www.postgresql.org/docs/8.3/static/runtime-config.html for more information.
You can also customize your ArcSDE geodatabase to improve performance and scalability by altering how ArcSDE geodatabase data is stored. To do this, change configuration keywords and parameters in the sde_dbtune geodatabase table using the sdedbtune ArcSDE command line administration tool. This tool is installed on the EGDB instance in the %SDEHOME% directory and is accessed from an MS-DOS prompt. For information on configuration keywords and parameters, see DBTUNE configuration keywords and DBTUNE configuration parameter name-configuration string pairs in the ArcGIS Server or ArcGIS Desktop Web help. For information on using the sdedbtune tool, see the ArcSDE Administration Command Reference on the EGDB instance (Start > ArcGIS > ArcSDE > Command Reference).