1:首先检查一下在Linux操作系统下Oracle数据库是否能启动,是否能连通等
[oracle@localhost ~]$ sqlplus sys/oracle@orcl as sysdba SQL*Plus: Release 11.2.0.1.0 Production on Wed Feb 22 10:33:47 2012 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> [oracle@localhost ~]$ sqlplus sys/oracle as sysdba SQL*Plus: Release 11.2.0.1.0 Production on Wed Feb 22 10:59:05 2012 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL>创建操作系统级别的ArcSDE用户
[root@localhost ~]# user add -d /home/arcsde -G oinstall -m arcsde -bash: user: command not found [root@localhost ~]# useradd -d /home/arcsde -G oinstall -m arcsde [root@localhost ~]# passwd arcsde Changing password for user arcsde. New UNIX password: BAD PASSWORD: it is based on a dictionary word Retype new UNIX password: passwd: all authentication tokens updated successfully. [root@localhost ~]# su - arcsde [arcsde@localhost ~]$创建SDE的用户、表空间、赋予权限,查看一下相关的SQL文件
prompt * Granting of permissions by the SYS user in Oracle, on two packages prompt * to the public role. grant execute on dbms_pipe to public; grant execute on dbms_lock to public; prompt * * * * * * * * * * * * * * * prompt * ArcSDE NEW INSTALLATION * prompt * * * * * * * * * * * * * * * prompt * Connect as system/<password> to create the sde prompt * tablespace and user. connect sys/oracle@orcl as sysdba prompt * Create the sde tablespace. prompt * Before you run this script update LOCATION for the desired datafile pathname. //创建SDE表空间,路径需要注意 create tablespace sde datafile '/opt/oracle/oradata/ORCL/sde.dbf' size 400M extent management local uniform size 512K; prompt * Create the sde user prompt * The password for the sde user is set to "sde". You may prompt * change this if you wish. create user sde identified by sde default tablespace sde temporary tablespace temp; prompt * Granting the required privileges to the sde user. grant CREATE SESSION to sde; grant CREATE TABLE to sde; grant CREATE PROCEDURE to sde; grant CREATE SEQUENCE to sde; grant CREATE TRIGGER to sde; grant CREATE TYPE to sde; grant CREATE LIBRARY to sde; grant CREATE PUBLIC SYNONYM to sde; grant CREATE OPERATOR to sde; grant CREATE INDEXTYPE to sde; grant DROP PUBLIC SYNONYM to sde; grant CREATE VIEW to sde; prompt * UNLIMITED TABLESPACE is not required. Grant this privilege prompt * if you do not wish to explicitly manage and grant tablespace quota to SDE user. grant UNLIMITED TABLESPACE to sde; prompt * ADMINISTER DATABASE TRIGGER can be revoked after install grant ADMINISTER DATABASE TRIGGER to sde; exit;执行该SQL语句,得到如下信息
[oracle@localhost ~]$ sqlplus sys/oracle@orcl as sysdba SQL*Plus: Release 11.2.0.1.0 Production on Wed Feb 22 11:44:53 2012 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> @ create.sql; * CREATESDEORACLE.SQL script * * * * Purpose: * * * * To create the SDE tablespace, the SDE Oracle user * * and grant privileges to the SDE user * * * * NOTES: 1. Before running this script * * Replace the word LOCATION with the pathname for * * the sde.dbf datafile to be created. * * * * 2. If upgrading remove rem from the grants and * * revokes in the upgrade section * * * * 3. Please use the sys user to run this script. * * You will also need the system user password * * * * Example: * * % sqlplus "sys as sydba" @createsdeoracle.sql * * * * * ************************************************************** * Granting of permissions by the SYS user in Oracle, on two packages * to the public role. Grant succeeded. Grant succeeded. * * * * * * * * * * * * * * * * ArcSDE NEW INSTALLATION * * * * * * * * * * * * * * * * * Connect as system/<password> to create the sde * tablespace and user. Connected. * Create the sde tablespace. * Before you run this script update LOCATION for the desired datafile pathname. Tablespace created. * Create the sde user * The password for the sde user is set to "sde". You may * change this if you wish. User created. * Granting the required privileges to the sde user. Grant succeeded. Grant succeeded. Grant succeeded. Grant succeeded. Grant succeeded. Grant succeeded. Grant succeeded. Grant succeeded. Grant succeeded. Grant succeeded. Grant succeeded. Grant succeeded. * UNLIMITED TABLESPACE is not required. Grant this privilege * if you do not wish to explicitly manage and grant tablespace quota to SDE user . Grant succeeded. * ADMINISTER DATABASE TRIGGER can be revoked after install Grant succeeded. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Pr oduction With the Partitioning, OLAP, Data Mining and Real Application Testing options测试sde用户是否可以连通
[oracle@localhost ~]$ sqlplus sde/sde@orcl SQL*Plus: Release 11.2.0.1.0 Production on Wed Feb 22 11:46:18 2012 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL>安装相关的ArcSDE软件
首先将ArcSDE光盘插入光驱,使用mount命令,如果条件允许也可以SSH工具直接传入
[root@localhost ~]# mount /dev/cdrom /opt/sde login as: root [email protected]'s password: Last login: Wed Feb 22 10:26:33 2012 from 192.168.221.1 [root@localhost ~]# mount /dev/cdrom /opt/sde mount: block device /dev/cdrom is write-protected, mounting read-only mount: /dev/cdrom already mounted or /opt/sde busy mount: according to mtab, /dev/hdc is already mounted on /opt/sde [root@localhost ~]# cd /opt/sde [root@localhost sde]# ls documentation_server htm install_db2.htm install_oracle.htm linux solaris hpia ibm install_informix.htm install_postgresql.htm quickstart.htm然后我们执行安装命令,安装过程中会提示用户软件安装介质在什么位置,这些软件需要安装到什么位置
[root@localhost oracle11g_64]# ./install -load 你可以读懂本行文字吗? Is the previous statement legible in your native language? [yes] Continue installation with the selected language interaction? [yes] 如果你已阅读并同意所附许可协议中的条款,请输入'yes'继续安装过程, 否则按<回车>键或输入'no'退出安装过程. [no] yes 敲回车选择默认项, '?'帮助, '^'返回到 上一个问题, 或'q'退出. 输入CD-ROM mount点: [/mediamnt] /opt/sde/linux/oracle11g_64/ 输入安装目录的路径名: [/opt/sde/linux/oracle11g_64] /home/arcsde/ ArcSDE version 10.0 for Oracle11g - May 20, 2010 -------------------------------------------------- ArcSDE Product 将要安装的软件模块号: [all] 软件模块选择完毕 -------------------------- 你选择了安装下列软件模块 ArcSDE Product ArcSDE Server 这正确吗? [yes] 安装时列出文件名吗? [no] 正在安装软件, 请等待... 软件安装完毕 退出... [root@localhost oracle11g_64]#根据用户软件安装的位置以及Oracle软件安装的信息,添加arcsde用户的环境变量
[arcsde@localhost ~]$ vi .bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs #export PATH=$PATH:$HOME/bin export ORACLE_BASE=/opt/oracle export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1 export ORACLE_SID=ORCL export TNS_ADMIN=$ORACLE_HOME/network/admin export SDEHOME=/home/arcsde/sdeexe100 export LD_LIBRARY_PATH=$SDEHOME/lib:/usr/lib:/lib:$ORACLE_HOME/lib export PATH=$PATH:$HOME:$ORACLE_HOME/bin:$SDEHOME/bin修改完毕环境变量,使之生效,然后测试一下是否生效
[arcsde@localhost ~]$ vi .bash_profile [arcsde@localhost ~]$ . ./.bash_profile [arcsde@localhost ~]$ echo $SDEHOME /home/arcsde/sdeexe100 [arcsde@localhost ~]$ cd $SDEHOME [arcsde@localhost sdeexe100]$ pwd /home/arcsde/sdeexe100 [arcsde@localhost sdeexe100]$修改配置文件参数,在ArcSDE用户下修改$SDEHOME/etc/services.sde文件添加实例名和端口号
[arcsde@localhost etc]$ vi services.sde [arcsde@localhost etc]$ more services.sde /* $Id: services.sde,v 1.2 1999/01/22 01:01:35 donna Exp $ */ # # ESRI SDE Remote Protocol # Note: uncomment the line below to use ESRI's default port # esri_sde 5151/tcp在Root用户下/etc/services文件一样添加
[root@localhost ~]# vi /etc/services
执行sdesetup命令出错
[arcsde@localhost bin]$ sdesetup -o -bash: sdesetup command not found查看一下sde软件的安装目录
[arcsde@localhost sdeexe100]$ ll 总计 20 drwxr-xr-x 2 root root 4096 02-22 13:34 bin drwxr-xr-x 2 root root 4096 02-22 13:48 etc drwxr-xr-x 2 root root 4096 02-22 13:34 lib drwxr-xr-x 4 10018 kmem 4096 2010-01-09 locale drwxr-xr-x 3 root root 4096 02-22 13:34 tools这么目录应该为arcsde用户所属oinstall组,切换到root用户执行以下
[root@localhost ~]# chown -R arcsde:oinstall /home/arcsde [root@localhost ~]# chmod -R 755 /home/arcsde [root@localhost ~]# su - arcsde [arcsde@localhost ~]$ cd $SDEHOME [arcsde@localhost sdeexe100]$ ll 总计 20 drwxr-xr-x 2 arcsde oinstall 4096 02-22 13:34 bin drwxr-xr-x 2 arcsde oinstall 4096 02-22 13:48 etc drwxr-xr-x 2 arcsde oinstall 4096 02-22 13:34 lib drwxr-xr-x 4 arcsde oinstall 4096 2010-01-09 locale drwxr-xr-x 3 arcsde oinstall 4096 02-22 13:34 tools创建SDE的Schema
[arcsde@localhost ~]$ sdesetup -o install -d oracle11g -p sde ESRI ArcSDE Server Setup Utility Wed Feb 22 14:37:22 2012 ---------------------------------------------------------------- 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..... Successfully 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.更新相关的lic,注意lic文件的所属用户,所属组以及读写权限
[arcsde@localhost ~]$ ll ×Ü¼Æ 16 -rwxrwxr-x 1 arcsde oinstall 527 02-22 09:42 ArcGIS Server10.ecp drwxrwxr-x 10 arcsde oinstall 4096 2010-05-15 Help drwxr-xr-x 3 arcsde arcsde 4096 02-22 14:37 oradiag_arcsde drwxrwxr-x 7 arcsde oinstall 4096 02-22 14:17 sdeexe100 [arcsde@localhost ~]$ sdesetup -o update_key -d oracle11g -l /home/arcsde/ArcGIS\ Server10.ecp -p sde ESRI ArcSDE Server Setup Utility Wed Feb 22 14:41:41 2012 ---------------------------------------------------------------- Successfully updated authorization key.启动ArcSDE服务
[arcsde@localhost ~]$ sdemon -o start -p sde Unable to get service name from '/home/arcsde/sdeexe100'. Set service name to use default 'esri_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): 25017 ArcSDE Instance esri_sde started Wed Feb 22 14:43:12 2012服务启动成功,使用ArcCatalog连接成功!