方法

ジオデータベースの有効化を自動化する

Last Published: October 26, 2021

サマリー

GIS マネージャー、DBA、および管理者は、ジオデータベースの有効化などのワークフローの自動化が必要な場合がよくあります。 以下の手順では、Python スクリプトを使用した方法について説明します。

手順

以下の Python スクリプトは、接続ファイルを作成し、ジオデータベースを有効化する方法を示しています。

注意: [エンタープライズ ジオデータベースの有効化 (Enable Enterprise Geodatabase)] ジオプロセシング ツールを実行するには、データベースに接続し、ジオデータベース機能を有効化するコンピューターに ArcGIS Desktop (Desktop Standard または Desktop Advanced)、ArcGIS Engine Geodatabase Update、または ArcGIS Server がインストールされている必要があります。

環境に応じて、以下のパラメーターを変更します。

temp = r"C:/temp" auth_file = "C:/Authorizationfile/aut101/Server_Ent_Adv.ecp" Connection_File_Name = "Nidhi_oracle2.sde" database_platform = "ORACLE" instance = "lclinton2/testoracle" database = "" account_authentication = "DATABASE_AUTH" username = "sde" password = "sde" save_user_pass="TRUE" dba_username = "sys" dba_password = "manager"

Python スクリプト:

import arcpy, os, sys, string def CreateGeoDB(temp,auth_file, Connection_File_Name,database_platform,instance,database,account_authentication,username,password,save_user_pass,dba_username,dba_password): #接続ファイルの作成 arcpy.CreateDatabaseConnection_management(temp,Connection_File_Name,database_platform,instance,account_authentication,username,password,"SAVE_USERNAME","","","TRANSACTIONAL","","") print "Created sdeconnection" arcpy.EnableEnterpriseGeodatabase_management(temp + os.sep + Connection_File_Name, auth_file) print "Enabled database" if __name__ == "__main__": temp = r"C:/temp" auth_file = "C:/Authorizationfile/aut101/Server_Ent_Adv.ecp" Connection_File_Name = "Nidhi_oracle2.sde" database_platform = "ORACLE" instance = "lclinton2/testoracle" database = "" account_authentication = "DATABASE_AUTH" username = "sde" password = "sde" save_user_pass="TRUE" dba_username = "sys" dba_password = "manager" CreateGeoDB(temp,auth_file, Connection_File_Name,database_platform,instance,database,account_authentication,username,password,save_user_pass,dba_username,dba_password)

記事 ID:000011776

ArcGIS の専門家からヘルプを受ける

テクニカル サポートへのお問い合わせ

Esri Support アプリのダウンロード

ダウンロード オプションに移動

関連情報

このトピックについてさらに調べる