天天看點

linux下Oracle 10g的安裝(一)

一、實驗環境:

虛拟機版本号:Workstation 6.5-7.0 virtual machine

Redhat版本号:Red Hat Enterprise Linux Server release 5.4 (Tikanga)

核心版本号:2.6.18-164.el5

以root使用者登入linux系統。預設語言為英語。

Oracle 10g軟體包。解壓後負責到系統根目錄下。

建立本地yum庫,挂載CD光牒鏡像檔案。

三塊磁盤sda、sdb、sdc,sdb1挂載到u01目錄下,sdc1挂載到u02目錄下。

二、預安裝步驟:

本次試驗的步驟依據Oracle官方網站提供的文檔而做,有個别步驟可以省略。

在linux下,安裝Oracle時對系統的要求有點高,安裝前需要對系統進行檢查。

1、 檢查實體記憶體和虛拟記憶體,實體記憶體至少為1G ,虛拟記憶體為實體記憶體的2倍。

(當實體記憶體小于2G時,虛拟記憶體是實體記憶體的2倍;實體記憶體大于2G時,虛拟記憶體在此基礎加2即可)

實體記憶體<b> </b>

基本 - 512MB推薦 - 1024MB 

記憶體交換分區相對于實體記憶體的比例 

實體記憶體1024MB~2048MB - 200% 

實體記憶體2049MB~8192MB - 100% 

實體記憶體大于8192MB - 75%

2、檢查tmp目錄的大小。<b> </b>

/tmp目錄所在的分區至少要有400MB空閑磁盤空間。 

根據安裝類型,安裝Oracle伺服器軟體的分區至少要有1.5GB到3.5GB的空閑磁盤空間。 

1.2GB磁盤空間用于資料庫預配置檔案系統存儲(可選)

<a href="http://linuxtro.blog.51cto.com/attachment/201003/23/1239505_1269342298jZB0.jpg"></a>

3、修改/etc/issue檔案,将版本号改為4.4,目前Oracle官方隻在5.0以下的版本上測試過。由于在後面安裝Oracle時,會檢查系統版本号,為了避免檢測通不過,最好修改為4.4,修改後檢視資訊如圖:

可以通過執行uname –r來檢視核心版本号。

<a href="http://linuxtro.blog.51cto.com/attachment/201003/23/1239505_1269342306kDh5.jpg"></a>

4、安裝所需的軟體包版本

binutils-2.15.92.0.2-13.EL4

compat-db-4.1.25-9

compat-libstdc++-296-2.96-132.7.2

control-center-2.8.0-12

gcc-3.4.3-22.1.EL4

gcc-c++-3.4.3-22.1.EL44

glibc-2.3.4-2.9

glibc-common-2.3.4-2.9

gnome-libs-1.4.1.2.90-44.1(可以不安裝)

libstdc++-3.4.3-22.1

libstdc++-devel-3.4.3-22.1

make-3.80-5

pdksh-5.2.14-30

sysstat-5.0.5-1

xscreensaver-4.18-5.rhel4.2(可以不安裝)

setarch-1.6-1

安裝時版本号可能不同,以上這些是最低版本。建議用yum庫來安裝軟體包,可以解決很多包依賴關系。

<a href="http://linuxtro.blog.51cto.com/attachment/201003/23/1239505_1269342313DQMx.jpg"></a>

【注:】除了以上的軟體包,還有兩個軟體包libXp和libXp-devel是必須要安裝的,

<a href="http://linuxtro.blog.51cto.com/attachment/201003/23/1239505_1269342320azeP.jpg"></a>

5、檢視主機名,修改主機名為oracle.example.com

保證NIS域為空。修改hosts檔案,

添加192.168.0.85 oracle.example.com oracle

<a href="http://linuxtro.blog.51cto.com/attachment/201003/23/1239505_1269342331eYMw.jpg"></a>

6、添加組:oinstall、dba和oper;使用者:oracle,

查詢oracle使用者,附加組為oinstall、dba、oper。并為oracl使用者設定密碼。

<a href="http://linuxtro.blog.51cto.com/attachment/201003/23/1239505_1269342344wjR9.jpg"></a>

<a href="http://linuxtro.blog.51cto.com/attachment/201003/23/1239505_1269342357TJYe.jpg"></a>

<a href="http://linuxtro.blog.51cto.com/attachment/201003/23/1239505_12693423678YJL.jpg"></a>

7、查詢是否存在nobody使用者,如不存在,添加之。

<a href="http://linuxtro.blog.51cto.com/attachment/201003/23/1239505_1269342373DTjg.jpg"></a>

8、編輯/etc/sysctl.conf檔案,添加下列參數:

1.    kernel.shmall = 2097152

2.    kernel.shmmax = 2147483648

3.     kernel.shmmni = 4096

4.     kernel.sem = 250 32000 100 128

5.     fs.file-max = 65536

6.     net.ipv4.ip_local_port_range = 1024 65000

7.     net.core.rmem_default = 1048576

8.     net.core.rmem_max = 1048576

9.     net.core.wmem_default = 262144

10.   net.core.wmem_max = 262144

完成後儲存退出,并執行sysctl –p指令來從新讀取該檔案。

<a href="http://linuxtro.blog.51cto.com/attachment/201003/23/1239505_1269342385WtBI.jpg"></a>

9、編輯/etc/security/limits.conf檔案,添加如下内容,并儲存退出。

1.           oracle              soft    nproc   2047

2.           oracle              hard    nproc   16384

3.           oracle              soft    nofile  1024

4.           oracle              hard    nofile  65536

檢視是否添加成功。

<a href="http://linuxtro.blog.51cto.com/attachment/201003/23/1239505_1269342393R7eo.jpg"></a>

10、編輯/etc/pam.d/login檔案,添加如下内容,并儲存退出。

1.           session    required     /lib/security/pam_limits.so

2.           session    required     pam_limits.so

<a href="http://linuxtro.blog.51cto.com/attachment/201003/23/1239505_1269342413LIWo.jpg"></a>

11、編輯/etc/profile檔案,添加如下内容,并儲存退出。

if [ $USER = "oracle" ]; then 

        if [ $SHELL = "/bin/ksh" ]; then 

              ulimit -p 16384               ulimit -n 65536    

       else       

        ulimit -u 16384 -n 65536    

       fi

fi

<a href="http://linuxtro.blog.51cto.com/attachment/201003/23/1239505_1269342423CI9U.jpg"></a>

12、建立挂載點u01和u02,将sdb1、 sdc1分别挂載到以上兩個挂載點上。并檢視是否挂載成功,要實作開機挂載,可以在/etc/fstab檔案中添加以下兩行:

/dev/sdb1 /u01 ext3 defaults 0 0

/dev/sdc1 /u02 ext3 defaults 0 0

儲存退出。

<a href="http://linuxtro.blog.51cto.com/attachment/201003/23/1239505_1269342427MVCh.jpg"></a>

<a href="http://linuxtro.blog.51cto.com/attachment/201003/23/1239505_1269342431Yyha.jpg"></a>

<a href="http://linuxtro.blog.51cto.com/attachment/201003/23/1239505_1269342435IZHd.jpg"></a>

13、修改u01 u02的所屬主和所屬組分别為oracle和oinstall,權限為775

<a href="http://linuxtro.blog.51cto.com/attachment/201003/23/1239505_1269342440kbSw.jpg"></a>

14、切換到oracle使用者,并在u01下建立目錄/u01/app/oracle/product/10.2.0/db_1 如果現在不建立,在安裝Oracle時回自動建立。

在u02下建立/oradata目錄和flash_reconvery_area目錄。

<a href="http://linuxtro.blog.51cto.com/attachment/201003/23/1239505_1269342447gohH.jpg"></a>

<a href="http://linuxtro.blog.51cto.com/attachment/201003/23/1239505_1269342460k8KZ.jpg"></a>

15、切換回root使用者。執行xhost +指令。

xhost + 的作用是允許任何人任何主機在本地主機顯示圖形視窗。

<a href="http://linuxtro.blog.51cto.com/attachment/201003/23/1239505_1269342468zu6M.jpg"></a>

16、重新登入到oracle使用者,設定oracle環境變量,

vim .bash_profile 如圖所示:

<a href="http://linuxtro.blog.51cto.com/attachment/201003/23/1239505_1269342476hAkw.jpg"></a>

修改完成後儲存退出,并重新讀取環境變量,指令為

 .bash_profile 然後執行ehco $PATH指令檢視是否讀取成功。

<a href="http://linuxtro.blog.51cto.com/attachment/201003/23/1239505_1269342485HVRM.jpg"></a>

到此為止,Oracle的預安裝已經完成了,接下來要做的就是資料庫的安裝了。

本文轉自 linuxtro 51CTO部落格,原文連結:http://blog.51cto.com/linuxtro/287182,如需轉載請自行聯系原作者

繼續閱讀