Using Schemas on SDE 9.3.1 and PostgreSQL 8.3.11

1430
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
by Anonymous User
Not applicable
Original User: MacJeremy

Any help ... anyone ... maybe ... please ?
0 Kudos
tKasiaTuszynska
New Contributor III
MacJeremy,
It looks like you are tying to run sdesetup against a non sde schema.
If that is the case, it is not supported.
The sde repository tables have to be owned by the sde user. In ArcSDE the schema name of the owner has to match the name of the owner. So your cmd should look like this:
sdesetup -o install -d POSTGRESQL -D gismain -u sde

Sincerely,
Kasia
0 Kudos
by Anonymous User
Not applicable
Original User: MacJeremy

MacJeremy,
It looks like you are tying to run sdesetup against a non sde schema.
If that is the case, it is not supported.
The sde repository tables have to be owned by the sde user. In ArcSDE the schema name of the owner has to match the name of the owner. So your cmd should look like this:
sdesetup -o install -d POSTGRESQL -D gismain -u sde

Sincerely,
Kasia


Thx for the reply.

But this means that the Schema can only be SDE.
So this ---> http://webhelp.esri.com/arcgisserver/9.3/java/index.htm#geodatabases/using_-2001045921.htm (Multiple geodatabases in one Oracle database) is not possible in PostgreSQL?
0 Kudos
VinceAngelo
Esri Esteemed Contributor
Oracle is the only ArcSDE-supported RDBMS that doesn't use a "multiple databases per server instance"
model, so storing multiple ArcSDE instances required multiple Oracle instances. User-schema geodatabases
are an attempt to reduce the cost of isolated ArcSDE instances on Oracle (though they're not really all that
isolated). Using PostgreSQL, you have the option of multiple databases, which are much more useful (and
truly independent) -- There's no reason to use the kludge when you have the real thing available.

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

Hi MacJeremy,
Yes, you are correct, ArcSDE for PostgreSQL does  not support the multiple gdb model on the schema level, for the reason that Vince provided, it is not necessary. You can have one instance of PostgreSQL, with multiple databases which can become geodatabases, in each of those databases the sde repository tables will have to reside in the sde schema.

Sincerely,
Kasia
0 Kudos
DanielMrvos
New Contributor
Thanks Vince and Kasia.

Just saw that ArcSDE 10 can use multiple users and schemas.
http://help.arcgis.com/en/geodatabase/10.0/install_guides/arcsde_for_postgresql_installation_and_upg...

Though a confirmation would be nice before I turn to 10.

The reason why I need multiple users and not just one, the sde user, is that I have multiple users editing different geodatabases. Until now I had to start several sde services to not allow that user1 can edit data on user2 geodb, and that only if I don't tell them the ports that the other sde services are running. And installing a new service is a great hassle, with /etc/services, dbinit.sde and such. This is like 1 hour for one service instance. Yes I can have multiple databases through one sde service, but they are all owned by the role "sde". And that is something that I want to avoid. I need multiple databases with different roles for sec. reasons.

I want to have one sde service through which users can connect with arccatalog but only to edit their db, and not the ones that they are not supposed to. And that can only be done if I have one service,  through which I can connect to diff databases with different user names (roles).

Thx again,
D
0 Kudos
by Anonymous User
Not applicable
Original User: vangelo

You're intermingling several different definitions of "schema".  There is no requirement for all
users to use the 'sde' login (and, in fact, doing so is a violation of best practice -- no SDE user
should *ever* own spatial data).  All versions of ArcSDE have always (well, since SDE 2.0 was
released) supported using multiple users with different accesses within a database.  There
is no need to move to 10.0 to gain this functionality (though you should move to 10 soon for
access to newer PostgreSQL builds).

- V
0 Kudos
tKasiaTuszynska
New Contributor III
Daniel,
It sounds like you are trying to improvise your own versioning environment. Have you looked at the geodatabase versioning environment?
you can set up versions, through which the data can be "seen" and edited, which will have the effect of isolating the changes made by editors to that specific version and than you can use visual tools to merge the changes from multiple editors (editing through multiple versions).

Esri has several courses on the topic and plenty of doc.

Sincerely,
Kasia
0 Kudos
by Anonymous User
Not applicable
Original User: MacJeremy


...and, in fact, doing so is a violation of best practice -- no SDE user
should *ever* own spatial data). 
- V


Then I'm missing something. Because that is what I want but can't get. When I'm using sdeinstall I can only use schema sde and user sde, because the username is the same as schema, and I can't use any other username, because I get the error that I stated in my earlier posts. And when I use sdeinstall, and I have to if I want to use sde as my database connection and not use Direct Connect, then the only user with whom I, or any other arcgisdesktop user,  can connect through sde to the database is the sde user. And as I can recall when using sdemon, the username and the schema in the database have to have the same name so creating a different user than the schema doesn't work, and if I try to create a different schema/user pair then sdeinstall has problems. But since I changed my gisserver to 10, a few days ago, I will also change sde to 10 and then will try if I can get the user seperations and will get back to you.
0 Kudos