Ubuntu下安裝ArcSDE 9.1

來源:互聯網
上載者:User

雖然ESRI的官方文檔如何安裝ArcSDE已經很詳細了(英文的),而且網上也有很多參考資料,但是這裡還是針對自己的習慣以及針對Ubuntu,用中文做一下說明,只是為了之後自己方便查閱。

1. 安裝環境
我們安裝的ArcSDE版本是9.1 for Oracle 10gR2,根據ESRI的官方文檔,針對Oracle 9i的可以直接用來給10g,只不過有一些改動。
1. All references to Oracle9i can be changed to Oracle10gR2.
2. All references to the sdesetupora9i command should be substituted with sdesetupora10g.
3. All references to the sdeservice –o create –d oracle9i,SID command should be substituted with sdeservice –o create –d oracle10g,SID
4. UNIX installations/System Requirements

The ArcSDE 9.1 for Oracle10gR2 release is available on the following UNIX and Linux platforms:
Solaris 64bit
AIX 64bit
Red Hat Linux

2. 安裝前的準備
a. 安裝好Oracle 10g,在Ubuntu上安裝Oracle 10g可以參考這篇文檔。
b. 建立並設定好sde使用者。
ArcSDE需要一個名為sde的使用者,這個使用者其他的屬性都不重要,所以我將其所屬的組設定為admin,以便於使用sudo。
官方文檔上說shell應當設定為/bin/sh或者/bin/csh,我這裡設定成bash,也可以。
同時,將sde加入oinstall組,是為了使之能運行一些oracle命令,同時使用oracle的一些動態連結程式庫。
建立使用者
sudo useradd -g admin -G oinstall -d /home/sde -s /bin/bash -m -k /etc/skel sde
設定密碼
sudo passwd sde
輸入你為sde使用者佈建的密碼。
然後su sde,登入sde使用者,或者直接退出目前使用者,用sde使用者登入。
c. 設定環境變數。
在.bashrc檔案裡修改(ubuntu預設.profile檔案讀取.bashrc檔案,而且.bashrc檔案在每次登入的時候都會讀取),需要設定的環境變數如下:

SDEHOME #ArcSDE安裝的地方
ORACLE_HOME #Oracle安裝的地方
ORACLE_SID #Oracle SID的值
TNS_ADMIN #tnsnames.ora檔案所在的地方
PATH $PATH:$SDEHOME/bin:$ORACLE_HOME/bin
LD_LIBRARY_PATH $SDEHOME/lib:/usr/lib:/lib:$ORACLE_HOME/lib (All platforms except HP and IBM)
SHLIB_PATH $SDEHOME/lib:/usr/lib:/lib:$ORACLE_HOME/lib (for HP only)
LIBPATH $SDEHOME/lib:/usr/lib:/lib:$ORACLE_HOME/lib (for IBM only)
TWO_TASK #value for TWO_TASK (if ArcSDE and Oracle on different machines)


如果Oracle資料庫安裝在本地,那麼ORACLE_HOME和ORACLE_SID是需要設定並且起作用的,而,如果設定了TWO_TASK,那麼它們就不起作用。
TWO_TASK指出在遠程安裝的Oracle的地址。如果在本地安裝的Oracle,那麼就不需要指出TNS_ADMIN和TWO_TASK。
注意:ArcSDE啟動的時候,giomgr進程會讀取$SDEHOME/etc/dbinit.sde檔案中的設定,這會覆蓋掉在.profile檔案中的設定。
我的環境變數的設定如下:
umask 022export ORACLE_BASE=/opt/oracleexport SDEHOME=/home/sde/sdeexe91export ORACLE_HOME=/opt/oracleexport ORACLE_SID=GISexport PATH=$SDEHOME/bin:$ORACLE_HOME/bin:$PATHexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:$SDEHOME/lib:/usr/lib:/lib:$LD_LIBRARY_PATH:$ORACLE_HOME/lib/stubs

d. 建立Oracle資料庫使用者和tablespace。
i. 建立tablespace。
tablespace至少需要200M的空間,我們這裡建立成2G,最大是unlimited。
由於Oracle推薦使用本地管理資料表空間,那麼這裡就設定成本地管理。關於本地管理和資料字典管理的定義和比較,請參閱下面的文檔:

Locally Managed Tablespaces:
A tablespace that manages its own extents maintains a bitmap in each datafile to keep track of the free or used status of blocks in that data file. Each bit in the bitmap corresponds to a block or a group of blocks. When an extent is allocated or freed for reuse, the Oracle server changes the bitmap values to show the new status of the blocks.

Dictionary-Managed Tablespaces:
For a tablespace that uses the data dictionary to manage its extents, the Oracle server updates the appropriate tables in the data dictionary whenever an extent is allocated or deallocated.

Advantages of Locally Managed Tablespaces:
Locally managed tablespaces have the following advantages over dictionary-managed tablespaces:
Local management avoids recursive space management operations, which can occur in dictionary-managed tablespaces if consuming or releasing space in an extent results in another operation that consumes or releases space in a undo segment or data dictionary table.
Because locally managed tablespaces do not record free space in data dictionary tables, it reduces contention on these tables.
Local management of extents automatically tracks adjacent free space, eliminating the need to coalesce free extents.
The sizes of extents that are managed locally can be determined automatically by the system. Alternatively, all extents can have the same size in a locally managed tablespace.
Changes to the extent bitmaps do not generate undo information because they do not update tables in the data dictionary (except for special cases such as tablespace quota information).


關於這兩種管理方式效能的比較可以參看http://db.rdxx.com/Oracle/2006-5/18/190634694.shtml
建立tablespace的語句是:
CREATE TABLESPACE sde DATAFILE'/opt/oradata/GIS/SDE/SDE.dbf' SIZE 2000MAUTOEXTEND ONNEXT 32MMAXSIZE UNLIMITEDLOGGINGEXTENT MANAGEMENT LOCAL UNIFORM SIZE 1MSEGMENT SPACE MANAGEMENT AUTO;

在做這部之前,需要用oracle使用者登入,然後在/opt/oradata/GIS/下建立SDE文夾。
其中,EXTENT MANAGEMENT LOCAL是指本地管理方式,UNIFORM 是指對於一個表來說,每次增加分配的空間大小(extent的大小)。
而NEXT是指對於tablespace來說,每次空間不夠的時候再次分配的大小。
這裡有一段話,可以表明這兩者的一些區別:
“每次分配extent時是一個消耗資源的操作,當然是分配次數越少越好。在有些情況下,這也會直接影響效能。例如,在執行批量插入時,如果你的 extent太小,很快就要用完,就得再分配下一個,這時insert進程就只能等待系統去分配下一個extent.在這種情況下分配大一點的 extent會有助於提高效能。另外一點是extent是由連續的block組成的,extent大的話,資料存放會比較集中。這對於順序讀可能有利,但對於隨機讀則不見得有什麼好處。並且現在資料檔案基本上都是放在儲存上,儲存已經把空間分散到不同的磁碟上了。即使在oracle看來是連續的空間,在儲存上實際也可能是分散的。http://www.britepic.org/
如果你的表確實很大,那就分配大一些的extent,如果表比較小就分配小一些的extent.”
我的理解是,如果tablespace的空間不足了,那麼分配NEXT標明的大小。在tablespace空間足夠的情況下,在往tablespace中的table裡插入資料的時候,如果一次插入的資料大於UNIFORM的值,那麼就需要再次分配UNIFORM規定的大小。
所以,如果每次插入的資料量比較大,那麼可以考慮UNIFORM的值大一些。

SEGMENT SPACE MANAGEMENT應當設定為AUTO,這個網頁http://www.databasejournal.com/features/oracle/article.php/1576991
闡述了為什麼設定成AUTO的好處。
其餘參數可以參看Oracle的說明,這裡推薦一個網頁:http://www.psoug.org/reference/tablespaces.html
同時,這裡有兩幅Oracle提供的圖,能夠很清楚的看出如何建立和修改tablespace。
建立tablespace:

修改tablespace:

ii. 建立sde使用者。
使用sqlplus,建立的sql語句是:
CREATE USER sdeIDENTIFIED BY 你的密碼DEFAULT TABLESPACE sdeTEMPORARY TABLESPACE TEMP;

建立使用者的sql語句很簡單,關於其參數可以參看這個網頁http://www.psoug.org/reference/user.html

  • 1
  • 2
  • 3
  • 下一頁

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.