安裝Oracle用戶端軟體:
root賬戶執行:
#groupadd oinstall
#groupadd dba
#useradd -g oinstall -G dba oracle
#passwd oracle
建立oracle基本目錄:
#mkdir -p /u01/app/oracle
#chown -R oracle:oinstall /u01
#chmod -R 775 /u01
/u01 由根目錄擁有。
/u01/app 由根目錄擁有。
/u01/app/oracle 由具有 775 許可權的 oracle:oinstall 擁有。該所有權和許可權允許 OUI 在 /u01/app/oracle/oraInventory 路徑下建立 oraInventory 目錄。
配置核心參數
RHEL/OEL 5 上的 Oracle 資料庫 10g 第 2 版需要以下所示的核心參數設定。給出的值都是最小值,因此如果您的系統使用一個更大的值,則不要變更:
#vi /etc/sysctl
kernel.shmmax = 4294967295
kernel.shmall = 268435456
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=1048576
net.core.rmem_max=1048576
net.core.wmem_default=262144
net.core.wmem_max=262144
啟動生效
#sysctl -p
為 Oracle 使用者佈建 Shell 限制
要改善 Linux 系統上的軟體效能,Oracle 建議您提高 oracle 使用者的 shell 限制:
Shell 限制 limits.conf 中的條目 硬限制
最大開啟檔案描述符數 nofile 65536
可用於單個使用者的最大進程數 nproc 16384
要進行這些更改,以 root 使用者身份運行以下命令:
#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
session required pam_limits.so
EOF
為“oracle”UNIX 帳戶更新預設的 shell 開機檔案。
對於 Bourne、Bash 或 Korn shell,通過運行以下命令將以下行添加到 /etc/profile 檔案:
#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
#su - oracle
安裝用戶端:
配置oracle環境變數:
$vi ~/.bash_profile
export ORALCE_BASE=/u01/app/oracle
export ORALCE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORALCE_SID=orcl
export PATH=$ORACLE_HOME/bin:$PATH
生效環境變數:
$source ~/.bash_profile