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

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服务名。


(3)测试连接

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

如果要在engine中进行sde for Oracle连接,如下:
IPropertySet Propset = new PropertySetClass(); Propset.SetProperty("Server",null); Propset.SetProperty("INSTANCE","sde:oracle9i"); Propset.SetProperty("USER","sde"); Propset.SetProperty("PASSWORD","sde@testHost"); Propset.SetProperty ("DATABASE", "sde"); Propset.SetProperty("VERSION","SDE.DEFAULT"); IWorkspaceFactory Fact = new SdeWorkspaceFactoryClass(); 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

你可能感兴趣的:(oracle,数据库,Microsoft,database,sqlserver,oracle10g)