CentOS 7.0 安裝Oracle11g R2

來源:互聯網
上載者:User

標籤:

// 注釋 # root使用者 $oracle使用者1. 關閉安全措施  # chkconfig iptables off // 永久關閉防火牆# serviceiptables 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 作業系統
  • 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 11
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個包
  • 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 安裝包名 // 安裝程式包 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 LANG=AMERICAN_AMERICA.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規則的注釋,應該加在最後一條規則之前)

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 檢查後會運行圖形化安裝介面。安裝過程中串連庫時可能會出現兩個錯誤: 
  • 第一個:
/lib64/libstdc++.so中[email protected]_2.4找不到。問題:glibc是2.17的庫,串連找的是2.14的庫。解決辦法:改成靜態連結。查看 /usr/lib64/libc.a是否存在。修改oracle安裝目錄下:$ORACLE_HOME/ctx/lib/ins_ctx.mkctxhx: $(CTXHXOBJ)
        $(LINK_CTXHX) $(CTXHXOBJ) $(INSO_LINK)修改為:ctxhx: $(CTXHXOBJ)
        -static $(LINK_CTXHX) $(CTXHXOBJ) $(INSO_LINK) /usr/lib64/libc.a然後點擊retry通過。 
  • 第二個:
問題: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通過。

CentOS 7.0 安裝Oracle11g R2

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.