页首Html代码

返回顶部

在CentOS6上 ArcSDE for Oracle11gR2安装与配置

首先了解下什么是arcSDE

可以看看 : http://wenku.baidu.com/view/1ba13668011ca300a6c39096.html?from=related&hasrec=1

这篇文章,里面的这个图,就表明了他得作用:

其实ArcSDE就是一个程序,读取数据库的数据,然后再充当一个服务器,来让别人从这里获取数据的。而且数据是整理好的,在配置的时候会在数据库中建立一些和空间地理数据库相关的一些数据,由ArcSDE来自行管理,但是在建立的时候就应该要费费劲了。

 

好了,下面说说一些配置和操作。

首先在安装好Oracle的CentOS上安装ArcSDE软件,这些软件挺不好找的。我这里有ArcSDE for linux/Solari/ibm/hpia 系统上的for DB2 informix oracle postgresql几种的安装光盘镜像。如果有人需要可以联系我。

可以我现在没有 For Windows平台的。windows平台下也是一张单独的光盘吧。。Oracle有分32/64位架构的 有10G 11G 版本的

直接安装 ./install

按照提示进行安装即可。(所谓的安装,我想其实应该是解压,如果是win下得,会自动进行配置的。但是linux下他就是解压!!!!)

安装完毕后,就是进行配置了。。。在windows下,这些配置应该是集成到安装程序里的。

 

arcSDE安装与环境配置 数据库配置

许多文档说要建立一个sde用户,我不太明白有什么必要性。我是这么做的(我是oracle用户,在oracle用户组下,也是oinstall用户组)

1.建立环境变量

SDEHOME=/home/oracle/app/arcsde/sdeexe100
ORACLE_BASE=/home/oracle/app/oracle
ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1
ORACLE_SID=orcl
TNS_ADMIN=${ORACLE_HOME}/network/admin
PATH=$PATH:$SDEHOME/bin:$ORACLE_HOME/bin:.

保存到/etc/profile这样所有的用户都可以使用这些变量,不是更好么??

2.打开$SDEHOME/tools/oracle文件夹,对createSdeOracle.sql文件进行修改

把/LOCATION/sde.dbf修改为你需要把新的sde用户空间数据库文件放到哪个位置,我放到了/home/oracle/app/arcsde/sde.dbf下。注意这个文件夹要提前建立好,这是我arcSDE解压的文件。

把system/<PASSWORD>修改为system/oracle的密码

运行sqlplus sys/oracle的密码 as sysdba @/home/oracle/app/arcsde/tool/oracle/createsdeoracle.sql 来运行这个sql文件

然后回出现许多【success】如果有错误,请检查。下面的是 出现在控制台的log提示

View Code
  1 Connected to:
2 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
3 With the Partitioning, Oracle Label Security, OLAP, Data Mining,
4 Oracle Database Vault and Real Application Testing options
5
6 * CREATESDEORACLE.SQL script *
7 * *
8 * Purpose: *
9 * *
10 * To create the SDE tablespace, the SDE Oracle user *
11 * and grant privileges to the SDE user *
12 * *
13 * NOTES: 1. Before running this script *
14 * Replace the word LOCATION with the pathname for *
15 * the sde.dbf datafile to be created. *
16 * *
17 * 2. If upgrading remove rem from the grants and *
18 * revokes in the upgrade section *
19 * *
20 * 3. Please use the sys user to run this script. *
21 * You will also need the system user password *
22 * *
23 * Example: *
24 * % sqlplus "sys as sydba" @createsdeoracle.sql *
25 * *
26 * *
27 **************************************************************
28 * Granting of permissions by the SYS user in Oracle, on two packages
29 * to the public role.
30
31 Grant succeeded.
32
33
34 Grant succeeded.
35
36 * * * * * * * * * * * * * * *
37 * ArcSDE NEW INSTALLATION *
38 * * * * * * * * * * * * * * *
39 * Connect as system/<password> to create the sde
40 * tablespace and user.
41 Connected.
42 * Create the sde tablespace.
43 * Before you run this script update LOCATION for the desired datafile pathname.
44
45
46 Tablespace created.
47
48 * Create the sde user
49 * The password for the sde user is set to "sde". You may
50 * change this if you wish.
51
52 User created.
53
54 * Granting the required privileges to the sde user.
55
56 Grant succeeded.
57
58
59 Grant succeeded.
60
61
62 Grant succeeded.
63
64
65 Grant succeeded.
66
67
68 Grant succeeded.
69
70
71 Grant succeeded.
72
73
74 Grant succeeded.
75
76
77 Grant succeeded.
78
79
80 Grant succeeded.
81
82
83 Grant succeeded.
84
85
86 Grant succeeded.
87
88
89 Grant succeeded.
90
91 * UNLIMITED TABLESPACE is not required. Grant this privilege
92 * if you do not wish to explicitly manage and grant tablespace quota to SDE user.
93
94 Grant succeeded.
95
96 * ADMINISTER DATABASE TRIGGER can be revoked after install
97
98 Grant succeeded.
99
100 * * * * * * * * * * *
101 * ArcSDE UPGRADE *
102 * * * * * * * * * * *
103 * If upgrading please remove rem from each grant.
104 * Granting the required privileges to the sde user.
105 * After upgrading you may revoke the following privileges
106 * Please remove rem from each revoke.
107 * Revoking the upgrade privileges to the sde user.
108 * Revoking privileges may cause ARCSDE objects to become invalid.
109 * Remove rem and run the following command to recompile ArcSDE objects.
110 Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
111 With the Partitioning, Oracle Label Security, OLAP, Data Mining,
112 Oracle Database Vault and Real Application Testing options

该脚本会创建sde这个oracle用户,这个和linux的用户没有啥关系的。。

3.下面修改linux的服务端口列表,
打开$SDEHOME/etc/service.sde

添加 

esri_sde 5151/tcp

打开/etc/service

添加

esri_sde 5151/tcp

同时还可以根据需要修改$SDEHOME/etc下的其他文件。
    dbinit.sde #正如前面提到的,这个文件下的参数会覆盖掉.profile或者.cshrc文件下的参数。设置的方法是set (variablename)=(value)
    giomgr.defs #这个文件定义了sde服务器如何运行的一些参数,默认的参数在大部分情况下已经够用了。
    #如何设置,请参阅ArcSDE Configuration and Tuning Guide for Oracle(安装包里附带的一个pdf文件)。
    #在执行了sdesetupora10g命令之后,这个文件里的参数会被读入数据库,生成一个名为server_config的表。
    #如果想要在运行了sdesetupora10g命令之后修改参数,请参阅sdeconfig命令。
    dbtune.sde #这个文件定义了数据库中表的物理存储参数。同样参阅ArcSDE Configuration and Tuning Guide for Oracle文档。
    #运行了sdesetupora10g命令之后,这个文件里的参数会被读入数据库,生成一个名为dbtune的表。
    #如果想要在运行了sdesetupora10g之后修改参数,请参阅sdedbtune命令。
    #sdeconfig命令和sdedbtune命令都可以在ArcSDE Administration Command Reference(安装包里附带的html和chm文件)中找到详细说明。

  

4.创建SDE的服务,和linux自启动,这样linux启动了,oracle也启动了,arcSDE也启动了,sde就可以提供服务了。

sdesetup -o install -d ORACLE11G -p sde

-d 后面的应该是固定的,是10G 就改个数字就行了。-p是刚才的sql文件自动创建的用户sde的密码,默认是sde,除非你修改过了。

过程可能会比较慢,耐心等待就ok了。

第一次出现了一次错误,郁闷了一下。(貌似是我按了ctrl+C,其实我是想复制点东西的)

 

View Code
[oracle@oracle bin]$ sdesetup -o install -d ORACLE11G -p sde

ESRI ArcSDE Server Setup Utility Mon Oct 31 22:23:47 2011
----------------------------------------------------------------
^CConnection to sde failed(0)

Extended error: ORA-01013: user requested cancel of current operation


Error creating ArcSDE direct connection (-51)

再试一次

View Code
[oracle@oracle bin]$ sdesetup -o install -d ORACLE11G -p sde

ESRI ArcSDE Server Setup Utility Mon Oct 31 22:27:16 2011
----------------------------------------------------------------
Install or update ArcSDE, GDB schema objects: Are you sure? (Y/N): y

Checking INSTALL privileges for geodatabase ...
Current user has privilege to install geodatabase instance.

Checking geodatabase XML datatype support...
Underlying RDBMS database instance supports XML data type.

Creating ArcSDE schema.....
^C^[[A^[[B^[[D^[[C^[[D^[[C^[[D^[[C^[[DSuccessfully created ArcSDE schema.

Installing St_Geometry ....
Successfully installed St_Geometry.

Creating geodatabase schema.....
Successfully created GDB schema.


Successfully installed ArcSDE components.
Refer SDEHOME\etc\sde_setup.log for more details.

成功了。

至于自启动,见6的操作。

5.授权文件的导入

如果不导入,那么下一步的操作就回有提示:

View Code
[oracle@oracle bin]$ sdemon -o start -p sde


-------------------------------------------------------
ArcSDE 10.0 for Oracle11g Build 685 Fri May 14 12:05:43 2010
-------------------------------------------------------


ST_Geometry Schema Owner: (SDE) Type Release: 1007

Instance initialized for ((sde)) . . .


Connected to instance . . .

DBMS Connection established...


Error (-327), No ArcSDE server license found.

Could not start ArcSDE -- Check Network, $SDEHOME disk, DBMS settings and dbinit.sde.

[oracle@oracle bin]$

sde.ecp文件就是授权文件。可以试试下面的这个

arcsdeserver,100,ecp.arcgis.engine,01-jan-2019,NKLGPNCN82E88ZJPN067
sdesetup  -o update_key -d ORACLE11G -l /home/oracle/sde.ecp -u sde -p sde -N
[oracle@oracle bin]$ sdesetup  -o update_key -d ORACLE11G -l /home/oracle/sde.ecp
Enter DBA password:

ESRI ArcSDE Server Setup Utility Mon Oct 31 22:40:36 2011
----------------------------------------------------------------
Error: Bad login user (-9).
Error upgrading authorization key.
##上面的错误,不知道DBA是什么账号。。。用下面的sde就行了

[oracle@oracle bin]$ sdesetup -o update_key -d ORACLE11G -l /home/oracle/sde.ecp -u sde -p sde -N

ESRI ArcSDE Server Setup Utility Mon Oct 31 22:41:28 2011
----------------------------------------------------------------
Successfully updated authorization key.
[oracle@oracle bin]$

6.启动SDE服务和建立linux自启动服务脚本

[oracle@oracle bin]$ sdemon  -o start -p sde


-------------------------------------------------------
ArcSDE 10.0 for Oracle11g Build 685 Fri May 14 12:05:43 2010
-------------------------------------------------------


ST_Geometry Schema Owner: (SDE) Type Release: 1007

Instance initialized for ((sde)) . . .


Connected to instance . . .

DBMS Connection established...

RDBMS: "Oracle"
Instance Name: "esri_sde"

IOMGR Process ID (PID): 17343


ArcSDE Instance esri_sde started Mon Oct 31 22:42:47 2011
[oracle@oracle bin]$


上面的是手动运行了服务

下面建立自启动Linux服务脚本

 

创建sde.sh文件,加入下面的内容:

#!/bin/sh
#
#一下环境变量 尽量在 /etc/profile中进行设置。
#SDEHOME=/home/sde/sdeexe91
#ORACLE_HOME=/opt/oracle

export SDE_OWNR=oracle
#ORACLE_BASE
#ORACLE_SID
#LD_LIBRARY_PATH
#export PATH=$SDEHOME/bin:$ORACLE_HOME/bin:$PATH &&
#export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$SDEHOME/lib:/usr/lib:/lib:$LD_LIBRARY_PATH:$ORACLE_HOME/lib/stubs &&
#
#
if [ ! -d $SDEHOME ] || [ ! -f $SDEHOME/bin/sdemon ]
then
echo "ArcSDE startup: cannot start"
exit 1
fi
#

case "$1" in
start)
#ArcSDE startup
echo -n "Starting ArcSDE: "
su $SDE_OWNR -c "$SDEHOME/bin/sdemon -o start -p sde"
touch /var/lock/sde
echo "OK, Started"
;;
stop)
#ArcSDE shutdown
echo -n "Shutdown ArcSDE: "
su $SDE_OWNR -c "$SDEHOME/bin/sdemon -o shutdown -p sde"
rm -f /var/lock/sde
echo "OK, Stopped"
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 start|stop|restart"
exit 1
;;
esac
exit 0




    然后: 

    chmod 755 sde.sh
    sudo cp sde.sh /etc/init.d/ 


执行下列命令测试:
/etc/rc.d/init.d/sde.sh start
/etc/rc.d/init.d/sde.sh stop

连接
ln -s /etc/init.d/sde.sh /etc/rc1.d/K61oracle
ln -s /etc/init.d/sde.sh /etc/rc3.d/S61oracle

执行下列命令添加到Linux服务中:
chkconfig --add sde.sh
chkconfig --level 345 sde.sh on
chkconfig --list sde.sh

重新启动服务器。



    就可以了。

    7. 卸载
    卸载ArcSDE很简单。
    首先停止服务:
    sdemon -o shutdown
    然后删除$SDEHOME文件夹:
    rm -R $SDEHOME
    最后删除掉/etc/services里相应的服务项,就可以了。

    8. 其他
    这里稍微提一下升级的事情,也就是打补丁的事情。
    ESRI官方网站上到目前提供的是ArcSDE9.2的补丁,那么去下载了,然后参照网站上的说明做,就可以了。
    这里需要注意的是,如果升级,那么还需要给sde添加前面提到的权限才可以。

(以上三条 参考http://linux.chinaitlab.com/set/777027_4.html

 

9.连接arcSDE for oracle(arcSDE 的用法 用途 ,如何使用arcSDE)

arcCatalog连接arcSDE数据库 有两种:1 是连arcSDE应用服务器、2是直接连Oracle数据库

1.打开arcCatalog ,输入ip和端口就可以了。

2.打开catalog后,在建立空间数据库连接这里还是输入ip 下面的服务是输入 sde:oracle11g:192.168.1.110/orcl 。前面两个基本是固定的,后面的
 

ArcCatalog 直接连sde数据库 原来是这个样子的

sde:oracle10g:<SQL_Net_alias>。

这里的SQL_Net_Alias就是Oracle服务器里的net_service_name

 

还有可以 用 arcObject mapObject ArcView 来连接,具体前两个是根据API SDK进行编程,arcView应该和arcCatalog类似的软件。

 

 

下面就是 利用arcCatalog导入数据了!(请参考 arcSDE 轻松入门 ESRI北京培训中心制作)

=======================

 加载vocerage数据 加载shapefile数据 加载栅格数据 加载表格数据

这就需要先连接arcSDE,然后右击连接,点 import 选择文件数据库 导入就行了。注意那个

 

 

 

最后 附上我的百度 搜藏的文库 专辑

 

http://wenku.baidu.com/album/view/34b472ea551810a6f52486bf

http://wenku.baidu.com/album/view/b0d5ce06eff9aef8941e06e7

posted @ 2011-10-31 17:31  ayanmw  阅读(5374)  评论(1编辑  收藏  举报

页脚Html代码