As I recall it was # 1. The login is a member of the sysadmin server-level role.
I would like to try to simplify this discussion to clarify the root cause of the issue:
There are only two ways that a SQL Server login can be mapped to the DBO user in a database.
If you create or enable a geodatabase using the SDE login and the SDE login meets either or both of those criteria, then the geodatabase will be stored in the DBO schema instead of the SDE schema. If you want to have an SDE schema geodatabase, you need to start over. Ensure that the SDE login is not configured with either of the items above, and then create a new database and geodatabase.
If you created a geodatabase using the SDE login, and the geodatabase was correctly created in the SDE schema, but later the SDE login was configured to meet either or both of those criteria, the geodatabase will still be stored in the SDE schema. However, you will encounter issues when managing the geodatabase because SDE is no longer SDE, it is DBO. Ensure that the SDE login is not configured with either of the items above. Remove SDE from the sysadmin role, and/or change the ownership of the database to a user who can act as DBO in the database.
Thanks Chris- you're right this is an old post! So old in fact I changed jobs! But, maybe it'll help someone else who runs into the same problem....
I know this is an old post, but thought that I would add the solution to revert the promoted SDE user from dbo back to the sde schema - which happens when you've granted the SDE user sysadmin rights for whatever reason.
USE [your_database_name]
GO
ALTER AUTHORIZATION ON SCHEMA::[sde] TO [dbo]
DROP USER [sde]
CREATE USER [sde] FOR LOGIN [sde]
ALTER USER [sde] WITH DEFAULT_SCHEMA=[sde]
-- You don't have to give db_owner permissions to the SDE user, you can determine the permissions to give.
ALTER ROLE [db_owner] ADD MEMBER [sde]
ALTER AUTHORIZATION ON SCHEMA::[sde] TO [sde]
During the process the account might become disabled... you'll just have to enable it again.
This worked for me, and hope it works for anyone running into the same problem. This might not be the case, and for an issue of this magnitude you should first test the solution in a DEV and QA environment, and backup your data before making such changes.
Cheers,
Chris
Hi Joe,Do you mean that when you connect to the geodatabase in Desktop, you only see dbo.DEFAULT as the transactional version option? You restarted Desktop after re-creating your geodatabase, right? If you create a new spatial database connection, does it still show dbo.DEFAULT only? Hmmm; can't recall exactly; seems like I did though; that was yesterday. Another long day at a different client site today!And you did say you deleted the database from the SQL Server instance before you re-ran the Post Installation wizard. If you didn't completely get rid of the database and start from scratch, re-running the Post Installation wizard on the existing database wouldn't switch schemas. I seem to recall that when you delete a database in SQL Server, there's an option that asks if you want to restore from backup. Is it possible that was checked and, therefore, it restored a backup that already contained the ArcSDE geodatabase system tables? The databases are gone for sure; there is some perverse satisfaction in deleting those that cause pain. However, I just let the post install delete and recreate the 5151 instance.When you open the database in Management Studio, if the ArcSDE geodatabase system tables are shown to be in the dbo schema (i.e., they're named things like dbo.sde_layers), either try running the Post Installation wizard and provide a different name for the database, or drop the existing database, be sure it is gone from the SQL Server instance, and run the Post Installation wizard to re-create the database and geodatabase, specifying an sde-schema. I'll be back at this on Monday (today is Thursday). I'm not done with the project nor this thread by a long shot!-Kim
By default, if you selected SDE schema in the post installation, it would be sde.Default.
No, no! You *don't* want 'sde' in the Administrator or DBO groups, else SQL-Serverwill promote your 'sde' to DBO.- V
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.