search
HomeDatabaseMysql TutorialArcSDE地理数据库跨用户以及跨数据库表关联研究

ArcSDE提供多种方式的关联操作,Join、Relate、ArcSDE视图、QueryLayer、RelationshipClass等,每一种方式都有自己独特的适用范围和方法。 但是一般情况下,我们在介绍这些方法的使用过程中,无疑都是在同一个数据库(SQLServer)和同一个用户下(Oracle)下

ArcSDE提供多种方式的关联操作,Join、Relate、ArcSDE视图、QueryLayer、RelationshipClass等,每一种方式都有自己独特的适用范围和方法。


但是一般情况下,我们在介绍这些方法的使用过程中,无疑都是在同一个数据库(SQLServer)和同一个用户下(Oracle)下的环境中使用,但是很多用户在实际过程中使用了关联,其实都是空间数据和属性数据的关联,这些属性数据往往与空间数据不再一块儿,那么类似这种情况下,ArcSDE是否可以实现呢?


通用的方法就是Join,用户可以将不同存储位置的数据加载到ArcMap中进行Join,然后保存MXD,不管是直接操作该关联对象还是发布ArcGIS Server服务都是可以的,但是这种方式给用户带来的不是性能低下就是在发布服务的时候有明显的问题。

比如,当发布服务时,数据源进行join,在ArcGIS10.1环境下会出现一个问题

1:当ArcGIS10.1 SP1补丁,Join之后的标注看不到,但是不打SP1补丁可以,该问题经过跟美国沟通是一个Bug:

NIM087311 Map labels do not work in a map service if the feature class resides in an

ArcSDE database and is joined to a table.

http://support.esri.com/en/bugs/nimbus/TklNMDg3MzEx

该问题已经在ArcGIS 10.1 SP1 for (Desktop, Engine, Server) Quality Improvement Patch和ArcGIS10.2已经解决。


2:使用Join发布服务,在query中可以查到结果,在find中不行。


那么我们只能通过ArcSDE视图或者QueryLayer的方式来解决这个问题。

----------------------------------------------------------------------------------


Blog:               http://blog.csdn.net/linghe301

----------------------------------------------------------------------------------


SQLServer数据库

例如,我的测试数据,空间数据pl和属性数据owner,两者共有的关联字段是pid,那么pl存储在sde101的数据库中(database),owner存储在test数据库中。



ArcSDE地理数据库跨用户以及跨数据库表关联研究

注意:因为牵涉到跨库操作,所以,我设置了sde用户默认对sde101数据库有操作权限,我还需要设置sde用户对test数据库有相关权限,如果更加严谨的话,sde用户对test数据库中的owner 表有操作权限。


1:使用ArcSDE命令视图方法

C:\Program Files\ArcGIS\ArcSDE\sqlexe\bin>sdetable -o create_view -T myview123 -t sde101.dbo.place,test.dbo.owner -c sde101.dbo.place.objectid,sde101.dbo.place.shape,sde101.dbo.place.pid,test.dbo.owner.name -a objectid,shape,pid,name -w "sde101.dbo.place.pid=test.dbo.owner.pid" -i sde:sqlserver:lishaohua -s lishaohua -D sde101 -u sde -p Super123


ArcSDE 10.2
Attribute        Administration Utility
-----------------------------------------------------
        Error: Invalid database name (-162).
        Error: Unable to create view myview123
提示无效的数据库名称

那么如果我直接将owner拷贝到sde101数据库,也就是同一个数据库下的空间数据与属性数据进行关联,测试创建视图没有问题。

C:\Program Files\ArcGIS\ArcSDE\sqlexe\bin>sdetable -o create_view -T myview -t sde101.dbo.place,sde101.dbo.owner -c sde101.dbo.place.objectid,sde101.dbo.place.shape,sde101.dbo.place.pid,sde101.dbo.owner.name -a objectid,shape,pid,name -w "sde101.dbo.place.pid=sde101.dbo.owner.pid" -i sde:sqlserver:lishaohua -s lishaohua -D sde101 -u sde -p Super123


ArcSDE 10.2
Attribute        Administration Utility
-----------------------------------------------------
Successfully created view myview.
总结:也就是说ArcSDE命令不支持SQLServer的跨数据库关联。


2:使用QueryLayer关联

ArcSDE地理数据库跨用户以及跨数据库表关联研究

总结:用户可以使用QueryLayer实现SQLServer的跨数据库关联,用户使用QueryLayer发布ArcGIS Server服务没有问题。

----------------------------------------------------------------------------------


Blog:               http://blog.csdn.net/linghe301

----------------------------------------------------------------------------------


Oracle数据库

例如测试数据,sde用户下存储空间数据PL,aaa用户下存储属性数据owner,关联字段为pid

1:使用ArcSDE命令创建视图

C:\Users\Administrator>sdetable -o create_view  -T myview -t sde.pl,aaa.owner -c sde.pl.objectid,sde.pl.shape,sde.pl.name,aaa.owner.name -a objectid,shape,name1,name2 -w "sde.pl.pid=aaa.owner.pid" -i sde:oracle11g:192.168.220.131/orcl -u sde -p sde


ArcSDE 10.2
Attribute        Administration Utility
-----------------------------------------------------
        Error: Underlying DBMS error (-51).
        Error: Unable to create view myview
ORA-01720: 不存在 'AAA.OWNER' 的授权选项

系统提示sde用户并没有对aaa.owner有权限。

C:\Users\Administrator>sqlplus aaa/aaa@orcl_131

SQL*Plus: Release 11.2.0.1.0 Production on 星期四 2月 27 11:51:38 2014

Copyright (c) 1982, 2010, Oracle.  All rights reserved.


连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> grant select on owner to sde with grant option;

授权成功。

SQL> exit
从 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options 断开

C:\Users\Administrator>sdetable -o create_view  -T myview -t sde.pl,aaa.owner -c sde.pl.objectid,sde.pl.shape,sde.pl.name,aaa.owner.name -a objectid,s
hape,name1,name2 -w "sde.pl.pid=aaa.owner.pid" -i sde:oracle11g:192.168.220.131/orcl -u sde -p sde


ArcSDE 10.2
Attribute        Administration Utility
-----------------------------------------------------
Successfully created view myview.

使用aaa用户将owner表赋予sde用户,然后创建视图成功。

总结:Oracle数据库支持跨用户创建ArcSDE空间视图


2:使用QueryLayer方式

ArcSDE地理数据库跨用户以及跨数据库表关联研究

总结;可以看到,使用QueryLayer也是支持跨用户关联的。


那么在oracle数据库中,如果用户希望跨数据库实例,请参考:

ArcSDE进行跨数据库的关联
http://blog.csdn.net/linghe301/article/details/7237049

但是这种方法有很多问题,不建议用户使用。



更多参考:


ArcGIS表关联方式介绍(二)-ArcSDE视图、QueryLayer、RelationshipClass
http://blog.csdn.net/linghe301/article/details/6649717


ArcGIS表关联方式介绍(一)-Join、Relate
http://blog.csdn.net/linghe301/article/details/6649689

----------------------------------------------------------------------------------


Blog:               http://blog.csdn.net/linghe301

----------------------------------------------------------------------------------



Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
MySQL: BLOB and other no-sql storage, what are the differences?MySQL: BLOB and other no-sql storage, what are the differences?May 13, 2025 am 12:14 AM

MySQL'sBLOBissuitableforstoringbinarydatawithinarelationaldatabase,whileNoSQLoptionslikeMongoDB,Redis,andCassandraofferflexible,scalablesolutionsforunstructureddata.BLOBissimplerbutcanslowdownperformancewithlargedata;NoSQLprovidesbetterscalabilityand

MySQL Add User: Syntax, Options, and Security Best PracticesMySQL Add User: Syntax, Options, and Security Best PracticesMay 13, 2025 am 12:12 AM

ToaddauserinMySQL,use:CREATEUSER'username'@'host'IDENTIFIEDBY'password';Here'showtodoitsecurely:1)Choosethehostcarefullytocontrolaccess.2)SetresourcelimitswithoptionslikeMAX_QUERIES_PER_HOUR.3)Usestrong,uniquepasswords.4)EnforceSSL/TLSconnectionswith

MySQL: How to avoid String Data Types common mistakes?MySQL: How to avoid String Data Types common mistakes?May 13, 2025 am 12:09 AM

ToavoidcommonmistakeswithstringdatatypesinMySQL,understandstringtypenuances,choosetherighttype,andmanageencodingandcollationsettingseffectively.1)UseCHARforfixed-lengthstrings,VARCHARforvariable-length,andTEXT/BLOBforlargerdata.2)Setcorrectcharacters

MySQL: String Data Types and ENUMs?MySQL: String Data Types and ENUMs?May 13, 2025 am 12:05 AM

MySQloffersechar, Varchar, text, Anddenumforstringdata.usecharforfixed-Lengthstrings, VarcharerForvariable-Length, text forlarger text, AndenumforenforcingdataAntegritywithaetofvalues.

MySQL BLOB: how to optimize BLOBs requestsMySQL BLOB: how to optimize BLOBs requestsMay 13, 2025 am 12:03 AM

Optimizing MySQLBLOB requests can be done through the following strategies: 1. Reduce the frequency of BLOB query, use independent requests or delay loading; 2. Select the appropriate BLOB type (such as TINYBLOB); 3. Separate the BLOB data into separate tables; 4. Compress the BLOB data at the application layer; 5. Index the BLOB metadata. These methods can effectively improve performance by combining monitoring, caching and data sharding in actual applications.

Adding Users to MySQL: The Complete TutorialAdding Users to MySQL: The Complete TutorialMay 12, 2025 am 12:14 AM

Mastering the method of adding MySQL users is crucial for database administrators and developers because it ensures the security and access control of the database. 1) Create a new user using the CREATEUSER command, 2) Assign permissions through the GRANT command, 3) Use FLUSHPRIVILEGES to ensure permissions take effect, 4) Regularly audit and clean user accounts to maintain performance and security.

Mastering MySQL String Data Types: VARCHAR vs. TEXT vs. CHARMastering MySQL String Data Types: VARCHAR vs. TEXT vs. CHARMay 12, 2025 am 12:12 AM

ChooseCHARforfixed-lengthdata,VARCHARforvariable-lengthdata,andTEXTforlargetextfields.1)CHARisefficientforconsistent-lengthdatalikecodes.2)VARCHARsuitsvariable-lengthdatalikenames,balancingflexibilityandperformance.3)TEXTisidealforlargetextslikeartic

MySQL: String Data Types and Indexing: Best PracticesMySQL: String Data Types and Indexing: Best PracticesMay 12, 2025 am 12:11 AM

Best practices for handling string data types and indexes in MySQL include: 1) Selecting the appropriate string type, such as CHAR for fixed length, VARCHAR for variable length, and TEXT for large text; 2) Be cautious in indexing, avoid over-indexing, and create indexes for common queries; 3) Use prefix indexes and full-text indexes to optimize long string searches; 4) Regularly monitor and optimize indexes to keep indexes small and efficient. Through these methods, we can balance read and write performance and improve database efficiency.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools