Select to view content in your preferred language

Create Enterprise Geodatabase in User Schema issue

3413
1
Jump to solution
01-31-2013 04:13 AM
TimDine
Frequent Contributor
I am attempting to setup ArcSDE 10.1 with a master geodatabase and multiple user schema geodatabases.  I am working with an enterprise Oracle server which is shared with multiple parts of the business.  As we have done in the past our DBAs have created the core table spaces and users in the database ahead of my geodatabase installation.  I was able to use the Enable Enterprise Geodatabase to create my master SDE geodatabase and I can connect to it without issue.  I now want to create my user schema geodatabases.  Those users have been created in the same way. 

I've tried Enable Enterprise Geodatabase which errors with a geodatabase already exists when I attempt to use it through a user geodatabase connection to the Oracle instance.  I assume this is because it already sees the master geodatabase.

I've tried the Create Enterprise Geodatabase tool which errors with 'bad login user'.  I'm assuming this is because I have not entered the sys password.  I do not want to enter the sys password, mostly because I don't have it and getting it from the DBAs is not possible.  I would also prefer not to need to engage them to type in a password for my testing ten times.  If I know it will work and it is the only way I would attempt it.

Thoughts?  Can I create enterprise geodatabase in a user schema without the sys password?  I used to do this with the sdesetup command, is that still possible with 10.1?
0 Kudos
1 Solution

Accepted Solutions
VinceAngelo
Esri Esteemed Contributor
Unfortunately, the design of the CreateEnterpriseGeodatabase_management tool
is such that you *must* use the 'sys' user as part of creation.  You can, however,
script the process in Python, so that the DBA only has to type the password once.

Here's a (modified) script I used to create some user-schema geodatabases
for client testing.

import datetime from datetime import datetime  import os import string  startT = datetime.now() print "Importing arcpy..." import arcpy print "\tElapsed: ", str(datetime.now() - startT)  # .. Permit clobber from arcpy import env env.overwriteOutput=True  # .. Create SDE connection tnsname       = "dbsid" c_folder        = r"C:\Projects\xx\Connections" c_name          = "xx-tmp.sde" c_server        = "ORACLE" c_instance      = "sde:oracle11g:"+tnsname c_authtype      = "DATABASE_AUTH" c_user          = "sde" c_pass          = "password" c_save          = "SAVE_USERNAME" c_database      = "" c_schema        = "SDE"  print "Connecting to schema 5161:%s..." % c_schema arcpy.CreateDatabaseConnection_management(                 c_folder,c_name,c_server,c_instance,c_authtype,                 c_user,c_pass,c_save,c_database,c_schema) print "\tElapsed: ", str(datetime.now() - startT) connWS = c_folder + "\\" + c_name desc = arcpy.Describe(connWS) if desc.currentRelease:         print "\tRelease is CURRENT (%s)" % desc.release arcpy.ClearWorkspaceCache_management(connWS)  # .. Create schema connections for user in range(1,11):         # .. Naming         owner = "owner"+string.zfill(user,2)         c_user = owner         c_pass = "password"+string.zfill(user,2)         c_schema = owner          # .. big block         try:                 # .. create schemaDB                 arcpy.CreateEnterpriseGeodatabase_management(                         "ORACLE",tnsname,"", "DATABASE_AUTH",                         "sys", "syspass", "SDE_SCHEMA",c_user,c_pass,                         "schema", r"C:\Temp\Server_Ent_Adv-10.1.ecp")                 for i in range(arcpy.GetMessageCount()):                         arcpy.AddReturnMessage(i)                 arcpy.AddMessage("+++++++++\n")                  # .. Construct workspace                 print "Connecting to schema 5161:%s..." % c_schema                 startT = datetime.now()                 arcpy.CreateDatabaseConnection_management(                         c_folder,c_name,c_server,c_instance,c_authtype,                         c_user,c_pass,c_save,c_database,c_schema)                 print "\tElapsed: ", str(datetime.now() - startT)                 connWS = c_folder + "\\" + c_name                  # .. Verify                 desc = arcpy.Describe(connWS)                 arcpy.ClearWorkspaceCache_management(connWS)                 if desc.currentRelease:                         print "\tRelease is CURRENT (%s)\n" % desc.release         except:                 for i in range(arcpy.GetMessageCount()):                         arcpy.AddReturnMessage(i)                 arcpy.AddMessage("--------!\n")                 break  # .. Delete connection file if os.path.isfile(connWS):         os.remove(connWS)  #EOF


You'd have to change the nature of the loop to iterate across the user names
and prompt for the SYS password no-echo, but runtime would be under a minute.

- V

View solution in original post

0 Kudos
1 Reply
VinceAngelo
Esri Esteemed Contributor
Unfortunately, the design of the CreateEnterpriseGeodatabase_management tool
is such that you *must* use the 'sys' user as part of creation.  You can, however,
script the process in Python, so that the DBA only has to type the password once.

Here's a (modified) script I used to create some user-schema geodatabases
for client testing.

import datetime from datetime import datetime  import os import string  startT = datetime.now() print "Importing arcpy..." import arcpy print "\tElapsed: ", str(datetime.now() - startT)  # .. Permit clobber from arcpy import env env.overwriteOutput=True  # .. Create SDE connection tnsname       = "dbsid" c_folder        = r"C:\Projects\xx\Connections" c_name          = "xx-tmp.sde" c_server        = "ORACLE" c_instance      = "sde:oracle11g:"+tnsname c_authtype      = "DATABASE_AUTH" c_user          = "sde" c_pass          = "password" c_save          = "SAVE_USERNAME" c_database      = "" c_schema        = "SDE"  print "Connecting to schema 5161:%s..." % c_schema arcpy.CreateDatabaseConnection_management(                 c_folder,c_name,c_server,c_instance,c_authtype,                 c_user,c_pass,c_save,c_database,c_schema) print "\tElapsed: ", str(datetime.now() - startT) connWS = c_folder + "\\" + c_name desc = arcpy.Describe(connWS) if desc.currentRelease:         print "\tRelease is CURRENT (%s)" % desc.release arcpy.ClearWorkspaceCache_management(connWS)  # .. Create schema connections for user in range(1,11):         # .. Naming         owner = "owner"+string.zfill(user,2)         c_user = owner         c_pass = "password"+string.zfill(user,2)         c_schema = owner          # .. big block         try:                 # .. create schemaDB                 arcpy.CreateEnterpriseGeodatabase_management(                         "ORACLE",tnsname,"", "DATABASE_AUTH",                         "sys", "syspass", "SDE_SCHEMA",c_user,c_pass,                         "schema", r"C:\Temp\Server_Ent_Adv-10.1.ecp")                 for i in range(arcpy.GetMessageCount()):                         arcpy.AddReturnMessage(i)                 arcpy.AddMessage("+++++++++\n")                  # .. Construct workspace                 print "Connecting to schema 5161:%s..." % c_schema                 startT = datetime.now()                 arcpy.CreateDatabaseConnection_management(                         c_folder,c_name,c_server,c_instance,c_authtype,                         c_user,c_pass,c_save,c_database,c_schema)                 print "\tElapsed: ", str(datetime.now() - startT)                 connWS = c_folder + "\\" + c_name                  # .. Verify                 desc = arcpy.Describe(connWS)                 arcpy.ClearWorkspaceCache_management(connWS)                 if desc.currentRelease:                         print "\tRelease is CURRENT (%s)\n" % desc.release         except:                 for i in range(arcpy.GetMessageCount()):                         arcpy.AddReturnMessage(i)                 arcpy.AddMessage("--------!\n")                 break  # .. Delete connection file if os.path.isfile(connWS):         os.remove(connWS)  #EOF


You'd have to change the nature of the loop to iterate across the user names
and prompt for the SYS password no-echo, but runtime would be under a minute.

- V
0 Kudos