一、安裝前準備工作,下載
Oracle地址:http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
下載如下版本
下載完成後:
linux.x64_11gR2_database_1of2.zip
linux.x64_11gR2_database_2of2.zip
二、配置-增加oracle用戶和相關用戶組
1、切換到root用戶
su - root
2、增加用戶組
groupadd oinstall
groupadd dba
groupadd oper
groupadd asmadmin
3、增useradd -g oinstall -G dba,oper,asmadmin oracle置oracle用戶和密碼
passwd oracle
三、系統配置
1、修改/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
使其生效:/sbin/sysctl -p
2、修改/etc/security/limits.conf文件
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 4096
oracle hard nofile 65536
oracle soft stack 10240
3、修改host
vim /etc/hosts
192.168.101.31 neemotech.com neemotech
4、修改hostname
vim /etc/hostname
修改hostname
neemotech
5、登錄oracle用戶,配置oracle的環境變量
su - oracle
修改當前oracle的.bash_profile配置文件,配置oracle的環境
TMP=/tmp;export TMP
TMPDIR=$TMP;export TMPDIR
ORACLE_HOSTNAME=neemotech.com;export ORACLE_HOSTNAME
ORACLE_UNQNAME=orcl;export ORACLE_UNQNAME
ORACLE_BASE=/home/oracle/app/oracle;export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1;export ORACLE_HOME
ORACLE_SID=orcl;export ORACLE_SID
PATH=/usr/sbin:$PATH;export PATH
PATH=$ORACLE_HOME/bin:$PATH;export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;export CLASSPATH
6,、創建安裝路徑並授權給oracle用戶
mkdir -p /home/oracle/app/oracle/product/11.2.0/db_1
chown -R oracle:oinstall /home/oracle
chmod -R 775 /home/oracle
7、Disable secure linux by editing the “/etc/selinux/config” file, making sure the SELINUX flag is set as follows. It requires REBOOT to be effective !!!
vim /etc/selinux/config
SELINUX=permissive
In Centos Linux 7 /tmp data is stored on tmpfs which consumes memory and is too small. To revert it back to storage just run following command and REBOOT machine to be effective.
systemctl mask tmp.mount
四、添加依賴包
1、使用官網源添加-添加oracle的yum源
cd /etc/yum.repos.d
wget http://public-yum.oracle.com/public-yum-ol6.repo
2、使用yum安裝
接下來,使用 yum install 命令安裝 oracle-rdbms-server-11gR2-preinstall RPM。 期間會顯示了安裝過程如何檢查依賴關係,然後下載和安裝所需軟件包。
yum install oracle-rdbms-server-11gR2-preinstall
五、安裝
設置DISPLAY環境變量執行runInstaller安裝,再次囉嗦一下DISPLAY=IP地址是你連接Linux系統的IP地址後面加上”:0.0”
[oracle@neemotech ~]$ export DISPLAY=192.168.2.77:0.0
[oracle@neemotech ~]$ cd /soft/database/ #進入安裝包的解壓目錄
[oracle@neemotech database]$ ./runInstaller #運行
下面都是界面化安裝,期間會報一些錯誤,參考如下幾個博客就可以:
http://www.oracle.com/technetwork/cn/articles/servers-storage-admin/ginnydbinstallonlinux6-1845247-zhs.html
http://www.jianshu.com/p/2fda26a7edf1
http://popartx.com/2016/05/10/Oracle11Ginstall/
http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html