When you use ArcGIS Server Cloud Builder on Amazon Web Services to launch an ArcGIS Server on Amazon Web Services (AWS) instance using the Esri AMI that includes Amazon Relational Database Service (RDS) for PostgreSQL, two enterprise geodatabases are created in the RDS instance. If you want additional geodatabases—for example, if you want to customize the name or location of the geodatabases you use, or you have multiple departments that maintain their own discrete data and require their own geodatabases—you can create additional databases using pgAdmin or SQL, create sde schemas in each database, and run the Enable Enterprise Geodatabase geoprocessing tool to create a geodatabase in each database.
When you manually configure your site using the AWS Management Console, no RDS instance, sde login role, databases, or geodatabases are created. If you want to use enterprise geodatabases in an Amazon RDS for PostgreSQL instance with one of these ArcGIS Server on Amazon Web Services instances, follow these steps:
- Create a PostgreSQL database instance and database from the Amazon RDS console.
See the Amazon Web Services (AWS) documentation for instructions on creating a PostgreSQL database RDS instance and database. A good place to start is with this tutorial: Creating a PostgreSQL DB Instance and Connecting to a Database on a PostgreSQL DB Instance.
- Load the PostGIS extension to the public schema of the database you created.
CREATE EXTENSION postgis SCHEMA public;
- Connect to your PostgreSQL RDS database instance from a SQL client. Connect as the master user.
- From the SQL client, create an sde login role in the PostgreSQL database cluster.
You must grant the sde login the rds_superuser role to allow it to enable geodatabase functionality in it.
CREATE ROLE sde WITH PASSWORD 'MeyeP@$$w0rd' LOGIN; GRANT rds_superuser TO sde;
- From the SQL client, create a schema named sde in the database you created, and make the sde login the owner of the sde schema.
CREATE SCHEMA sde; ALTER SCHEMA sde OWNER TO sde;
- Alter privileges and set the search path on the database.
ALTER DATABASE <database> SET search_path = "$user", public, sde; GRANT ALL ON DATABASE <database> TO public; GRANT ALL ON DATABASE <database> TO sde;
- Create a database connection from ArcGIS to the database. Connect using the sde login. You can create a database connection using one of the following methods:
- Add Database Connection in the Catalog window in ArcMap or ArcCatalog.
- Add a New Database Connection in the Project pane in ArcGIS Pro.
- Run the Create Database Connection geoprocessing tool in ArcMap, ArcCatalog, or ArcGIS Pro.
- Run a Python script that calls the Create Database Connection tool from a machine where ArcGIS for Server, ArcMap, or ArcGIS Pro is installed.
You will use the resultant database connection file (.sde) as input in the next step.
- Run the Enable Enterprise Geodatabase geoprocessing tool or a Python script that calls the tool to create a geodatabase in the database.
- Use SQL to create a login role and schema (with the same name) to load data to the geodatabase.
In this example, the user's name is dataloader.
CREATE ROLE dataloader WITH PASSWORD 'dkey2DL' LOGIN; CREATE SCHEMA dataloader; ALTER SCHEMA dataloader OWNER TO dataloader;
- Grant this login usage on the sde schema and grant the sde login usage on this new schema.
GRANT USAGE ON SCHEMA sde TO dataloader; GRANT USAGE ON SCHEMA dataloader TO sde;
- Create another database connection from ArcGIS, connecting as the login you created to load data.
- Register your geodatabase with your ArcGIS Server instance using this new database connection file.