ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • 帮助
  • Sign Out
ArcGIS Desktop

ArcGIS Online

专为贵组织打造的制图平台

ArcGIS Desktop

全面的专业性 GIS

ArcGIS Enterprise

面向企业的 GIS

ArcGIS for Developers

用于构建位置感知应用程序的工具

ArcGIS Solutions

适用于行业的免费模板地图和应用程序

ArcGIS Marketplace

获取适用于组织的应用程序和数据

  • 文档
  • 支持
Esri
  • 登录
user
  • 我的个人资料
  • 登出

ArcMap

  • 主页
  • 入门
  • 地图
  • 分析
  • 管理数据
  • 工具
  • 扩展模块

升级 Informix 中的地理数据库

在 Standard 或 Advanced 许可等级下可用。

  • 在升级之前
  • 升级地理数据

升级企业级地理数据库的目的是更新地理数据库系统表、存储过程、类型和函数以利用新功能并修复缺陷。

安装新版本的 ArcGIS 客户端或应用现有安装的补丁包、修补程序或热修复程序,然后升级地理数据库。

在升级之前

在升级包括地理数据库在内的任何企业系统时,必须事前进行规划。在开发服务器或测试服务器上对新版本进行测试,以确保其适用于所有的客户端应用程序。

在确定了新系统会按预期进行工作后,请计划升级;确保必要的工作人员均可执行升级并且他们拥有完成指派的任务所必需的权限。

注意如下事项:

  • 如果您要从 10.2.x 升级,需要确保对地图或服务中使用的所有 ArcSDE 应用程序服务器连接进行迁移以便直接连接至地理数据库。
  • 不支持对软件的测试版本进行升级。
  • 如果您的数据库是支持的版本,则可从 10.2 x、10.3.x、10.4.x、10.5.x 或 10.6.x 版本的地理数据库直接升级。
  • 如果您的地理数据库为 10 版或更早的版本,则必须先升级到支持的地理数据库版本,然后再升级到当前的 ArcGIS 版本。
  • 如果地理数据库已经升级到当前版本,则 ArcGIS 10 和较早版本的客户端将无法连接至该数据库。
  • 不提供将地理数据库降级到先前版本的正式机制。如果升级到较新版本后想要降级该地理数据库,则必须从备份文件中恢复旧数据库。

以下为升级地理数据库之前应完成的步骤一览表:

  1. 请阅读 ArcGIS 10.6.1 的 IBM Informix 数据库要求以确认 Esri 支持要使用的 Informix 和 ArcGIS 版本组合。
  2. 执行检查以查看地理数据库是否可以升级。要执行此操作,需将要移动到的 ArcGIS 客户端版本安装到计算机上。如果安装 ArcMap,可连接至地理数据库并打开数据库属性对话框以查看该地理数据库是否可以升级。如果安装 ArcGIS Server(企业版)或 ArcGIS Engine Geodatabase Update 扩展模块,可使用 ArcPy Describe 函数来确定该地理数据库是否可以升级。
    # Open Python.
    cd /arcgis/server/tools
    ./python
    # Create a connection to the geodatabase.
    arcpy.CreateDatabaseConnection_management("/tmp/",
                                              "egdb_connection.sde",
                                              "INFORMIX",
                                              "myidsgdb",
                                              "DATABASE_AUTH",
                                              "sde",
                                              "mysdepassword",
                                              "SAVE_USERNAME")
    # Import ArcPy and check the geodatabase release.
    import arcpy
    isCurrent = arcpy.Describe('/tmp/egdb_connection.sde').currentRelease
    print isCurrent
    

    如果返回 false,则可升级地理数据库。如果返回 true,则无需升级地理数据库。请勿继续执行后续步骤。

  3. 将现有地图或服务中使用的所有应用程序服务器连接转换为直连。
  4. 创建数据库的备份。
  5. 移除任何您可能已添加到 ArcGIS 外部的地理数据库系统表中的自定义功能,例如触发器或其他索引。

    升级程序无法兼容对系统表的自定义修改。如果类似的自定义修改禁止更改系统表方案,升级将会失败。

  6. Informix 用户必须通过 dbaccess 向数据库的 sde 用户帐户授予 dba 权限。

    如果没有授予所需权限,升级过程会出现问题并影响整体产品性能。

    Informix 用户执行以下命令将 dba 权限授予 sde 用户:

    dbaccess <Database Name>
    Query-language-->New-->
    grant dba to sde
    Run
    
  7. 确保没有任何用户连接到正在升级的地理数据库。

    要查看当前连接到地理数据库的用户列表,请转至 ArcGIS Desktop 客户端的地理数据库管理对话框。

此时,您可以升级地理数据库。

升级地理数据

可以使用 ArcMap 中的升级地理数据库工具或使用在 ArcGIS 客户端计算机上运行的 Python 脚本升级地理数据库。

使用升级地理数据库工具

可以通过单击常规选项卡上的升级地理数据库按钮打开数据库属性对话框中的升级地理数据库工具,或直接打开该工具。如果打开了数据库属性中的工具,则将使用地理数据库连接信息预填充输入地理数据库文本框。

Esri 建议选中先行检查和升级地理数据库选项。这样,该工具将在继续升级地理数据库之前检查是否已满足升级的先决条件。

先行检查将检测到地理数据库的其他活动连接、确定连接用户是否具有升级地理数据库所需的足够权限、确保数据库可支持 XML 列、确保所有数据集均可打开,以及保证数据库与库的版本相同。如果未满足任意先决条件,则工具将终止。重新运行升级程序之前,必须修正所有问题。

此检查的结果在地理处理工具对话框中报告。如果检查(或升级)失败,其结果仍将写入 GDBUpgrade.log 中,该文件位于 c:\Users\<user name>\AppData\Local\ESRI\<ArcGIS product>。

如果通过了所有检查,该工具将继续进行升级。先行检查和升级的状态将在地理处理工具进度对话框中显示。如果升级失败,则信息将写入 GDBUpgrade.log。其他信息将写入 sde_setup.log,该文件位于系统 TEMP 目录中。

运行脚本

要想升级地理数据库,请将这些示例脚本中的一个脚本复制到文本编辑器中。更改任何变量值来与您的站点信息相匹配。

  • 如果具有使用直连并作为 sde 用户身份进行连接的现有数据库连接文件,则应复制适用于您的操作系统的脚本,将其粘贴到文本编辑器中,并根据站点的具体信息来更改脚本,保存并关闭该文件,然后再运行:
    # Name: upgradesdegdb_example.py
    # Description: Connect from a Windows computer 
    # with an existing database connection file 
    # and upgrade an enterprise geodatabase
    # Import arcpy module
    import arcpy
     
    # Local variables:
    Output_Workspace = "C:\\ArcGIS\connection_files\<Connection file>"
    Default_gdb = "C:\\ArcGIS\connection_files\<Connection file>"
    # Process: Upgrade Geodatabase
    arcpy.UpgradeGDB_management(Default_gdb, "PREREQUISITE_CHECK", "UPGRADE")
    
    # Name: upgradesdegdb_example.py
    # Description: Connect from a Linux or UNIX computer 
    # with an existing database connection file 
    # and upgrade an enterprise geodatabase
    # Import arcpy module
    import arcpy
     
    # Local variables:
    Output_Workspace = "<user>/connections/<Connection_file>"
    Default_gdb = "<user>/connections/<Connection_file>"
    # Process: Upgrade Geodatabase
    arcpy.UpgradeGDB_management(Default_gdb, "PREREQUISITE_CHECK", "UPGRADE")
    
  • 如果计算机上没有用于编写升级脚本的数据库连接文件,则可复制以下脚本并在命令行中提供特定于您的站点的信息:
    """
    Name: upgrade_gdb.py
    Description: Provide connection information to an Enterprise geodatabase 
    and upgrade the geodatabase
    Type upgrade_gdb.py -h or upgrade_gdb.py --help for usage
    """
    
    # Import system modules
    import arcpy
    import os
    import optparse
    import sys
    
    
    # Define usage and version
    parser = optparse.OptionParser(usage = "usage: %prog [Options]", version="%prog 2.0; valid for 10.1 only")
    
    #Define help and options
    parser.add_option ("--DBMS", dest="Database_type", type="choice", choices=['SQLSERVER', 'ORACLE', 'POSTGRESQL', 'DB2','INFORMIX','DB2ZOS',''], default="", help="Type of enterprise DBMS:  SQLSERVER, ORACLE, or POSTGRESQL.")
    parser.add_option ("-i", dest="Instance", type="string", default="", help="DBMS instance name")
    parser.add_option ("--auth", dest="account_authentication", type ="choice", choices=['DATABASE_AUTH', 'OPERATING_SYSTEM_AUTH'], default='DATABASE_AUTH', help="Authentication type options (case-sensitive):  DATABASE_AUTH, OPERATING_SYSTEM_AUTH.  Default=DATABASE_AUTH")
    parser.add_option ("-u", dest="User", type="string", default="", help="Geodatabase administrator user name")
    parser.add_option ("-p", dest="Password", type="string", default="", help="Geodatabase administrator password")
    parser.add_option ("--upgrade", dest="Upgrade", type="choice", choices=['TRUE', 'FALSE'], default="FALSE", help="Upgrade Options (case-sensitive):  TRUE=Perform Pre-requisite check and upgrade geodatabase, FALSE=Perform Pre-requisite check only.  Default=FALSE")                   
    parser.add_option ("-D", dest="Database", type="string", default="none", help="Database name:  Not required for Oracle")
    
    
    # Check if value entered for option
    try:
    	(options, args) = parser.parse_args()
    
    	
    #Check if no system arguments (options) entered
    	if len(sys.argv) == 1:
    		print("%s: error: %s\n" % (sys.argv[0], "No command options given"))
    		parser.print_help()
    		sys.exit(3)
    
    	#Usage parameters for spatial database connection to upgrade
    	account_authentication = options.account_authentication.upper()
    	username = options.User.lower() 
    	password = options.Password	
    	do_upgrade = options.Upgrade
    	database = options.Database.lower()
    	database_type = options.Database_type.upper()
    	instance = options.Instance
    	
    	if (database_type == ""):
    		print("\nDatabase type must be specified!\n")
    		parser.print_help()
    		sys.exit(3)
    	
    	if (database_type == "SQLSERVER"):
    		database_type = "SQL_SERVER"
    	
    	# Get the current product license
    	product_license=arcpy.ProductInfo()
    	
    	# Checks required license level to upgrade
    	if product_license.upper() == "ARCVIEW" or product_license.upper() == 'ENGINE':
    		print("\n" + product_license + " license found!" + "  Enterprise geodatabase upgrade requires an ArcGIS Desktop Standard or Advanced, ArcGIS Engine with the Geodatabase Update extension, or ArcGIS Server license.")
    		sys.exit("Re-authorize ArcGIS before upgrading.")
    	else:
    		print("\n" + product_license + " license available!  Continuing to upgrade...")
    		arcpy.AddMessage("+++++++++")
    	
    	# Local variables
    	instance_temp = instance.replace("\\","_")
    	instance_temp = instance_temp.replace("/","_")
    	instance_temp = instance_temp.replace(":","_")
    	Conn_File_NameT = instance_temp + "_" + database + "_" + username     
    	
    	if os.environ.get("TEMP") == None:
    		temp = "c:\\temp"	
    	else:
    		temp = os.environ.get("TEMP")
    	
    	if os.environ.get("TMP") == None:
    		temp = "/usr/tmp"		
    	else:
    		temp = os.environ.get("TMP")  
    	
    	Connection_File_Name = Conn_File_NameT + ".sde"
    	Connection_File_Name_full_path = temp + os.sep + Conn_File_NameT + ".sde"
    	
    	# Check for the .sde file and delete it if present
    	arcpy.env.overwriteOutput=True
    	if os.path.exists(Connection_File_Name_full_path):
    		os.remove(Connection_File_Name_full_path)
    	
    	print("\nCreating Database Connection File...\n")
    	# Process: Create Database Connection File...
    	# Usage:  out_file_location, out_file_name, DBMS_TYPE, instnace, database, account_authentication, username, password, save_username_password(must be true)
    	arcpy.CreateDatabaseConnection_management(out_folder_path=temp, out_name=Connection_File_Name, database_platform=database_type, instance=instance, database=database, account_authentication=account_authentication, username=username, password=password, save_user_pass="TRUE")
            for i in range(arcpy.GetMessageCount()):
    		if "000565" in arcpy.GetMessage(i):   #Check if database connection was successful
    			arcpy.AddReturnMessage(i)
    			arcpy.AddMessage("\n+++++++++")
    			arcpy.AddMessage("Exiting!!")
    			arcpy.AddMessage("+++++++++\n")
    			sys.exit(3)            
    		else:
    			arcpy.AddReturnMessage(i)
    			arcpy.AddMessage("+++++++++\n")
    			
    	# Check whether geodatabase needs upgrade
    	isCurrent = arcpy.Describe(Connection_File_Name_full_path).currentRelease
    	
    	if isCurrent == True:
    		print("The geodatabase is already at the current release and cannot be upgraded!")
    		sys.exit("Upgrade did not run.")
    	
    	
    	# Process: Upgrade geodatabase...
    	try:
    		if do_upgrade.lower() == "true":
    			print("Upgrading Geodatabase...\n")
    			arcpy.UpgradeGDB_management(input_workspace=Connection_File_Name_full_path, input_prerequisite_check="PREREQUISITE_CHECK", input_upgradegdb_check="UPGRADE")
    			for i in range(arcpy.GetMessageCount()):
    				arcpy.AddReturnMessage(i)
    			arcpy.AddMessage("+++++++++\n")
    	
    		else:
    			print("Running Pre-Requisite Check...\n")
    			arcpy.UpgradeGDB_management(input_workspace=Connection_File_Name_full_path, input_prerequisite_check="PREREQUISITE_CHECK", input_upgradegdb_check="NO_UPGRADE")
    			for i in range(arcpy.GetMessageCount()):
    				arcpy.AddReturnMessage(i)
    			arcpy.AddMessage("+++++++++\n")
    		
    	        
    	except:
    		for i in range(arcpy.GetMessageCount()):
    			arcpy.AddReturnMessage(i)
    		
    	if os.path.exists(Connection_File_Name_full_path):
    		os.remove(Connection_File_Name_full_path)
    	
    #Check if no value entered for option	
    except SystemExit as e:
    	if e.code == 2:
    		parser.usage = ""
    		print("\n")
    		parser.print_help()
    		parser.exit(2)
    
    例如,如果将文本文件保存为 gdbupgrade 且 ODBC 数据源名称为 mydbgdb,则应在命令提示符处输入以下内容:

    gdbupgrade --DBMS INFORMIX -i myidsgdb --auth DATABASE_AUTH -u sde -p mysdepassword --upgrade TRUE

ArcGIS Desktop

  • 主页
  • 文档
  • 支持

ArcGIS 平台

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

关于 Esri

  • 关于我们
  • 招贤纳士
  • Esri 博客
  • 用户大会
  • 开发者峰会
Esri
分享您的想法。
Copyright © 2019 Esri. | 隐私政策 | 法律声明