RedHat6.5 安裝 Oracle11.2
1準備
1.安裝vncserver (參考http://www.cnblogs.com/woyuchengying/p/4727241.html)
2.本地電腦安裝Xmanager ,並啟動Xmanager - Passive(被動服務)
3.進入Root, 設置 export DISPLAY=:0.0 執行xhost + 正常返回:access control disabled,clients can connect from any host;切回oracle用戶,執行:export DISPLAY=192.168.1.2:0.0
2開始
1. linux.x64_11gR2_database_1of2.zip , linux.x64_11gR2_database_2of2.zip 軟件安裝包
2. 安裝Oracle的依賴: 使用下面命令
yum install -y compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers libaio libaio-devel libgcc libstdc++ libstdc++-devel libXp make sysstat unixODBC unixODBC-devel compat-libcap1 compat-libstdc++-33 elfutils-libelf-devel ksh
3.設置主機名
編輯/etc/sysconfig/network中的HOSTNAME
4.編輯/etc/hosts 文件
添加(ip 主機名):
192.168.56.126 oracle11g
3設置內核參數
1:編輯/etc/sysctl.conf
添加:
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
#kernel.shmall = 2097152
#kernel.shmmax = 536870912
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
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=1048586
編輯完之後需要執行命令:/sbin/sysctl -p
2:編輯/etc/security/limits.conf
添加:
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft nofile 4096
oracle hard nofile 65536
oracle soft stack 10240
3:編輯/etc/pam.d/login
添加
session required pam_limits.so
4:編輯/etc/security/limits.d/90-nproc.conf
將
* soft nproc 1024
設置成
* - nproc 16384
5:編輯/etc/selinux/config
將SELINUX設置為permissive:SELINUX=permissive
或者禁用SELINUX
setenforce 0
sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/‘ /etc/selinux/config
getenforce
4.創建oracle用戶
groupadd -g 1000 oinstall
groupadd -g 1100 dba
useradd -m -g oinstall -G dba -u 1200 oracle
[root@oracle11g ~]# id oracle
uid=1200(oracle) gid=1000(oinstall) groups=1000(oinstall),1100(dba)
設置密碼
[root@oracle11g ~]# passwd oracle
5.創建安裝目錄
[root@oracle11g ~]# mkdir -p /u01/app/oracle/product/11.2.0/db_1
[root@oracle11g ~]# chown -R oracle:oinstall /u01 權限賦予
6.關閉防火墻
[root@oracle11g oracle]# chkconfig --level 2345 ip6tables off 設置Linux級別中防火墻關閉
[root@oracle11g oracle]# chkconfig --level 2345 iptables off
[root@oracle11g oracle]# service ip6tables stop 設置當前Linux級別中防火墻關閉
[root@oracle11g oracle]# service iptables stop 查看
[root@oracle11g oracle]# chkconfig --list | grep ip
ip6tables 0:off 1:off 2:off 3:off 4:off 5:off 6:off
iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off
7.安裝oracle 11.2.0.4 軟件
[root@oracle11g oracle]# ll 上傳後查看權限
total 2489640
-rw-r--r--. 1 root root 1395582860 Oct 29 08:31 p13390677_112040_Linux-x86-64_1of7.zip
-rw-r--r--. 1 root root 1151304589 Oct 29 08:31 p13390677_112040_Linux-x86-64_2of7.zip
[root@oracle11g oracle]# chown -R oracle:oinstall /zxx_software/oracle/ 設置權限
[root@oracle11g oracle]# pwd
/zxx_software/oracle
[root@oracle11g oracle]# ll
total 2489640
-rw-r--r--. 1 oracle oinstall 1395582860 Oct 29 08:31 p13390677_112040_Linux-x86-64_1of7.zip
-rw-r--r--. 1 oracle oinstall 1151304589 Oct 29 08:31 p13390677_112040_Linux-x86-64_2of7.zip
[root@oracle11g oracle]# su - oracle 切換到oracle 用戶解壓
[oracle@oracle11g ~]$ cd /zxx_software/oracle/
[oracle@oracle11g oracle]$ unzip p13390677_112040_Linux-x86-64_1of7.zip
[oracle@oracle11g oracle]$ unzip p13390677_112040_Linux-x86-64_2of7.zip
[oracle@oracle11g oracle]$ ll 解壓之後
total 2489644
drwxr-xr-x. 7 oracle oinstall 4096 Aug 27 2013 database
-rw-r--r--. 1 oracle oinstall 1395582860 Oct 29 08:31 p13390677_112040_Linux-x86-64_1of7.zip
-rw-r--r--. 1 oracle oinstall 1151304589 Oct 29 08:31 p13390677_112040_Linux-x86-64_2of7.zip
[oracle@oracle11g database]$ ./runInstaller 安裝
保證客戶端啟動Xmanager - Passive
備註:比如你的oracle服務器ip是192.168.0.1,訪問的客戶端的ip是192.168.1.2,當你用192.168.1.2連接上數據庫後,希望在192.168.1.2上顯示圖像界面,這是就需要export DISPLAY=192.168.1.2:0.0
再執行oracle安裝文件./runInstaller,會提示彈窗授權:
點擊是後,會正常彈窗。
8.可視化安裝 可參考 https://jingyan.baidu.com/article/63f236280db0770208ab3d32.html 安裝
9.編輯oracle環境
[oracle@node1 ~]$ vi .bash_profile
export ORACLE_SID=test
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
[oracle@oracle11g ~]$ source .bash_profile 使環境生效
[oracle@oracle11g ~]$ echo $ORACLE_HOME 測試是否生效
/u01/app/oracle/product/11.2.0/db_1
10.dbca 建庫
參考https://jingyan.baidu.com/article/5d368d1eed4cac3f61c05765.html
11.netca 創建監聽
參考https://jingyan.baidu.com/article/63f236280db0770208ab3d32.html
yum install -y compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers libaio libaio-devel libgcc libstdc++ libstdc++-devel libXp make sysstat unixODBC unixODBC-devel compat-libcap1 compat-libstdc++-33 elfutils-libelf-devel ksh
RedHat6.5 安裝 Oracle11.2