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

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

Set Data Owner

  • 摘要
  • 用法
  • 语法
  • 代码示例
  • 环境
  • 许可信息

摘要

Alters a SQL Server database user to match the name of the specified schema and sets its default schema to the specified schema. This tool should be used in environments that prohibit the use of database users without associated logins and headless domain users. It allows users with appropriate database permissions to perform actions within the geodatabase that require the user to act as the data owner user.

用法

  • Supports SQL Server geodatabases only.

  • The Database Connection must use OS authentication.

  • Will alter the database user of the associated login.

  • The associated database user must exist prior to executing this tool.

  • The database user must have the CREATE SCHEMA permission, or the associated schema must exist prior to executing this tool.

  • The database user must have rights to the target schema in order to perform actions within the geodatabase.

  • This tool will not automatically revert the database user to the previous state. When you have finished processing as the data owner, you must run the tool again while providing your DOMAIN\username as the target schema to release ownership of the previous schema.

  • Executing this tool may require you to restart your application if you had a previously open connection to the target database within the application session.

  • The suggested workflow for using this tool is the following:

    • Open the application.
    • Launch the tool.
    • Set parameters and execute the tool.
    • Connect to the target geodatabase.
    • Perform actions as data owner.
    • Launch the tool to revert user settings.
    • Set parameters and execute the tool.
    • Restart the application.

  • The tool will return an error message if the target schema does not exist in the database or if another user has already assumed ownership of the schema. The content of the error message will be determined by the permissions of the database user.

  • The tool may also automatically assume ownership of a target schema for which another user has previously assumed ownership if that user is not currently connected to the database. This feature requires advanced permissions.

语法

SetDataOwner(Connection_File, Schema)
参数说明数据类型
Connection_File

The enterprise geodatabase workspace stored in Microsoft SQL Server in which you will alter the database user.

String
Schema

The name of the schema that will be applied to the user.

String

代码示例

SetDataOwner example (Python window)

The following sample demonstrates how to execute the SetDataOwner tool.

# Importing necessary modules
from arcpy import defense

# Setting variables for tool inputs
sde_connection_file = r'C:\Data\MGCP_TRD_4_2.sde'
schema = 'new_schema_user'

# Calling Set Data Owner and passing in variables
defense.SetDataOwner(sde_connection_file, schema)

环境

  • 当前工作空间

许可信息

  • ArcGIS Desktop Basic: 否
  • ArcGIS Desktop Standard: 需要 Defense Mapping
  • ArcGIS Desktop Advanced: 需要 Defense Mapping

ArcGIS Desktop

  • 主页
  • 文档
  • 支持

ArcGIS 平台

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

关于 Esri

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