RedHat Enterprise Linux as 5.4上安裝Oracle 10g 10.2.0.1.0

 

1.檢視linux核心版本和發行版本,預設oracle10不支援rhel5,所以需要修改/etc/issue檔案,將5.4改為“4.4

[oracle@oraserver ~]$ uname -r

2.6.18-164.el5

[oracle@oraserver ~]$ cat /etc/issue

Red Hat Enterprise Linux Server release 5.4 (Tikanga)   ##改為4.4

Kernel
on an m

[oracle@oraserver ~]$ cat /etc/issue.net

Red Hat Enterprise Linux Server release 5.4 (Tikanga)  ##改為4.4

Kernel
on an m

2.建立oracle安裝目錄和oracle軟體包目錄,如下圖

[root@oraserver ~]# mkdir -p /ora10g/progame/oracle     準備做安裝目錄

[root@oraserver ~]# mkdir -p /oracle10g/data            oracle軟體包目錄

3.建立用於安裝和維護 OracleLinux 組和使用者帳戶。使用者帳戶將稱為 oracle

[root@oraserver ~]# groupadd oinstall

[root@oraserver ~]# groupadd dba

[root@oraserver ~]# useradd -g oinstall -G dba oracle

[root@oraserver ~]# passwd oracle

Changing password for user oracle.

New UNIX password:

BAD PASSWORD: it is based on a dictionary word

Retype new UNIX password:

passwd: all authentication tokens updated successfully.

 

[root@oraserver ~]# chown -R oracle:oinstall /ora10g /oracle10g/

 

4. 配置 Linux 核心引數,因為是在虛擬機器環境,所以很多都規劃為較小的值,如果系統夠強大,可以根據情況規劃大點

[root@oraserver ora10g]# vim /etc/sysctl.conf

# Kernel sysctl configuration file for Red Hat Linux#

# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and

# sysctl.conf(5) for more details.

# Controls IP packet forwarding

net.ipv4.ip_forward = 0

# Controls source route verification

net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing

net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel

# Kernel sysctl configuration file for Red Hat Linux#

# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and

# sysctl.conf(5) for more details.

# Controls IP packet forwarding

net.ipv4.ip_forward = 0

# Controls source route verification

net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing

net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel

kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename

# Useful for debugging multi-threaded applications

kernel.core_uses_pid = 1

# Controls the use of TCP syncookies

net.ipv4.tcp_syncookies = 1

# Controls the maximum size of a message, in bytes

kernel.msgmnb = 65536

# Controls the default maxmimum size of a mesage queue

kernel.msgmax = 65536

# Controls the maximum shared segment size, in bytes

#kernel.shmmax = 4294967295

# Controls the maximum number of shared memory segments, in pages

#kernel.shmall = 268435456

kernel.shmall = 2097152  表示系統一次可以使用的共享記憶體總量(以頁為單位)。

kernel.shmmni = 4096     表示設定系統範圍內單個共享記憶體段的最小值。

kernel.shmmax = 2147483648  該引數定義了共享記憶體段的最大尺寸(以位元組為單位)。

fs.file-max = 65536               表示檔案控制程式碼的最大數量。

kernel.sem = 250 32000 100 128   sem 4個引數依次是

net.core.rmem_default = 1048576   預設的接收視窗大小

net.core.rmem_max = 262144         接收視窗的最大大小

net.core.wmem_default = 262144    預設的傳送視窗大小

net.core.wmem_max = 262144       傳送視窗的最大大小

net.ipv4.ip_local_port_range = 1024 65000   表示埠範圍

 

5.使核心配置引數不重啟馬上生效,

[root@oraserver ora10g]# sysctl -p

net.ipv4.ip_forward = 0

net.ipv4.conf.default.rp_filter = 1

net.ipv4.conf.default.accept_source_route = 0

kernel.sysrq = 0

kernel.core_uses_pid = 1

net.ipv4.tcp_syncookies = 1

kernel.msgmnb = 65536

kernel.msgmax = 65536

kernel.shmall = 2097152

kernel.shmmni = 4096

kernel.shmmax = 2147483648

fs.file-max = 65536

kernel.sem = 250 32000 100 128

net.core.rmem_default = 1048576

net.core.rmem_max = 262144

net.core.wmem_default = 262144

net.core.wmem_max = 262144

net.ipv4.ip_local_port_range = 1024 65000

 

6.修改維護資料庫使用者oracle的環境變數,如下圖:

[oracle@oraserver ~]$ vim .bash_profile

# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

        . ~/.bashrc

fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

ORACLE_BASE=/ora10g/progame/oracle; export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE; export ORACLE_HOME

ORACLE_SID=orcl; export ORACLE_SID

PATH=$PATH:$ORACLE_HOME/bin

export PATH

7.重新讀取.bash_profile檔案內容,或者重新啟動也可。

[oracle@oraserver ~]$ source .bash_profile

[oracle@oraserver ~]$ echo $PATH

/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin:/home/oracle/bin:/ora10g/progame/oracle/bin