操作規範(三)——Linux 5.4安裝Oracle 11gR1(1)

xunzhaoxz發表於2011-05-27

操作規範(三)——Linux 5.4安裝Oracle 11gR1(1)

本文PDF版下載 http://www.itpub.net/thread-1440726-1-1.html

作者:xunzhao【轉載時請以超連結形式標明文章出處和作者資訊】

連結:http://xunzhaoxz.itpub.net/post/40016/518473

1. 環境說明

作業系統平臺:Redhat Linux 5.4

Oracle版本:Oracle 11gR1 11.1.0.6.0

資料儲存方式:檔案系統

主機名:ora11g

例項名:ora11g

[oracle@ora11g database]$ uname -a

Linux LinuxNBU65 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:54 EDT 2009 i686 i686 i386 GNU/Linux

[oracle@ora11g database]$ cat /etc/redhat-release

Red Hat Enterprise Linux Server release 5.4 (Tikanga)

[oracle@ora11g database]$ lsb_release -a

LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch

Distributor ID: RedHatEnterpriseServer

Description: Red Hat Enterprise Linux Server release 5.4 (Tikanga)

Release: 5.4

Codename: Tikanga

[oracle@ora11g database]$

[@more@]

2. 系統環境準備

2.1. 建立組、使用者

[root@ora11g /]# groupadd -g 501 oinstall

[root@ora11g /]# groupadd -g 502 dba

[root@ora11g /]# useradd -u 501 -g oinstall -G dba oracle

[root@ora11g /]# passwd oracle

[root@ora11g /]# mkdir /oracle

[root@ora11g /]# chown -R oracle:oinstall /oracle

[root@ora11g /]# chmod 755 -R /oracle

2.2. 提高Oracle使用者的shell 限制

使用文字編輯器將下面列出的行新增到/etc/security/limits.conf/etc/pam.d/login /etc/profile

2.2.1. /etc/security/limits.conf

[root@ora11g ~]#vi /etc/security/limits.conf 新增以下內容

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

2.2.2. /etc/pam.d/login

[root@ora11g ~]# vi /etc/pam.d/login 新增以下內容

session required pam_limits.so

2.2.3. /etc/profile

[root@ora11g ~]#vi /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

2.3. 配置核心引數。

使用文字編輯器將下面列出的行新增到 /etc/sysctl.conf。要使更改立即生效,請執行sysctl p

[root@ora11g ~]#vi /etc/sysctl.conf 新增以下內容

fs.file-max = 101365

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

net.ipv4.ip_local_port_range=1024 65000

net.core.rmem_default = 4194304

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 1048576

2.4. 修改 /etc/hosts 檔案。

# more /etc/hosts 根據實際環境新增相應主機、IP的對映

127.0.0.1 localhost

172.16.250.121 ora11g

2.5. 檢查軟體包

Oracle 11gR1官方文件中對軟體包的需求如下:

Asianux 3, Oracle Enterprise Linux 5, and Red Hat Enterprise Linux 5 The following packages (or later versions) must be installed:

binutils-2.17.50.0.6-2.el5

compat-libstdc++-33-3.2.3-61

elfutils-libelf-0.125-3.el5

elfutils-libelf-devel-0.125

gcc-4.1.1-52

gcc-c++-4.1.1-52

glibc-2.5-12

glibc-common-2.5-12

glibc-devel-2.5-12

glibc-headers-2.5-12

libaio-0.3.106

libaio-devel-0.3.106

libgcc-4.1.1-52

libstdc++-4.1.1

libstdc++-devel-4.1.1-52.e15

make-3.81-1.1

numactl-devel-0.9.8.i386

sysstat-7.0.0

unixODBC-2.2.11

unixODBC-devel-2.2.11

使用rpm q命令檢查下系統是否已經安裝了以上軟體包,上傳並安裝缺失的軟體包

[root@ora11g rpms]# rpm -ivh compat-db-4.2.52-5.1.i386.rpm

warning: compat-db-4.2.52-5.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:compat-db ########################################### [100%]

[root@ora11g rpms]#

[root@ora11g rpms]# rpm -ivh openmotif-2.2.4-0.1.i386.rpm

Preparing... ########################################### [100%]

1:openmotif ########################################### [100%]

[root@ora11g rpms]#

[root@ora11g rpms]# rpm -ivh compat-libstdc++-7.3-2.96.128.i386.rpm

warning: compat-libstdc++-7.3-2.96.128.i386.rpm: Header V3 DSA signature: NOKEY, key ID 025e513b

Preparing... ########################################### [100%]

file /usr/lib/libstdc++-3-libc6.2-2-2.10.0.so from install of compat-libstdc++-7.3-2.96.128.i386 conflicts with file from package compat-libstdc++-296-2.96-138.i386

[root@ora11g rpm]# rpm -e compat-libstdc++-296-2.96-138.i386

[root@ora11g rpm]# rpm -ivh compat-libstdc++-7.3-2.96.128.i386.rpm

compat-gcc-c++-7.3-2.96.128.i386.rpm

compat-gcc-7.3-2.96.128.i386.rpm

compat-libstdc++-devel-7.3-2.96.128.i386.rpm

warning: compat-libstdc++-7.3-2.96.128.i386.rpm: Header V3 DSA signature: NOKEY, key ID 025e513b

warning: compat-gcc-c++-7.3-2.96.128.i386.rpm: Header V3 DSA signature: NOKEY, key ID 73307de6

Preparing... ########################################### [100%]

1:compat-libstdc++ ########################################### [ 25%]

2:compat-gcc ########################################### [ 50%]

3:compat-libstdc++-devel ########################################### [ 75%]

4:compat-gcc-c++ ########################################### [100%]

[root@ora11g rpm]# [root@ora11g rpm]# rpm -ivh numactl-devel-0.9.8-2.el5.i386.rpm

warning: numactl-devel-0.9.8-2.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:numactl-devel ########################################### [100%]

[root@ora11g rpm]# rpm -ivh libaio-devel-0.3.106-3.2.i386.rpm

warning: libaio-devel-0.3.106-3.2.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:libaio-devel ########################################### [100%]

[root@ora11g rpm]#

[root@ora11g rpm]# rpm -ivh unixODBC-2.2.11-7.1.i386.rpm unixODBC-devel-2.2.11-7.1.i386.rpm

warning: unixODBC-2.2.11-7.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:unixODBC ########################################### [ 50%]

2:unixODBC-devel ########################################### [100%]

[root@ora11g rpm]#

2.6. Oracle 10gR211gR1Linux作業系統軟體包、核心引數的需求對比:

10.2.0.1/10.2.0.4

11.1.0.6

make-3.79

make-3.80

binutils-2.14

binutils-2.15.92.0.2

gcc-3.2

gcc-3.4.5

libaio-0.3.96

libaio-0.3.105

libaio-devel-0.3.105

libstdc++-3.4.5

elfutils-libelf-devel-0.97

sysstat-5.0.5

libgcc-3.4.5

libstdc++-devel-3.4.5

unixODBC-2.2.11

unixODBC-devel-2.2.11

semmsl=250

semmsl=250

semmns=32000

semmns=32000

semopm=100

semopm=100

semmni=128

semmni=128

shmmax=536870912

shmmax=536870912

shmmni=4096

shmmni=4096

shmall=2097152

shmall=2097152

file-max=65536

file-max=65536

VERSION=2.6.9

VERSION=2.6.9

ip_local_port_range=1024 - 65000

ip_local_port_range=1024 - 65000

rmem_default=262144

rmem_default=4194304

rmem_max=262144

rmem_max=4194304

wmem_default=262144

wmem_default=262144

wmem_max=262144

wmem_max=262144

SWAP 744MB

SWAP 1626MB

2.7. 檢查oracle使用者的配置檔案

[oracle@ora11g ~]$ vi .bash_profile 新增以下內容

export ORACLE_SID=ora11g

export ORACLE_BASE=/oracle

export ORACLE_HOME=$ORACLE_BASE/app/oracle/product/11.1

export INVENTORY_LOCATION=$ORACLE_BASE/oraInventory

export LD_LIBRARY_PATH=$ORACLE_HOME/lib

export NLS_LANG="American_america.zhs16gbk"

#export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"

export NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss';

export PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin

umask 022

[oracle@ora11g ~]$ mkdir -p $ORACLE_HOME

2.8. 建立必要的目錄並檢查許可權

[oracle@ora11g ~]$mkdir /oracle/oraInventory

[oracle@ora11g ~]$mkdir -p $ORACLE_HOME

[oracle@ora11g ~]$ls -l /

[oracle@ora11g ~]$ls -l /oracle

操作規範(三)——Linux 5.4安裝Oracle 11gR1 (2)

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22085031/viewspace-1050434/,如需轉載,請註明出處,否則將追究法律責任。

相關文章