RHEL4 + Oracle 10g安裝前設置

1.校驗系統內存和交換分區

內存至少900+MB , 交換分區至少1G; 使用如下命令校驗:

grep MemTotal /proc/meminfo
grep SwapTotal /proc/meminfo

2.校驗必要軟件包

內核版本: uname -r  #2.4.9-e.25(或更高版本)

其他所需程序包的版本(或更高版本):

gcc-2.96-124
make-3.79
binutils-2.11
openmotif-2.1.30-11
glibc-2.2.4-31

使用命令校驗:rpm -q gcc make binutils openmotif glibc

如果缺少某個包,可以在安裝盤中找到相應的rpm包,用命令rpm -Uvh <NAME>安裝

3. 用戶準備

/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -m -g oinstall -G dba oracle

passwd oracle

4. 準備文件目錄

mkdir -p /u01/app/oracle
mkdir -p /u02/oradata
chown -R oracle:oinstall /u01/app/oracle /u02/oradata
chmod -R 775 /u01/app/oracle /u02/oradata

5.內核修改

cat >> /etc/sysctl.conf <<EOF
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
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
EOF
/sbin/sysctl -p

6.設置shell權限

cat >> /etc/security/limits.conf <<EOF
oracle               soft    nproc   2047
oracle               hard    nproc   16384
oracle               soft    nofile  1024
oracle               hard    nofile  65536
EOF

cat >> /etc/pam.d/login <<EOF
session    required     /lib/security/pam_limits.so
EOF

cat >> /etc/profile <<EOF
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
EOF

cat >> /etc/csh.login <<EOF
if ( /$USER == "oracle" ) then
limit maxproc 16384
limit descriptors 65536
umask 022
endif
EOF

7. 設置oracle環境變量

包括:
ORACLE_BASE
ORACLE_HOME
ORACLE_SID
PATH
執行以下命令:

su - oracle
cat >> .bash_profile <<EOF
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1 
export ORACLE_SID=orcl
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
EOF

發佈了32 篇原創文章 · 獲贊 5 · 訪問量 16萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章