在RHEL5.2上安装Oracle 数据库10g(二)

2.6  配置 RHEL5.2 内核参数(root)
 
    Linux 内核非常出色。与大多数其他UNIX 系统不同,Linux 允许在系统启动和运行时修改大多数内核参数。完成内核参数更改后不必重新启动系统。Oracle 数据库 10g 需要以下所示的内核参数设置。其中给出的是最小值,因此如果您的系统使用的值较大,则不要更改它。。
      kernel.shmall = 2097152
      kernel.shmmax = 2147483648
      kernel.shmmni = 4096
      kernel.sem = 250 32000 100 128
      fs.file-max = 65536
      net.ipv4.ip_local_port_range = 1024 65000
      具体地,是修改 /etc/sysctl.conf的内容。通常,网上使用cat或者vi来编辑该文件。其实,gedit比这些都好用多了,并且对照来看看哪些参数可以设置了,尤其是cat只是追加上去,可能会造成一个参数有多个配置。下面是我的配置情况:
# 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

# For Oracle Install

kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
# 这几个参数不在Oracle文档内。在Oracle安装自检时,却会检测这些参数。
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144

      增加的这几个参数(rmem_default、rmem_max、wmem_default、wmem_max),一开始我没设置,在Oracle安装自检时会报警告错误。这部分提前说明,具体警报信息如下:
      [oracle@RHEL oracle]$ cd /usr/app/oracle/install
      [oracle@RHEL install]$ ./runInstaller
Starting Oracle Universal Installer...

Checking installer requirements...

Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
                                                                          Passed


All installer requirements met.

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2008-12-30_04-17-29PM. Please wait ...



Checking operating system requirements ...
Expected result: One of redhat-3,redhat-4,SuSE-9,asianux-1,asianux-2
Actual Result: redhat-4
Check complete. The overall result of this check is: Passed
=======================================================================

Checking operating system package requirements ...
Checking for make-3.79; found make-1:3.81-3.el5.      Passed
Checking for binutils-2.14; found binutils-2.17.50.0.6-6.el5.      Passed
Checking for gcc-3.2; found gcc-4.1.2-42.el5.      Passed
Checking for libaio-0.3.96; found libaio-0.3.106-3.2.      Passed
Check complete. The overall result of this check is: Passed
=======================================================================

Checking kernel parameters
Checking for semmsl=250; found semmsl=250.      Passed
Checking for semmns=32000; found semmns=32000.      Passed
Checking for semopm=100; found semopm=100.      Passed
Checking for semmni=128; found semmni=128.      Passed
Checking for shmmax=536870912; found shmmax=4294967295.      Passed
Checking for shmmni=4096; found shmmni=4096.      Passed
Checking for shmall=2097152; found shmall=268435456.      Passed
Checking for file-max=65536; found file-max=65536.      Passed
Checking for VERSION=2.6.9; found VERSION=2.6.18-92.el5xen.      Passed
Checking for ip_local_port_range=1024 - 65000; found ip_local_port_range=1024 - 65000.      Passed
Checking for rmem_default=262144; found rmem_default=109568.      Failed <<<<
Checking for rmem_max=262144; found rmem_max=131071.      Failed <<<<
Checking for wmem_default=262144; found wmem_default=109568.      Failed <<<<
Checking for wmem_max=262144; found wmem_max=131071.      Failed <<<<
Check complete. The overall result of this check is: Failed <<<<
Problem: The kernel parameters do not meet the minimum requirements (see above).
Recommendation: Perform operating system specific instructions to update the kernel parameters.
=======================================================================

Checking Recommended glibc version
Expected result: ATLEAST=2.3.2-95.27
Actual Result: 2.5-24
Check complete. The overall result of this check is: Passed
=======================================================================

Checking physical memory requirements ...
Expected result: 922MB
Actual Result: 1060MB
Check complete. The overall result of this check is: Passed
=======================================================================

Checking available swap space requirements ...
Expected result: 1590MB
Actual Result: 1983MB
Check complete. The overall result of this check is: Passed
=======================================================================

Checking Network Configuration requirements ...
Check complete. The overall result of this check is: Passed
=======================================================================

Validating ORACLE_BASE location (if set) ...
Check complete. The overall result of this check is: Passed
=======================================================================

Checking Oracle Home path for spaces...
Check complete. The overall result of this check is: Passed
=======================================================================

Checking for proper system clean-up....
Check complete. The overall result of this check is: Passed
=======================================================================

Checking for Oracle Home incompatibilities ....
Actual Result: NEW_HOME
Check complete. The overall result of this check is: Passed
=======================================================================
      如果进行了上述设置之后,那么自检的时候就会全部Passed。可以通过 /sbin/sysctl -p来查看 /etc/sysctl.conf的配置情况。
      2.7  为 oracle 用户设置 Shell 限制(root)
      Oracle 建议对每个 Linux 帐户可以使用的进程数和打开的文件数设置限制。要进行如下这些更改。同样使用gedit来完成。
      在 /etc/security/limits.conf中增加如下配置:
# For Oracle Install
oracle               soft    nproc   2047
oracle               hard    nproc   16384
oracle               soft    nofile  1024
oracle               hard    nofile  65536
      在 /etc/pam.d/login中增加如下配置:
# For Oracle Install
session    required     /lib/security/pam_limits.so
      在 /etc/profile中增加如下配置:
# For Oracle Install
if [ \$USER = "oracle" ]; then 
      if [ \$SHELL = "/bin/ksh" ]; then
            ulimit -p 16384
            ulimit -n 65536
      else
            ulimit -u 16384 -n 65536
      fi
      umask 022
fi

      在 /etc/csh.login中增加如下配置:
# For Oracle Install
if ( \$USER == "oracle" ) then
      limit maxproc 16384
      limit descriptors 65536
      umask 022
endif
      2.8 配置 oracle 用户的环境变量( oracle )
      上面的操作都是在root用户下,这个配置需要以oracle用户登录系统进行配置。
      [oracle@RHEL ~]$ gedit .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

export PATH


# For Oracle Install

TMP=/tmp; export TMP

TMPDIR=$TMP; export TMPDIR

ORACLE_BASE=/usr/app/oracle; export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME

ORACLE_SID=orcl; export ORACLE_SID

ORACLE_TERM=xterm; export ORACLE_TERM

PATH=/usr/sbin:$PATH; export PATH

PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH

CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

if [ $USER = "oracle" ]; then
              if [ $SHELL = "/bin/ksh" ]; then
                          ulimit -p 16384
                          ulimit -n 65536
              else
                          ulimit -u 16384 -n 65536
              fi
fi
      2.9 配置 oracle 用户的环境变量(root )
      有的提到需要修改 /etc/hosts文件,将127.0.0.1修改成为你的实际IP地址,否则有可能导致安装Oracle的时候,检查网络配置异常。我也按照这个做了,但之后可能有麻烦,稍后再说。我是将其注释掉,具体修改如下:
# Do not remove the following line, or various programs
# that require network functionality will fail.
# ::1      localhost.localdomain      localhost      RHEL
# 127.0.0.1      RHEL.smnpc.com      localhost RHEL
10.10.10.197         RHEL.smnpc.com  RHEL
      2.10 Oracle支持的RHEL版本( root )
      在2.6中Oracle安装自检时,列出了Oracle10g支持的版本是:must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2。而我的系统是5.2。这里需要欺骗一下,具体的是修改文件/etc/redhat-release。
      [root@RHEL ~]# more /etc/redhat-release
      Red Hat Enterprise Linux Server release 5.2 (Tikanga)
      将5.2修改成4即可。网上也有说 $ ./runInstaller -ignoreSysPrereqs方式来避免自检,但我没有实验过。也有的通过如下方式:
      [root@RHEL ~]# gedit /usr/app/oracle/install/install/oraparam.ini
###[Certified Versions]
Linux=redhat-3,SuSE-9,redhat-4,redhat-5,UnitedLinux-1.0,asianux-1,asianux-2]

再添加
[Linux-redhat-5.0-optional]TEMP_SPACE=80
SWAP_SPACE=150
MIN_DISPLAY_COLORS=256

      但是,更多还是推荐第一种方式。至此,已经完成oracle 10g安装前的准备了。

转自 http://blog.sina.com.cn/s/blog_3f2ef1180100bsuv.html

你可能感兴趣的:(oracle,数据库,职场,休闲)