Select to view content in your preferred language

Using Schemas on SDE 9.3.1 and PostgreSQL 8.3.11

2325
15
03-22-2011 09:46 AM
by Anonymous User
Not applicable
Original User: MacJeremy

Heya,

having some troubles with a setup. I have an SDE server (9.3.1) up and running on a Linux 32bit machine. My PostgreSQL (8.3.11) database server is running on another Linux machine (64bit). I have already 2 different applications with two different sde services and databases running. Everything works perfectly. Now I wanted to do some housekeeping in regard to the databases. I wanted to start using one database with one sde service and many user schemas through SDE. Why do i want to do that? Because of security, maintanance and many other reasons. And it was stated somewhere that this is the preferred way for SDE and ORACLE. I found a howto somewhere on the support site of ESRI. On further reading I also found how to do this with POSTGRESQL, not through the instance but through the user options on sdesetup, but not fully explained. So here are the steps I took that took me the furthest:

In PostgreSQL CLI (creating databases which are functioning and creating the schemas are very similar. If you need the steps I created the database with, in which I then created the schema, I'll post them here):

CREATE ROLE <schema_name> LOGIN PASSWORD '<pass>' SUPERUSER NOINHERIT CREATEDB;
CREATE SCHEMA <schema_name> AUTHORIZATION <schema_name>;
GRANT ALL ON SCHEMA <schema_name> to <schema_name>;
GRANT ALL ON SCHEMA <schema_name> TO sde;
GRANT USAGE ON SCHEMA <schema_name> TO public;

sdesetup -o install -d POSTGRESQL -D <main_database_where_the_schema_resides> -u <schema_name>


But unfortunatly halfway through the setup it breaks. After that when I restart the above sdesetup statement it breaks again but at a later point in the install, and so on and so on. I recon that I could get to succesfully installing the geodatabase if I would repeat the sdesetup call numerous times, but ... I would prefer a method that would get me there without errors

Here is a little tryout. I created a database "gismain", created the sde schema, and ran sdesetup. This I can start through the SDE service and connect with ArcCatalog. No problem there. Now the SDE service of gismain is stopped (tried it with on, but there I had more difficulties than with the services off), and used the steps of creating the schema above for a schema called "gp".

But sdesetup breaks with:
***********************************************************************************
sdesetup -o install -d POSTGRESQL -D gismain -u gp
Enter DBA password:

ESRI ArcSDE Server Setup Utility Tue Mar 22 18:33:45 2011
----------------------------------------------------------------
Install or update ST_GEOMETRY, ArcSDE, GDB schema objects:
  Are you sure? (Y/N): y
Creating ST_GEOMETRY and ArcSde schema.....
Successfully created ST_GEOMETRY and ArcSde schema.

Installing locators.....
Successfully installed locators.

Creating geodatabase schema.....
Error: DBMS object exists (-452).
Error: Error installing GDB schema.
Error: DBMS object exists (-452).
Error: Geodatabase schema object install not completed.
Check SDEHOME\etc\sde_setup.log or
    SDEHOME\etc\sde_dc<rdbms>.log for more details..
********************************************************************************



Whole logfiles of sdesetup log and postgres log are attached, where you can see that sdesetup is writing to the gp schema. It created four tables, and if I would restart sdesetup it would create another 3 or 4 tables. I tried many approches to solving this, checked role privileges and many other stuff, but no avail.

Help is needed and very much appreciated.

THX, in advance....
0 Kudos
15 Replies
VinceAngelo
Esri Esteemed Contributor
The ArcSDE software is installed (via 'sdesetup') as the SDE login/schema (only). This creates
metadata tables and installs the SDE.ST_GEOMETRY type.

All further data creation should be done as a user other than SDE. Create a login, create a schema
(with the same name as the login), grant the permissions, then create and populate tables.

- V
0 Kudos
by Anonymous User
Not applicable
Original User: kasi4188

Daniel,
To expand on Vince's post:
sde user/schema  in the database are used for the sde repository tables, the 40 tables and 300 some stored procedures that are placed in the db to make it spatial. That is all that the sde user should be used for.
Any loading of spatial data, viewing or editing should be done as users that you the admin create explicit in the RDBMS instance. You create the login, the schema in the db and add privileges to that user depending on what you need them to do.
An sde installation is not going to create other users besides the sde superuser, that is part of database administration and is left up to each individual dba to perform.
The sde for postgres installation comes with a tools folder, in that folder is a sample sql script, that gives you examples on how to create various users and the privileges they may need.
Sincerely,
Kasia
0 Kudos
DanielMrvos
Deactivated User
Just wanted to thank you 🙂

I have used the wrong methodology of creating geo-dbs. Though one thing is still bothering me. Now I have one sde service, the spatial data is not in the sde-schema anymore but by themselfs in their own schemas and as their own users, but still through arccatalog, connecting as a user you can see the feature datasets of the other users. You can't see whats inside or change them, but you can see them. i.e. if I have a schema test1 and user test1, where let's say I have a feature dataset "streets" and let's say I have schema test2 with user test2 with a feature dataset "rivers", if I connect, through arccatalog, as user test1 to the database test where the schemas test1 and test2 are, test1 can see the feature dataset of test2. I tried to revoke priviliges of the users respectively to their schemas but that didn't work. Any ideas about that?

Thanks again....
D.
0 Kudos
by Anonymous User
Not applicable
Original User: kasi4188

Daniel,
The issue with Datasets being visible and what they contain not, if you do not have read privileges on the data is a known issue, that has been around for a while.
As far as I know there is not much you can do about that.
The reason for the behavior is that a dataset is a visual representation of the relationship between the feature classes, it is not a db object in it's self, therefore db level privileges can not be issued against it.
Sincerely,
Kasia
0 Kudos
StephenHodge
Emerging Contributor
To take a slightly different tract with this, if you do have 2 schemas (the standard POSTGRES public and sde) and you have an application that writes to the tables in the public schema, is there a way for ArcCatalog to be able to view the contents of those tables?  I have tried unsuccessfully to register them through the command line and right clicking in ArcCatalog
0 Kudos
by Anonymous User
Not applicable
Original User: kasi4188

Stephen,
In ArcGIS 10, you will not be able to see data through ArcCatalog that is stored in the postgres public schema.
In general I would recommend that any spatial data stored in Postgres, reside in a user/schema explicitly created for that purpose, by an admin on that cluster. Please do not use the following users to store spatial data: postgres, sde, public.
You can create additional users with pgAdminIII or with a sql script provided in the ArcSDE installation.
In ArcGIS 10.1, a gp tool will be provided to create users, so it will be a little easier.
Sincerely,
Kasia
0 Kudos