如何创建及其连接空间数据库连接

1.    使用ArcSDE服务连接空间数据库
使用ArcSDE服务连接到空间数据库操作步骤如下:
1)    在ArcCatalog的目录树,展开Database Connections文件夹.
2)    双击添加 Spatial Database Connection,打开 “Spatial Database Connection Properties”对话框.
3)    在Server文本框中,输入服务器名称或者IP地址;
4)    在Service文本框,输入服务名或者端口号。如果想连接Oracle数据库中某用户方案的空间数据库,输入端口号和schema,并以冒号分隔,例如:5151:Geodata.
5)    如果数据存储在SQL Server, IBM DB2, Informix, or PostgreSQL关系型数据库中,在Database文本框中,输入预连接的数据库的名称。Oracle数据库跳过此步。
6)    如果使用数据库认证,输入数据库的用户名和密码。需要保存用户和密码,勾选“save the user name and password with this connection file”,否则不保存。
7)    如果使用操作系统认证,单击“Operating system authentication”按钮。数据库认证不可用。
8)    如使用Oracle某用户的Schema数据库或者使用SQL Server中的dbo-schema数据库,必须在属性对话框中更改“Connection details”部分,从事务版本列表中选择空间数据库版本。
9)    If you do not want to save the version connection information you provided in the last step, uncheck Save the version with the connection file. 如果不保存版本的连接信息,去掉“Save the version with the connection file”前的勾选。
10)    单击“Test Connection”按钮,执行连接测试. 测试成功,“Test Connection”按钮灰掉,否则,将无法从数据库中获取数据。
11)    单击OK按钮.
12)    输入数据库连接名称.
13)    回车.

2.    直连Oracle空间数据库
以下内容将介绍三种直连到Oracle空间数据库的方式:第一,使用数据库认证直连到Oracle空间数据库;第二,使用操作系统认证直连到Oracle空间数据库;第三,如何连接到某用户方案的空间数据库。
使用数据库认证直连到Oracle空间数据库
1)        在ArcCatalog的目录树,展开Database Connections文件夹.
2)    双击添加 Spatial Database Connection.
3)    Server,输入服务器名称或者IP地址;
4)    Service,根据Oracle客户端版本输入连接字符串。连接Oracle9i, 输入:"sde:oracle9i";连接Oracle 10g,输入: "sde:oracle10g";Oracle 11g, 输入: "sde:oracle11g".
5)    User Name,输入用户名.
6)    Password,输入密码及Oracle 网络服务名,格式:sde @oradb。
7)    单击OK按钮.
8)    输入数据库连接名称。
9)    回车。
使用操作系统认证直连到Oracle空间数据库
1)    Double-click the Database Connections folder in the Catalog tree.
2)    Double-click Add Spatial Database Connection.
3)    In the Server text box, type the name of the server on which the Oracle database resides.
4)    If you're connecting to Oracle9i, in the Service text box, type "sde:oracle9i:/;LOCAL=<SQL_Net_alias>".
If you're connecting to Oracle 10g, type "sde:oracle10g:/;LOCAL=<SQL_Net_alias>".
The SQL Net alias was set when your computer was configured to use a direct connection. Contact your system administrator if you do not know what value to substitute here.
5)    Click the Operating system authentication button. The database authentication information becomes unavailable.
6)    Click OK.
7)    Type a new name for the spatial database connection.
8)    Press Enter.
连接到指定用户的空间数据库
1)    Double-click the Database Connections folder in the Catalog tree.
2)    Double-click Add Spatial Database Connection.
3)    In the Server text box, type the name of the server on which the Oracle database resides.
4)    If you're connecting to Oracle9i, in the Service text box, type "sde:oracle9i:/:<schema_name>".
If you're connecting to Oracle 10g, type "sde:oracle10g:/:<schema_name>".
5)    Type your user name in the User Name text box.
6)    Type your password, followed by @<oracle network service name>, in the Password text box.
7)    Uncheck Save username and password if you don't want your login information saved with the connection.
8)    Spatial database connections are made to the sde.DEFAULT version by default. You must change to a user-schema version. Click Change in the Connection details section.
9)    When the Connection Details dialog box opens, choose the version of the user-schema geodatabase to which you want to connect. This could be <schema>.DEFAULT or any other version of that geodatabase. For example, if the schema the geodatabase is in is tubor, and you want to connect to the qa77 version, choose tubor.qa77 from the transactional version list.
10)    Click OK on the Connection Details dialog box to close it.
11)    Click OK.
12)    Type a new name for the spatial database connection.
13)    Press Enter.
3.    直连SQL Server空间数据库
You can use a direct connection for an ArcSDE geodatabase stored in SQL Server. When reading the steps, note that there are slight differences in how you make that direct connection based on the type of ArcSDE geodatabase.
1)    Double-click the Database Connections folder in the Catalog tree.
2)    Double-click Add Spatial Database Connection.
3)    In the Server text box, type the name of the server on which the SQL Server database resides.
4)    To connect to an ArcSDE geodatabase on a default instance of SQL Server, type the following in the Service text box: "sde:sqlserver:<name or IP Address of the server>".
To connect to an ArcSDE geodatabase on a named instance of SQL Server, type the following in the Service text box: "sde:sqlserver:<name or IP Address of the server>\<instance_name>".
If connecting to an ArcSDE geodatabase on SQL Server Express, type the following in the Service text box: "sde:sqlserver:<server_name>\<instance_name>".
NOTE: You could also create a spatial database connection to an ArcSDE geodatabase on SQL Server Express by right-clicking the geodatabase under the Database Servers node and clicking 。
5)    Type the name of the database to which you want to connect in the Database text box.
6)    If using database authentication, type your user name and password.
NOTE: You cannot use database authentication for a connection to an ArcSDE geodatabase on a database server (an instance of SQL Server Express).
7)    Uncheck Save username and password if you do not want your login information saved with the connection.
8)    If using operating system authentication, click the Operating system authentication button. The database authentication information becomes unavailable.
9)    If you are connecting to an ArcSDE geodatabase with a dbo schema, you must change the transactional version to dbo.DEFAULT rather than sde.DEFAULT.
For instructions on connecting to a different version of the database, see Connecting to a specific version of the database.
10)    Click OK.
11)    Type a new name for the spatial database connection.
12)    Press Enter.


你可能感兴趣的:(oracle,sql,SQL Server,db2,Informix)