<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Create Enterprise Geodatabase with arcpy - Invalid license file provided! in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/create-enterprise-geodatabase-with-arcpy-invalid/m-p/520967#M29646</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does the same license file work through the Toolbox utility?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is really something best taken to Tech Support and/or Customer Service,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;since no one here can (or should) verify your license file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- V&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Sep 2012 12:19:23 GMT</pubDate>
    <dc:creator>VinceAngelo</dc:creator>
    <dc:date>2012-09-10T12:19:23Z</dc:date>
    <item>
      <title>Create Enterprise Geodatabase with arcpy - Invalid license file provided!</title>
      <link>https://community.esri.com/t5/data-management-questions/create-enterprise-geodatabase-with-arcpy-invalid/m-p/520966#M29645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi. I'm trying to create geodatabase in ArcGIS for Server enterprise with arcpy script. But it's falling with exception Invalid license file provided. Please provide an ArcGIS for Server enterprise keycodes file!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But i've got licenced ArcGis for Server enterprise!!! I can't understand why this script is not working!?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
"""
Name: create_enterprise_gdb.py
Description: Provide connection information to a DBMS instance and create an enterprise geodatabase.
Type&amp;nbsp; create_enterprise_gdb.py -h or create_enterprise_gdb.py --help for usage
Author: Esri
"""

# Import system modules
import arcpy, os, optparse, sys


# Define usage and version
parser = optparse.OptionParser(usage = "usage: %prog [Options]", version="%prog 1.0 for 10.1 release")

#Define help and options
parser.add_option ("--DBMS", dest="Database_type", type="choice", choices=['SQLSERVER', 'ORACLE', 'POSTGRESQL', ''], default="", help="Type of enterprise DBMS:&amp;nbsp; SQLSERVER, ORACLE, or POSTGRESQL.")&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
parser.add_option ("-i", dest="Instance", type="string", default="", help="DBMS instance name")
parser.add_option ("-D", dest="Database", type="string", default="none", help="Database name:&amp;nbsp; Not required for Oracle")
parser.add_option ("--auth", dest="Account_authentication", type ="choice", choices=['DATABASE_AUTH', 'OPERATING_SYSTEM_AUTH'], default='DATABASE_AUTH', help="Authentication type options (case-sensitive):&amp;nbsp; DATABASE_AUTH, OPERATING_SYSTEM_AUTH.&amp;nbsp; Default=DATABASE_AUTH")
parser.add_option ("-U", dest="Dbms_admin", type="string", default="", help="DBMS administrator user")
parser.add_option ("-P", dest="Dbms_admin_pwd", type="string", default="", help="DBMS administrator password")
parser.add_option ("--schema", dest="Schema_type", type="choice", choices=['SDE_SCHEMA', 'DBO_SCHEMA'], default="SDE_SCHEMA", help="Schema Type for SQL Server geodatabase, SDE or DBO. Default=SDE_SCHEMA")
parser.add_option ("-u", dest="Gdb_admin", type="string", default="", help="Geodatabase administrator user name")
parser.add_option ("-p", dest="Gdb_admin_pwd", type="string", default="", help="Geodatabase administrator password")
parser.add_option ("-t", dest="Tablespace", type="string", default="", help="Tablespace name")
parser.add_option ("-l", dest="Authorization_file", type="string", default="", help="Full path and name of authorization file")
# Check if value entered for option
try:
 (options, args) = parser.parse_args()

 
 #Check if no system arguments (options) entered
 if len(sys.argv) == 1:
&amp;nbsp; print "%s: error: %s\n" % (sys.argv[0], "No command options given")
&amp;nbsp; parser.print_help()
&amp;nbsp; sys.exit(3)

 #Usage parameters for spatial database connection
 database_type = options.Database_type.upper()
 instance = options.Instance
 database = options.Database.lower() 
 account_authentication = options.Account_authentication.upper()
 dbms_admin = options.Dbms_admin
 dbms_admin_pwd = options.Dbms_admin_pwd
 schema_type = options.Schema_type.upper()
 gdb_admin = options.Gdb_admin
 gdb_admin_pwd = options.Gdb_admin_pwd 
 tablespace = options.Tablespace
 license = options.Authorization_file
 
 
 if (database_type == "SQLSERVER"):
&amp;nbsp; database_type = "SQL_SERVER"
 
 if( database_type ==""): 
&amp;nbsp; print " \n%s: error: \n%s\n" % (sys.argv[0], "DBMS type (--DBMS) must be specified.")
&amp;nbsp; parser.print_help()
&amp;nbsp; sys.exit(3)&amp;nbsp; 
&amp;nbsp; 
 if (license == ""):
&amp;nbsp; print " \n%s: error: \n%s\n" % (sys.argv[0], "Authorization file (-l) must be specified.")
&amp;nbsp; parser.print_help()
&amp;nbsp; sys.exit(3)&amp;nbsp;&amp;nbsp; 
 
 if(database_type == "SQL_SERVER"):
&amp;nbsp; if(schema_type == "SDE_SCHEMA" and gdb_admin.lower() != "sde"):
&amp;nbsp;&amp;nbsp; print "\n%s: error: %s\n" % (sys.argv[0], "To create SDE schema on SQL Server, geodatabase administrator must be SDE.")
&amp;nbsp;&amp;nbsp; sys.exit(3)
&amp;nbsp; if (schema_type == "DBO_SCHEMA" and gdb_admin != ""):
&amp;nbsp;&amp;nbsp; print "\nWarning: %s\n" % ("Ignoring geodatabase administrator specified when creating DBO schema...")
&amp;nbsp; if( account_authentication == "DATABASE_AUTH" and dbms_admin == ""):
&amp;nbsp;&amp;nbsp; print "\n%s: error: %s\n" % (sys.argv[0], "DBMS administrator must be specified with database authentication")
&amp;nbsp;&amp;nbsp; sys.exit(3)
&amp;nbsp; if( account_authentication == "OPERATING_SYSTEM_AUTH" and dbms_admin != ""):
&amp;nbsp;&amp;nbsp; print "\nWarning: %s\n" % ("Ignoring DBMS administrator specified when using operating system authentication...") 
 else:
&amp;nbsp; if (schema_type == "DBO_SCHEMA"):
&amp;nbsp;&amp;nbsp; print "\nWarning: %s %s, %s\n" % ("Only SDE schema is supported on", database_type, "switching to SDE schema..." )
&amp;nbsp;&amp;nbsp; 
&amp;nbsp; if( gdb_admin.lower() == ""):
&amp;nbsp;&amp;nbsp; print "\n%s: error: %s\n" % (sys.argv[0], "Geodatabase administrator must be specified.")
&amp;nbsp;&amp;nbsp; sys.exit(3)

&amp;nbsp; if( gdb_admin.lower() != "sde"):
&amp;nbsp;&amp;nbsp; if (database_type == "ORACLE"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "\nGeodatabase admin user is not SDE, creating user schema geodatabase on Oracle...\n"
&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.exit(3)
&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "\n%s: error: %s for %s.\n" % (sys.argv[0], "Geodatabase administrator must be SDE", database_type)
&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.exit(3)
&amp;nbsp;&amp;nbsp; 
&amp;nbsp; if( dbms_admin == ""):
&amp;nbsp;&amp;nbsp; print "\n%s: error: %s\n" % (sys.argv[0], "DBMS administrator must be specified!")
&amp;nbsp;&amp;nbsp; sys.exit(3)

&amp;nbsp; if (account_authentication == "OPERATING_SYSTEM_AUTH"):
&amp;nbsp;&amp;nbsp; print "Warning: %s %s, %s\n" % ("Only database authentication is supported on", database_type, "switching to database authentication..." )

 # Get the current product license
 product_license=arcpy.ProductInfo()
 
 
 # Checks required license level
 if product_license.upper() == "ARCVIEW" or product_license.upper() == 'ENGINE':
&amp;nbsp; print "\n" + product_license + " license found!" + " Creating an enterprise geodatabase requires an ArcGIS for Desktop Standard or Advanced, ArcGIS Engine with the Geodatabase Update extension, or ArcGIS for Server license."
&amp;nbsp; sys.exit("Re-authorize ArcGIS before creating enterprise geodatabase.")
 else:
&amp;nbsp; print "\n" + product_license + " license available!&amp;nbsp; Continuing to create..."
&amp;nbsp; arcpy.AddMessage("+++++++++")
 
 
 try:
&amp;nbsp; print "Creating enterprise geodatabase...\n"
&amp;nbsp; arcpy.CreateEnterpriseGeodatabase_management(database_platform=database_type,instance_name=instance, database_name=database, account_authentication=account_authentication, database_admin=dbms_admin, database_admin_password=dbms_admin_pwd, sde_schema=schema_type, gdb_admin_name=gdb_admin, gdb_admin_password=gdb_admin_pwd, tablespace_name=tablespace, authorization_file=license)
&amp;nbsp; for i in range(arcpy.GetMessageCount()):
&amp;nbsp;&amp;nbsp; arcpy.AddReturnMessage(i)
&amp;nbsp; arcpy.AddMessage("+++++++++\n")
 except:
&amp;nbsp; for i in range(arcpy.GetMessageCount()):
&amp;nbsp;&amp;nbsp; arcpy.AddReturnMessage(i)
&amp;nbsp;&amp;nbsp; 
#Check if no value entered for option 
except SystemExit as e:
 if e.code == 2:
&amp;nbsp; parser.usage = ""
&amp;nbsp; print "\n"
&amp;nbsp; parser.print_help()&amp;nbsp;&amp;nbsp; 
&amp;nbsp; parser.exit(2)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is output of the execution of above python script:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
C:\Python27\ArcGISx6410.1&amp;gt;python createArcgisDatabase.py --DBMS=SQLSERVER -i ARC
GISSQLSERVER -D kostroma -U sa -P 112 -u sde -l C:\Program Files\ESRI\License10.
1\sysgen\keycodes

ArcServer license available!&amp;nbsp; Continuing to create...
+++++++++
Creating enterprise geodatabase...

Executing: CreateEnterpriseGeodatabase SQL_Server ARCGISSQLSERVER kostroma DATAB
ASE_AUTH sa ***** SDE_SCHEMA sde # # C:\Program
Start Time: Mon Sep 10 16:36:42 2012
ERROR: Failed to execute. Parameters are not valid.
ERROR: Invalid license file provided. Please provide an ArcGIS for Server enterp
rise keycodes file.
ERROR: Failed to execute (CreateEnterpriseGeodatabase).
Failed at Mon Sep 10 16:36:42 2012 (Elapsed Time: 0,00 seconds)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will appreciate any help=)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:43:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/create-enterprise-geodatabase-with-arcpy-invalid/m-p/520966#M29645</guid>
      <dc:creator>VasiliiSelivanov</dc:creator>
      <dc:date>2021-12-11T22:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: Create Enterprise Geodatabase with arcpy - Invalid license file provided!</title>
      <link>https://community.esri.com/t5/data-management-questions/create-enterprise-geodatabase-with-arcpy-invalid/m-p/520967#M29646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does the same license file work through the Toolbox utility?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is really something best taken to Tech Support and/or Customer Service,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;since no one here can (or should) verify your license file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- V&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2012 12:19:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/create-enterprise-geodatabase-with-arcpy-invalid/m-p/520967#M29646</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2012-09-10T12:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: Create Enterprise Geodatabase with arcpy - Invalid license file provided!</title>
      <link>https://community.esri.com/t5/data-management-questions/create-enterprise-geodatabase-with-arcpy-invalid/m-p/520968#M29647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Vselivanov,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You will need to provide the path and the filename of the keycodes file for this 'Create Enterprise Geodatabase' to pick up the license.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As described on the webhelp link of the "&lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//001700000162000000"&gt;Create Enterprise Geodatabase&lt;/A&gt;&lt;SPAN&gt;" tool:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"Provide the path and file name of the keycodes file that was created when you authorized ArcGIS for Server Enterprise. This file is in the \\Program Files\ESRI\License&amp;lt;release#&amp;gt;\sysgen folder on Windows and /arcgis/server/framework/runtime/.wine/drive_c/Program Files/ESRI/License&amp;lt;release#&amp;gt;/sysgen directory on Linux."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can also use a .ecp file by downloading it from &lt;/SPAN&gt;&lt;A href="https://customers.esri.com/index.cfm?event=pub.ecpAuthorizations"&gt;ArcSDE 10 and ArcIMS 10 Authorization Form&lt;/A&gt;&lt;SPAN&gt;. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Mandar&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2012 14:26:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/create-enterprise-geodatabase-with-arcpy-invalid/m-p/520968#M29647</guid>
      <dc:creator>MandarPurohit</dc:creator>
      <dc:date>2012-09-10T14:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Create Enterprise Geodatabase with arcpy - Invalid license file provided!</title>
      <link>https://community.esri.com/t5/data-management-questions/create-enterprise-geodatabase-with-arcpy-invalid/m-p/520969#M29648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks a lot for fast response. But I found out that problem was in the provided parameters for python script. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then I passed the path to license key like C:\Program Files\ESRI\License10.1\sysgen\keycodes inside python script in licence variable&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;was only C:\Program, so that is why it's falling with not appropriate license! All problem was in a gap between Program and Files=)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nevertheless, thanks=)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 09:42:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/create-enterprise-geodatabase-with-arcpy-invalid/m-p/520969#M29648</guid>
      <dc:creator>VasiliiSelivanov</dc:creator>
      <dc:date>2012-09-11T09:42:56Z</dc:date>
    </item>
  </channel>
</rss>

