centos 7-64bit 安裝 oracle11g


// 註釋 # root用戶 $oracle用戶
1. 關閉安全措施
 
# chkconfig iptables off // 永久關閉防火牆
# service iptables stop // 暫時關閉防火牆,重啓系統後會自動打開
# sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config // 關閉Selinux
 
2. 驗證硬件
2.1 內存:
要求:內存最小1G,推薦2G或者更高。
查看命令:# grep MemTotal /proc/meminfo
 
2.2 Swap:
要求:
RAW
 Swap
1G至2G  1.5倍
2G至16G  同RAW相等
16G以上  16G
查看命令:# grep SwapTotal /proc/meminfo
          # free
 
3. 驗證軟件
3.1 操做系統linux

    Asianux Server 3 SP2
    Oracle Linux 4 Update 7
    Oracle Linux 5 Update 2 (with Red Hat Compatible Kernel)
    Oracle Linux 5 Update 5
    Oracle Linux 6
    Oracle Linux 6 (with Red Hat Compatible Kernel)
    Red Hat Enterprise Linux 4 Update 7
    Red Hat Enterprise Linux 5 Update 2
    Red Hat Enterprise Linux 5 Update 5 (with the Oracle Unbreakable Enterprise Kernel for Linux)
    Red Hat Enterprise Linux 6
    Red Hat Enterprise Linux 6 (with the Oracle Unbreakable Enterprise Kernel for Linux)
    SUSE Linux Enterprise Server 10 SP2
    SUSE Linux Enterprise Server 11c++

CentOS7本文按照Red Hat Enterprise Linux 6來配置。
 
# cat /proc/version // 查看版本
 
3.2 內核數據庫

    On Oracle Linux 4 and Red Hat Enterprise Linux 4 2.6.9 or later
    On Oracle Linux 5 Update 2 with Red Hat Compatible Kernel 2.6.18 or later
    On Oracle Linux 5 Update 5 with Red Hat Compatible Kernel 2.6.18 or later
    On Oracle Linux 5 Update 5 with Unbreakable Enterprise Kernel 2.6.32-100.0.19 or later
    On Oracle Linux 6 2.6.32-100.28.5.el6.x86_64 or later
    On Oracle Linux 6 with Red Hat Compatible Kernel 2.6.32-71.el6.x86_64 or later
    On Red Hat Enterprise Linux 5 Update 2 2.6.18 or later
    On Red Hat Enterprise Linux 5 Update 5 2.6.18 or later
    On Red Hat Enterprise Linux 5 Update 5 with Unbreakable Enterprise Kernel 2.6.32 or later
    On Red Hat Enterprise Linux 6 2.6.32-71.el6.x86_64 or later
    On Red Hat Enterprise Linux 6 with Unbreakable Enterprise Kernel 2.6.32-100.28.5.el6.x86_64 or later
    On Asianux Server 3 2.6.18 or later
    On SUSE Linux Enterprise Server 10 2.6.16.21 or later
    On SUSE Linux Enterprise Server 11 2.6.27.19 or later安全

# uname-r
 
3.3 驗證須要的包:
# rpm -qa binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers glibc-static kernel-headers pdksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel libstdc++-static make numactl-devel sysstat unixODBC unixODBC-devel // 驗證命令26個包bash

    kernel-headers-3.10.0-123.el7.x86_64
    gcc-c++-4.8.2-16.el7.x86_64
    numactl-devel-2.0.9-2.el7.x86_64
    glibc-headers-2.17-55.el7.x86_64
    glibc-common-2.17-55.el7.x86_64
    binutils-2.23.52.0.1-16.el7.x86_64
    unixODBC-devel-2.3.1-10.el7.x86_64
    libaio-0.3.109-12.el7.x86_64
    make-3.82-21.el7.x86_64
    elfutils-libelf-0.158-3.el7.x86_64
    elfutils-libelf-devel-0.158-3.el7.x86_64
    sysstat-10.1.5-4.el7.x86_64
    glibc-static-2.17-55.el7.x86_64
    glibc-devel-2.17-55.el7.x86_64
    glibc-2.17-55.el7.x86_64
    elfutils-libelf-devel-static-0.158-3.el7.x86_64
    libaio-0.3.109-12.el7.i686
    gcc-4.8.2-16.el7.x86_64
    libgcc-4.8.2-16.el7.i686
    libstdc++-static-4.8.2-16.el7.x86_64
    libaio-devel-0.3.109-12.el7.x86_64
    libstdc++-4.8.2-16.el7.x86_64
    libaio-devel-0.3.109-12.el7.i686
    unixODBC-2.3.1-10.el7.x86_64
    libstdc++-devel-4.8.2-16.el7.x86_64
    compat-libstdc++-33-3.2.3-71.el7.x86_64
    libgcc-4.8.2-16.el7.x86_64
    libgomp-4.8.2-16.el7.x86_64服務器

#rpm -ivh 安裝包名 // 安裝程序包session

yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33*.i686 elfutilslibelf-devel gcc gcc-c++ glibc*.i686 glibc glibc-devel glibc-devel*.i686 ksh libgcc*.i686 libgcc
libstdc++ libstdc++*.i686 libstdc++-devel libstdc++-devel*.i686 libaio libaio*.i686 libaio-devel
libaio-devel*.i686 make sysstat unixODBC unixODBC*.i686 unixODBC-devel unixODBCdevel*.i686 libXp
 
4. 建立組和用戶
# groupadd dba
# groupadd oinstall
# useradd -m -g oinstall -G dba oracle
# passwd oracle
// 若是nobody用戶不存在(id nobody命令查看),則建立:
# useradd nobody
 
5. 配置內核
注:配置大於系統數據須要配置更改,不然不須要配置。
 
要求配置:
參數  最小值  文件  命令
semmsl
semmns
semopm
semmni
 
50
32000
100
128
 
/proc/sys/kernel/sem
 
# /sbin/sysctl -a | grep sem
shmall
 
2097152
 
/proc/sys/kernel/shmall
 # /sbin/sysctl -a | grep shm
shmmax
 
4294967296
 
/proc/sys/kernel/shmmax
// 最大共享內存,官方文檔建議是內存的1/2
// 個人服務器是8G內存,因此爲4*1024*1024*1024
// 最小值爲536870912(1G內存/2)
 # /sbin/sysctl -a | grep shm
shmmni
 
4096
 
/proc/sys/kernel/shmmni
 # /sbin/sysctl -a | grep shm
file-max
 
6815744
 
/proc/sys/fs/file-max
 # /sbin/sysctl -a | grep file-max
ip_local_port_range
 
9000 65500
 
/proc/sys/net/ipv4/ip_local_port_range
 # /sbin/sysctl -a | grep ip_local_port_range
rmem_default  
262144
 
/proc/sys/net/core/rmem_default
 # /sbin/sysctl -a | grep rmem_default
rmem_max  
4194304
 
/proc/sys/net/core/rmem_max
 # /sbin/sysctl -a | grep rmem_max
wmem_default  
262144
 
/proc/sys/net/core/wmem_default
 
# /sbin/sysctl -a | grep wmem_default
wmem_max   
1048576
 
/proc/sys/net/core/wmem_max
 
# /sbin/sysctl -a | grep wmem_max
aio-max-nr  1048576     
 
# vi /etc/sysctl.conf
按照系統值對比添加:
 
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
 
保存後生效命令:
# /sbin/sysctl -p
 
6. 建立安裝目錄
# mkdir -p /opt/oracle/product/11.2.0.1
# chown -R oracle:oinstall /opt/oracle
# mkdir /var/oracle
# chown oracle:oinstall  /var/oracle
# chmod 755 /var/oracle
 
7. 配置環境變量
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
 
使用Oracle用戶登錄:
su - oracle
vi ~/.bash_profile
如下是配置文件的內容,裏面已有的部分就沒必要在次添加了。
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
# User specific environment and startup programs
umask 022
# +--------------------------+
# | SETUP ORACLE ENVIRONMENT |
# +--------------------------+
TMP=/tmp
TMPDIR=/tmp
export TMP TMPDIR
# 若是安裝出現相關問題請屏蔽下面5行,
# 安裝好後再取消屏蔽這些環境變量設置
export ORACLE_HOME=/opt/oracle/product/11.2.0.1
export ORACLE_BASE=/opt/oracle
export ORACLE_SID=afcsc
export TNS_ADMIN=$ORACLE_HOME/network/admin
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export PATH=$PATH:$ORACLE_HOME/bin
# +--------------------------+
# | LINUX STUFF |
# +--------------------------+
export.ZHS16GBK
unset USERNAME
# +-------------+
# | "GREETINGS" |
# +-------------+
echo ".bash_profile executed"
 
執行:source ~/.bash_profile
 
8. 設置進程數和最大會話數
編輯文件:
# vi /etc/security/limits.conf 加入如下語句:
oracle           soft    nproc           2047
oracle           hard    nproc           16384
oracle           soft    nofile          1024
oracle           hard    nofile          65536
 
9. 關聯設置
編輯文件:vi /etc/pam.d/login 加入如下語句:
session    required     pam_limits.so
(注意:根據最後一條session規則的註釋,應該加在最後一條規則以前)oracle

9. 解壓縮
將linux.x64_11gR2_database_1of2.zip和linux.x64_11gR2_database_2of2.zip移動到移動到/tmp目錄下進行解壓縮。
$ cd /tmp
$ unzip linux.x64_11gR2_database_1of2.zip
$ unzip linux.x64_11gR2_database_2of2.zip
 
10. 安裝
$ cd /tmp/database/
$ ./runInstaller
 
注意:
選擇advance install
數據庫home設置爲/opt/oracle/product/11.2.0.1
數據庫全局名稱設置爲afcsc
字符集選Simplified Chinese ZHS16GBK
 
檢查後會運行圖形化安裝界面。
安裝過程當中鏈接庫時會出現兩個錯誤:
 app

    第一個:ui

/lib64/libstdc++.so中memcpy@GLIBC_2.4找不到。
問題:glibc是2.17的庫,鏈接找的是2.14的庫。
解決辦法:改爲靜態連接。
查看 /usr/lib64/libc.a是否存在。
修改oracle安裝目錄下:$ORACLE_HOME/ctx/lib/ins_ctx.mk
ctxhx: $(CTXHXOBJ)
        $(LINK_CTXHX) $(CTXHXOBJ) $(INSO_LINK)
修改成:
ctxhx: $(CTXHXOBJ)
        -static $(LINK_CTXHX) $(CTXHXOBJ) $(INSO_LINK) /usr/lib64/libc.a
而後點擊retry經過。
 

    第二個:

 Error in invoking target 'agent nmhs' of makefile '/home/oracle_11/app/oracle/product/11.2.0/db_1/sysman/lib/ins_emagent.mk'. 問題:undefinied reference symbol'B_DestroyKeyObject',查看日誌,實際就是沒有找到nnz11這個庫。解決辦法:修改/opt/oracle/product/11.2.0.1/sysman/lib/ins_emagent$(MK_EMAGENT_NMECTL)修改成:$(MK_EMAGENT_NMECTL) -lnnz11而後點擊retry經過。  注:安裝須要遠程圖形化鏈接安裝oracle,具體方式和軟件這裏不說了。

相關文章
相關標籤/搜索