1)建立用戶和組linux
[root@beijing ~]#groupadd oinstall
[root@beijing ~]#groupadd dba
[root@beijing ~]#useradd oracle -g oinstall -G dba
[root@beijing ~]#passwd oracle
Changing password for user oracle.
New UNIX password:oracle
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:oracle
passwd: all authentication tokens updated successfully.
複製代碼
2)建立oracle安裝目錄sql
[root@beijing ~]#mkdir -p /u01/oracle
[root@beijing ~]#chown -R oracle:oinstall /u01
[root@beijing ~]#chmod -R 775 /u01/oracle
複製代碼
1)根據Oracle11gR2文檔,設置核心參數值數據庫
/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
複製代碼
# sysctl -p 複製代碼
2)設置Shell Limits(系統資源限制),提升軟件的運行效率bash
/etc/security/limits.conf
文件中加入下列行:
oracle soft nofile 65536
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
複製代碼
3)在/etc/pam.d/login
文件中加入下列行,若是裏面沒有的話:session
session required /lib/security/pam_limits.so
session required pam_limits.so
複製代碼
4) 在/etc/profile
後加入如下語句:oracle
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
複製代碼
5)在/home/oracle/.bash_profile
中刪掉原來的最下面三行,而後加添下面的oracle環境變量工具
# add for oracle11g
ORACLE_BASE=/u01
ORACLE_HOME=$ORACLE_BASE/oracle
ORACLE_SID=prod
PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
NLS_LANG="simplified chinese"_china.AL32UTF8
export NLS_LANG
export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
export NLS_TIMESTAMP_FORMAT='yyyy-mm-dd HH24:MI:SSXFF'
export NLS_TIMESTAMP_TZ_FORMAT='yyyy-mm-dd HH24:MI:SSXFF TZR'
複製代碼
1)檢查的方法是rpm -qa
包名,若是沒有證實缺這個包,要補上:ui
libaio-devel
和
sysstat
包,但安裝可能遇到依賴關係,爲此使用yum方法安裝包。根據文檔提示,使用yum安裝缺失軟件包
[root@beijing yum.repos.d]#yum install libaio-devel* -y
[root@beijing yum.repos.d]#yum install sysstat* -y
[root@beijing yum.repos.d]#yum install unixODBC-2* -y
[root@beijing yum.repos.d]#yum install unixODBC-devel* -y
[root@beijing yum.repos.d]#umount /media(採用虛擬光驅掛載)複製代碼
2)上傳oracle數據庫安裝介質spa
[root@beijing ~]# mkdir /soft
[root@beijing ~]#cd /soft
[root@beijing soft]#ll
總計 2229604
drwxr-xr-x 2 root root 4096 11-25 09:01 .
drwxr-xr-x 25 root root 4096 11-25 08:58 ..
-rw-r--r-- 1 root root 1285396902 11-25 09:01 linux_11gR2_database_1of2.zip
-rw-r--r-- 1 root root 995359177 11-25 09:01 linux_11gR2_database_2of2.zip
-rw-r--r-- 1 root root 95310 11-25 09:01 rlwrap-0.41-1.el5.i386.rpm
[root@beijing soft]#unzip linux_11gR2_database_1of2.zip
[root@beijing soft]#unzip linux_11gR2_database_2of2.zip
[root@beijing soft]#rpm -ivh rlwrap-0.41-1.el5.i386.rpm
複製代碼
準備工做完成unix