1. 程式人生 > 實用技巧 >Vmare下安裝CentOS7及oracle11.2.0.4 for linux ——安裝前配置

Vmare下安裝CentOS7及oracle11.2.0.4 for linux ——安裝前配置

安裝前準備

1、中文亂碼問題的解決

a、mkdir –p /usr/share/fonts/zh_CN/TrueType

b、上傳字型檔案zysong.ttf至該目錄

c、切換至該目錄,執行:chmod -R 75 zysong.ttf

2、關閉selinux

vim /etc/selinux/config 設定SELINUX=disabled

3、關閉firewalld

systemctl stop firewalld.service

systemctl disable firewalld.service

yum -y install iptables-services
systemctl restart iptables.service
systemctl enable iptables.service

一、建立使用者及安裝目錄,安裝依賴包

1、建立使用者

groupadd oinstall
groupadd dba
useradd -g oinstall -G dba -m oracle
passwd oracle

2、建立安裝目錄,解壓檔案

mkdir -p /ora/oracle
unzip -d /ora/ p13390677_112040_Linux-x86-64_1of7.zip
unzip -d /ora/ p13390677_112040_Linux-x86-64_2of7.zip
chown -R oracle:oinstall /ora
chmod 755 -R /ora

oracle安裝目錄為/ora目錄,安裝檔案解壓到/ora/database目錄下

3、安裝依賴元件

yum -y install binutils compat compat-libstdc gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXi libXtst make sysstat unixODBC unixODBC-devel

二、修改核心

1、將伺服器名寫入到hosts檔案,可以測試ping sername 是否返回127.0.0.1

echo '127.0.0.1 localhost localhost.localdomain' >> /etc/hosts #localhost.localdomain為本機名

ping -c 3 localhost後可以看見響應就證明寫入成功

2、修改核心(/etc/sysctl.conf),增加或修改以下內容:

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
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

修改完成後,執行:sysctl -p

3、修改認證模組vi /etc/security/limits.conf,在末尾增加如下內容

oracle soft nproc 131072
oracle hard nproc 131072
oracle soft nofile 131072
oracle hard nofile 131072
oracle soft core unlimited
oracle hard core unlimited
oracle soft memlock 50000000
oracle hard memlock 50000000

4、修改使用者登入認證

vim /etc/pam.d/login

在末尾增加如下內容(注意,此處是lib64,說明是64位系統)

session required /lib64/security/pam_limits.so
session required pam_limits.so

5、修改環境變數

vim /etc/profile,增加如下內容:

#oracle
export ORACLE_HOME=/ora/oracle/product/11.2.0/db_1
export ORACLE_SID=orcl
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

6、修改Oracle使用者環境變數

vim /home/oracle/.bash_profile,增加如下內容

export ORACLE_BASE=/ora/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=orcl
export ORACLE_TERM=xterm
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK