centos6.5 安装oracle12c

1、检查硬件要求(Check Hardware Requirements)
1.1 Check CPU
[root@getoraclelnx01 tmp]# grep "model name" /proc/cpuinfo
model name      : Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
model name      : Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
model name      : Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
model name      : Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
model name      : Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
model name      : Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
model name      : Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
model name      : Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
[root@getoraclelnx01 tmp]# cat /proc/cpuinfo | grep "processor" | wc -l
8
[root@getoraclelnx01 tmp]#  cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l
4
1.2 Check Memory
[root@getoraclelnx01 tmp]# grep MemTotal /proc/meminfo
MemTotal:       24736752 kB
[root@getoraclelnx01 tmp]# grep SwapTotal /proc/meminfo
SwapTotal:      37748728 kB
[root@getoraclelnx01 tmp]# free -g
total           used        free     shared    buffers     cached
Mem:         23              7             16            0              0               5
-/+ buffers/cache:      1             22
Swap:        35             0             35
Oracle 12c 对系统内存的最低要求为1G,推荐2G或更大的内存,从上面结果可以知道系统内存23G,完全满足要求。
Oracle对交换分区(Swap Space)的推荐设置如下,这里Swap Space为35G,不是16G,需要做一下调整。

1.3 Check Disk Capacity
Oracle 12c 企业版的需要6.4G大小的磁盘空间,标准版需要6.1G大小的磁盘空间。/tmp 需要至少1G的大小。从上面结果得知,磁盘空间完全满足。
2、检查软件要求(Checking the Software Requirements)
2.1 操作系统版本检测
Oracle 12 c 只支持64位的Linux系统。不支持32Linux平台,这也许是以后的趋势了。Operating System Requirements for x86-64 Linux Platforms。 Oracle 的官方文档明确列出了支持下面三个Linux版本
? Supported Oracle Linux 6 and Red Hat Enterprise Linux 6 Distributions for x86-64
? Supported Oracle Linux 5 and Red Hat Enterprise Linux 5 Distributions for x86-64
? Supported SUSE Distributions for x86-64
[root@getoraclelnx01 /]# uname -m
x86_64
[root@getoraclelnx01 /]# uname -r
2.6.32-200.13.1.el5uek
[root@getoraclelnx01 /]# more /etc/redhat-release
Red Hat Enterprise Linux Server release 5.7 (Tikanga)
[root@getoraclelnx01 ~]# uname -a
Linux getoraclelnx01.gfg1.esquel.com 2.6.32-200.13.1.el5uek #1 SMP Wed Jul 27 21:02:33 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
[root@getoraclelnx01 Server]# lsb_release -id
Distributor ID: EnterpriseEnterpriseServer
Description: Enterprise Linux Enterprise Linux Server release 5.7 (Carthage)
2.2 检查oracle 12c所需包
关于Oracle 12c所需包,从官方文档看,不同版本的操作系统似乎有所不同,centos6与Oracle Linux 6需要安装下面一些包
binutils-2.20.51.0.2-5.11.el6 (x86_64)
compat-libcap1-1.10-1 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (i686)
gcc-4.4.4-13.el6 (x86_64)
gcc-c++-4.4.4-13.el6 (x86_64)
glibc-2.12-1.7.el6 (i686)
glibc-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (i686)
ksh
libgcc-4.4.4-13.el6 (i686)
libgcc-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6 (i686)
libstdc++-devel-4.4.4-13.el6 (x86_64)
libstdc++-devel-4.4.4-13.el6 (i686)
libaio-0.3.107-10.el6 (x86_64)
libaio-0.3.107-10.el6 (i686)
libaio-devel-0.3.107-10.el6 (x86_64)
libaio-devel-0.3.107-10.el6 (i686)
libXext-1.1 (x86_64)
libXext-1.1 (i686)
libXtst-1.0.99.2 (x86_64)
libXtst-1.0.99.2 (i686)
libX11-1.3 (x86_64)
libX11-1.3 (i686)
libXau-1.0.5 (x86_64)
libXau-1.0.5 (i686)
libxcb-1.5 (x86_64)
libxcb-1.5 (i686)
libXi-1.3 (x86_64)
libXi-1.3 (i686)
make-3.81-19.el6
sysstat-9.0.4-11.el6 (x86_64)
rpm -q binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel ksh libgcc libstdc++ libstdc++-devel libaio  libaio-devel libXext libXtst libX11 libXau libxcb libXi make sysstat
3、系统配置准备
3.1 创建Oracle用户和用户组
[root@getoraclelnx01 Server]# groupadd dba
[root@getoraclelnx01 Server]# groupadd oinstall
[root@getoraclelnx01 Server]# useradd -g oinstall -G dba oracle
[root@getoraclelnx01 Server]# id oracle
uid=502(oracle) gid=503(oinstall) groups=503(oinstall),502(dba)
创建了oracle用户以及相关用户组后,需要设置oracle用户密码。
3.2 创建安装目录
[root@getoraclelnx01 Server]# mkdir -p /u01/app/oracle
[root@getoraclelnx01 Server]# chown -R oracle:oinstall /u01/app/oracle
[root@getoraclelnx01 Server]# chmod -R 775 /u01/app/oracle
3.3 Disable SELinux
[root@getoraclelnx01 ~]# /usr/sbin/sestatus
SELinux status: disabled
[root@getoraclelnx01 ~]# /usr/sbin/getenforce
Disabled
从上面可以看出SELinux已经被禁用了,如果没有禁用,则可以通过修改"/etc/selinux/config" 文件, making sure the SELINUX flag is set as follows.
SELINUX=disabled
3.4 修改系统内核参数
在修改系统内核参数前,你可以用命令先查看一下当前各类系统参数的值,亦或直接查看配置文件/etc/sysctl.conf
[root@getoraclelnx01 ~]# getconf PAGESIZE
4096
[root@getoraclelnx01 ~]# sysctl -a | grep sem
kernel.sem = 250 32000 32 128
[root@getoraclelnx01 ~]# sysctl -a | grep shm
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
kernel.shmmni = 4096
vm.hugetlb_shm_group = 0
[root@getoraclelnx01 ~]# sysctl -a | grep file-max
fs.file-max = 2414060
[root@getoraclelnx01 ~]# sysctl -a | grep ip_local_port_range
net.ipv4.ip_local_port_range = 32768 61000
[root@getoraclelnx01 ~]#
修改前最后先备份一下/etc/sysctl.conf,以防万一。
[root@getoraclelnx01 ~]# cp /etc/sysctl.conf /etc/sysctl.conf.bak
[root@getoraclelnx01 ~]# vi /etc/sysctl.conf 添加或修改下面参数
kernel.shmmax = 68719476736
kernel.shmall = 6029312
kernel.shmmni = 4096
kernel.sem =250 32000 100 128
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.ip_local_port_range =9000 65500
fs.file-max=6815744
fs.aio-max-nr=1048576
kernel.shmall =physical RAM size / pagesize (getconf PAGESIZE) -- If the defaults are greater then leave it.
kernel.shmall = 内存大小/4k=23G*1024*1024/4k = 6029312
kernel.shmmax = 20*1024*1024=20971520 而默认的为68719476736,那么使用默认值
修改完成后保存,然后运行sysctl -p 命令使之生效
3.5 设置用户限制
在/etc/security/limits.conf中添加如下配置。
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 10240
Add the following line to the "/etc/pam.d/login" file,
if it does not already exist.
session required /lib/security/pam_limits.so
session required pam_limits.so
Add the following to
/etc/profile if Oracle user will use the bash shell.
if [ $USER = "oracle" ]; then
ulimit -u 16384
ulimit -n 65536
fi
3.6 配置环境变量
首先切换到oracle账户 ,编辑修改主目录下 .bash_profile
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1; export ORACLE_HOME
ORACLE_SID=epps; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
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/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
注意sid的修改
使配置生效
[oracle@getoraclelnx01 ~]$ source .bash_profile
4、安装vnc图像界面
4.1、安装 VNC
默认情况下,CentOS 6.4 是没有安装的。
检查是否安装,输入:
[root@localhost ~]# rpm -q vnc vnc-server
得到:
package vnc is not installed
提示没有安装,那么就开始安装,输入:
[root@localhost ~]# yum install vnc vnc-server
4.2、设置 VNC 密码
安装完成后 需初启动VNC 否则执行第一步 Centos 依然会报未安装VNC
[root@localhost ~]$ vncserver
设置 VNC密码,输入:(在某用户下输入则登陆用户就是它,如果su imiss切换到imiss用户,输入vncserver则启动的是另一个桌面,同样要设置密码,以后在该账户下启动的vncserver登陆就需要在此用户下设置的密码了。)
此时会提示你输入密码,因为是第一次配置。重复输入两次即可。
[root@localhost ~]$ vncpasswd
Password:
Verify:
4.3、配置桌面类型
[root@localhost ~]$vi  ~/.vnc/xstartup
一般情况下,我们使用的 Linux 桌面都是 "Gnome" 桌面,故配置成这个桌面比较习惯。
按 "i" 键进入编辑状态,主要修改最后两行。改为:
# xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
# twm &
gnome-session &
重点编辑最后两行,将这两行注释去掉,得到:
4.4、配置登录帐号、桌面分辨率、连接方式
输入:
[root@localhost ~]# vi /etc/sysconfig/vncservers
修改最后两行
VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1024x768"
4.5、配置防火墙,允许 VNC 连接
VNC server 监听的端口从 5900 开始,display:1 的监听 5901,display:2 监听 5902,以此类推。CentOS 的防火墙缺省是不允许连接这些端口的,所以需要使用下面的步骤打开防火墙(需要 root 权限):
输入编辑:
[root@localhost ~]# vi /etc/sysconfig/iptables
上面我们只添加了一个 root 帐号和桌面 1,所以这里按照上面的规则,添加一个 "5901" 端口号即可。
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT
4.6、重启防火墙
service iptables restart
如果重启防火墙后从客户端连接超时,执行iptables -F。
4.7、设置 VNC 自动启动
[root@localhost ~]# chkconfig vncserver on
4.8、关闭
vncserver -kill :1(注意kill后面要有一个空格)
安装成功
4.9、客户端安装
下载 安装vnc viewer
安装成功后登入
密码不是登陆账号的密码  而是 vnc设置的密码;
5、通过图形界面安装oracle12c
安装过程中遇到的问题:
(1)[INS-32031]Invalid inventory location
oracle安装过程中找不到inventory路径,手动创建,并对oracle用户授权chown -R oracle:oinstall /inventory
(2) INS-10013
查看详细日志,原因为无法通过root用户执行/u01/app/oraInventory/orainstRoot.sh文件,手动执行。
6、设置开机自启动
设置开机自启动省去手动启动服务和库的操作,此过程需要两个步骤:
6.1、修改/etc/oratab文件
查看文件最后几行,格式为oracle_sid:oracle_home:N/Y
该文件是特意为oracle数据库生成的,用来控制是否可以用dbstart命令来启动数据库,当为N时,不可以,sqlplus连接后,显示连接到空闲实例;当为Y时,可以用dbstart命令启动。
由此,只需要修改最后的yes或者no。
注意:若服务器上有多个实例,通过sid确定需要修改的实例。
zjk:/u01/app/oracle/product/11.2.0/dbhome_1:Y
6.2、修改/etc/rc.d/rc.local文件
该文件是控制开机自启动的脚本,增加如下语句。
su oracle -lc /u01/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start     #启动服务
su oracle -lc /u01/app/oracle/product/11.2.0/dbhome_1/bin/dbstart     #启动实例
至此,centos安装oracle12c完成。








来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30957159/viewspace-2141513/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/30957159/viewspace-2141513/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值