日期:2014-05-16  浏览次数:20452 次

SDE数据库的直接连接 direct connection to SDE .

?

http://blog.csdn.net/rrrrssss00/article/details/5462747

1、到SDE for Oracle的连接
(1)首先在本地Net Configuration Assistant中配置一个到目标数据库的Net服务名并在SQLPLUS中验证是否能够连接
,验证方法为:在CMD中输入 sqlplus 用户名/密码@Net服务名,若连接成功,则表示配置成功。


(2)在Catalog的Database Connection中,点击Add Spatial Database Connection,在对话框中,填写以下内容:
?? Server:? 服务器名或IP(貌似可以不填)
?? Service:? sde:oracle**?? (见备注)
?? username: 用户名
?? password: 密码@net服务名。

即TNS服务名


(3)测试连接

备注:Service一栏,填写的内容根据本机(即客户端)所安装的Oracle版本而定(并非根据服务器的版本而定),
如果本机安装的是Oracle 8i则填:sde:oracle,如果为9i,则填sde:oracle9i,如果为10g,则填sde:oracle10g

如果要在engine中进行sde for Oracle连接,如下:

view plaincopy to clipboardprint?
  1. IPropertySet?Propset?=?new?PropertySetClass();??
  2. Propset.SetProperty("Server",null);???
  3. Propset.SetProperty("INSTANCE","sde:oracle9i");??
  4. Propset.SetProperty("USER","sde");??
  5. Propset.SetProperty("PASSWORD","sde@testHost");??
  6. Propset.SetProperty?("DATABASE",?"sde");??
  7. Propset.SetProperty("VERSION","SDE.DEFAULT");??
  8. IWorkspaceFactory?Fact?=?new?SdeWorkspaceFactoryClass();??
  9. IFeatureWorkspace?Workspace?=?(IFeatureWorkspace)Fact.Open(Propset,0);??


2.到SDE for SQLSERVER的连接(未测试)
过程基本相似,系统需要具有the Microsoft Data Access Components (MDAC)组件,可以在系统盘的/program
files/common files/system/ado文件夹下找msado15.dll文件来确认是否安装。

?


?? Server:服务器名或IP(貌似可以不填)
?? Service:sde:sqlserver:服务器名或IP? (备注)
?? Database:要连接的数据库名
?? username:用户名
?? password:密码

如果要用engine进行连接,采用相似的操作即可,注意version是sde.default还是dbo.default

详细内容也可以参考:

http://webhelp.esri.com/arcgisdesktop/9.2/index.cfm?TopicName=Setting_up_clients_for_a_direct_connection&anchor=dcoracle
http://webhelp.esri.com/arcgisdesktop/9.2/index.cfm?TopicName=Creating_spatial_database_connections&anchor=ssdc