Linux 平台安装Oracle Database 12c
1)下载Oracle Database 12cRelease 1安装介质
官方的下载地址:
1:http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
2:https://edelivery.oracle.com/EPD/Download/get_form?egroup_aru_number=16496132
URL地址2需要先注册,然后才能登陆下载,注册登陆界面https://edelivery.oracle.com

关于这两者有啥区别: 听一个同事说,用metalink 账号下载的安装文件完整一些。具体情况是不是如此,还不得而知。
地址1下载的文件为:
linuxamd64_12c_database_1of2.zip
linuxamd64_12c_database_2of2.zip
地址2下载的文件为:
V38500-01_1of2.zip
V38500-01_2of2.zip
2)检查硬件要求(Check Hardware Requirements)
2.1 Check CPU
[root@getoraclelnx01 tmp]#
[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
[root@getoraclelnx01 tmp]#

2.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
[root@getoraclelnx01 tmp]#

Oracle 12c 对系统内存的最低要求为1G,推荐2G或更大的内存,从上面结果可以知道系统内存23G,完全满足要求。
Oracle对交换分区(Swap Space)的推荐设置如下,这里Swap Space为35G,不是16G,需要做一下调整。

2.3 Check Disk Capacity

Oracle 12c 企业版的需要6.4G大小的磁盘空间,标准版需要6.1G大小的磁盘空间。/tmp 需要至少1G的大小。从上面结果得知,磁盘空间完全满足。
3)检查软件要求(Checking the Software Requirements)
3.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)
[root@getoraclelnx01 Server]#
3.2 检查oracle 12c所需包
关于Oracle 12c所需包,从官方文档看,不同版本的操作系统似乎有所不同,Oracle Linux 5 and Red Hat Enterprise Linux 5需要安装下面一些包
|
binutils-2.17.50.0.6 compat-libstdc++-33-3.2.3 compat-libstdc++-33-3.2.3 (32 bit) gcc-4.1.2 gcc-c++-4.1.2 glibc-2.5-58 glibc-2.5-58 (32 bit) glibc-devel-2.5-58 glibc-devel-2.5-58 (32 bit) ksh libaio-0.3.106 libaio-0.3.106 (32 bit) libaio-devel-0.3.106 libaio-devel-0.3.106 (32 bit) libgcc-4.1.2 libgcc-4.1.2 (32 bit) libstdc++-4.1.2 libstdc++-4.1.2 (32 bit) libstdc++-devel 4.1.2 libXext-1.0.1 libXext-1.0.1 (32 bit) libXtst-1.0.1 libXtst-1.0.1 (32 bit) libX11-1.0.3 libX11-1.0.3 (32 bit) libXau-1.0.1 libXau-1.0.1 (32 bit) libXi-1.0.1 libXi-1.0.1 (32 bit) make-3.81 sysstat-7.0.2 |
rpm -q binutils compat-libstdc++ gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXext libXtst libX11 libXau libXi make sysstat

如上所示,还需要安装包 compat-libstdc++和 libaio-devel相关包

[root@getoraclelnx01 Server]# rpm -ivh compat-libstdc++-33-3.2.3-61.i386.rpm
warning: compat-libstdc++-33-3.2.3-61.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package compat-libstdc++-33-3.2.3-61.i386 is already installed
[root@getoraclelnx01 Server]# rpm -ivh compat-libstdc++-33-3.2.3-61.x86_64.rpm
warning: compat-libstdc++-33-3.2.3-61.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package compat-libstdc++-33-3.2.3-61.x86_64 is already installed
[root@getoraclelnx01 Server]# ls *libaio-devel*
libaio-devel-0.3.106-5.i386.rpm libaio-devel-0.3.106-5.x86_64.rpm
[root@getoraclelnx01 Server]# rpm -ivh libaio-devel-0.3.106-5.i386.rpm
warning: libaio-devel-0.3.106-5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:libaio-devel ########################################### [100%]
[root@getoraclelnx01 Server]# rpm -ivh libaio-devel-0.3.106-5.x86_64.rpm
warning: libaio-devel-0.3.106-5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:libaio-devel ########################################### [100%]
[root@getoraclelnx01 Server]#
如上所示,既可以用rpm安装,也可以用yum本地源进行安装,这个就看那个方便以及个人的喜好、习惯了。一般推荐用yum安装,不过需要进行配置。具体可以参见我的博客。
4)系统配置准备
4.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)
[root@getoraclelnx01 Server]#

创建了oracle用户以及相关用户组后,需要设置oracle用户密码。
4.2 创建安装目录
[root@getoraclelnx01 Server]#
[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
[root@getoraclelnx01 Server]#

4.3 Disable SELinux
[root@getoraclelnx01 ~]# /usr/sbin/sestatus
SELinux status: disabled
[root@getoraclelnx01 ~]# /usr/sbin/getenforce
Disabled
[root@getoraclelnx01 ~]#

从上面可以看出SELinux已经被禁用了,如果没有禁用,则可以通过下面命令禁用
getenforce (returns "Enforcing")
setenforce 0
getenforce (returns "Permissive")
End to restore it to enforcing
setenforce 1
getenforce (returns "Enforcing")
|
[root@getoraclelnx01 os]# /usr/sbin/sestatus SELinux status: disabled [root@getoraclelnx01 os]# /usr/sbin/getenforce Disabled [root@getoraclelnx01 os]# Disable secure linux by editing the "/etc/selinux/config" file, making sure the SELINUX flag is set as follows. SELINUX=disabled |
4.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 ~]#

关于内核参数的一些设置建议,可以参考下面资料:
kernel.shmmax 关于内核参数kernel.shmmax,oracle 建议,kernel.shmmax的值不能少于物理内存的一半,而且要大于Oracle中sga-max-size的值,否则会造成oracle性能下降 一般32bit操作系统,直接设置为系统支持的最大内存即可,64bit操作系统设置大于sga-max-size的值即可 如:当前内存为2G 则kernel.shmmax = 2*1024*1024=2097152 当前内存为8G则 kernel.shmmax = 7*1024*1024=7340032 Kernel.shmall Shmall指系统一次可以使用的共享内存段的最大数量,以页为单位。Oracle默认设置为 kernel.shmall = 2097152 即最大8G(2097152*4/1024/1024),(在调整SGA时需要注意,SGA大小设置不可超过该值),根据系统内存大小和使用的不同可以参考如下:设置的一般规律 kernel.shmall = 8G/4k=8388608k/4k=2097152 ---内存8G kernel.shmall = 16G/4k=16777216k/4k=4194304 ---内存16G kernel.shmall = 32G/4k=33554432k/4k=8388608 ---内存32G (RedHat linux系统中页大小为4096即4K,实际环境以getconf PAGE_SIZE结果为准) kernel.shmmni shmmni 指系统共享内存段的最大数量 oracle设置默认值为4096,一般是足够用了,不需要调整 文件句柄数的相关内核参数设置 fs.file-max fs.file-max指系统能够打开最大的文件句柄数 oracle建议设置为65536,一般不用修改 信号的相关内核参数设置 kernel.sem kernel.sem是指 semmsl,semmns,semopm,semmni这4个参数 semmsl 指每个线号集的最大信号数,Oracle建议是设置为oracle的最大进程数+10 semmni 指整个系统的信号集的最大数量 semmns 指整个系统的信号总数,也就是semmni*semmsl的结果 semopm 指每个semop系统调用可以执行的信号操作的最大数量 oracle默认设置 semmsl=250 semmns=3200 semopm=100 semmni=128 即kernel.sem= 250 3200 100 128 例:在oracle ora.init文件参数中设置PROCESSES参数为5000 则semmsl=5010,semmni=128,semmns=semmsl* semmni=641280 另外semopm建议设置等于semmsl值即5010 那么kernel.sem=5010 641280 5010 128 网络相关的内核参数设置 net.core.rmem_default net.core.rmem_default 指网络套接字的默认接收缓冲区的大小,oracle建议设置为265K即262144 net.core.rmem_max net.core.rmem_max 指网络套接字的最大接收缓冲区的大小,oracle10g及以前版本建议设置为256k即262144 oracle11g建议设置为4M 即4194304 net.core.wmem_default net.core.wmem_default指网络套接字的默认发送缓冲区的大小,oracle建议设置为265K即262144 net.core.wmem_max net.core.wmem_max 指网络套接字的最大发送缓冲区的大小,oracle10g及以前版本建议设置为256k即262144 oracle11g建议设置为1M即1048576 net.ipv4.ip_local_port_range net.ipv4.ip_local_port_range ,指本地的允许打开随机端口范围 oracle10g前建议端口范围为1024 65000,oracle11g建议端口范围为: 9000 65500 并忽略oracle安装程序任何关于这个参数的警告 Asynchronous I/O相关的内核参数设置 fs.aio-max-nr fs.aio-max-nr 指系统允许的最大的异步IO请求大小 oracle默认设置为1M即1048576,一般不用更改
修改前最后先备份一下/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 = 262144
net.ipv4.ip_local_port_range =9000 65500
fs.file-max=65536
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 命令使之生效

4.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
4.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
使配置生效
[oracle@getoraclelnx01 ~]$ source .bash_profile
[oracle@getoraclelnx01 ~]$
解压安装镜像文件
[oracle@getoraclelnx01 tmp]$ unzip V38500-01_1of2.zip
[oracle@getoraclelnx01 tmp]$ unzip V38500-01_2of2.zip
安装步骤截图










在这一步时,无法继续,因为oracle账户无法创建oraInventory目录,所以必须先创建该用户并授权
[root@getoraclelnx01 ~]# mkdir -p /u01/app/oraInventory
[root@getoraclelnx01 ~]# chown -R oracle:oinstall /u01/app/oraInventory
[root@getoraclelnx01 ~]# chmod -R 775 /u01/app/oraInventory










验证参数时,fs.file-max设置为65536,但是ORACLE推荐使用68157744,net.core.wmem_max大小为262144,oracle 推荐使用1048576,修改内核参数,运行sysctl -p使之生效。然后重新验证通过
[root@getoraclelnx01 ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 2
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
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
[root@getoraclelnx01 ~]#



运行过程会提示让你用root账户执行2个脚本,你将脚本的文件拿下来,在root账户下执行即可。


[参考资料]:
Database Quick Installation Guide for Linux x86-64 e17718.pdf
http://blog.csdn.net/lnwf5188588/article/details/8779001
Linux 平台安装Oracle Database 12c的更多相关文章
- 转: Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition
http://www.cnblogs.com/xqzt/p/4395053.html Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Ent ...
- Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition
Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) 最近因需要在Oracle 数据库上建立ODI的资料档案库,需要安装Oracle Database ...
- Windows 7 64bit上安装Oracle Database 12c [INS-30131] 错误的解决方法
Windows 7 64bit上安装Oracle Database 12c,出现以下错误: 解决方法: 第一步:控制面板>所有控制面板项>管理工具>服务>SERVER 启动 ...
- Maclean Liu对Oracle Database 12c新特性研究汇总
Maclean Liu关于DB 12c新特性的研究文章如下: [Oracle Database 12c新特性] In-Database Archiving数据库内归档 [Oracle Database ...
- Oracle Database 12c Release 2安装过程实录
前言----------公司数据库用的是oracle,由于oracle数据库没有做监控,所有搭个环境用于测试zabbix通过orabbix插件监控oracle数据库,下面先搭建oracle数据库. 简 ...
- oracle database 12c R1 安装文档
INSTALLORACLE DATABASE 12C 完整的安装文档下载地址: http://download.csdn.net/detail/royjj/5665869 OS:ORALCE LINU ...
- Oracle Database 12c Release 2安装详解
第1章 Oracle Database 12c Release 2安装详解 1.1 下载方法 oracle官网https://www.oracle.com 1)打开官方网站,找到下载连接 2)选择更多 ...
- (转)oracle linux 7 安装oracle 12c
原文:https://blog.csdn.net/jiuyun1986/article/details/53589446 https://blog.csdn.net/admin_root1/artic ...
- Oracle Database 12c Release 1下载安装(自身经历)
1.访问Oracle官网:https://www.oracle.com/index.html,下载Oracle Database 12c Release 1 (注意:File1和File2都要下载!! ...
随机推荐
- jar包依赖性查询
项目中碰到jar包冲突,需要排除一些jar包时先要了解jar的依赖关系,maven提供了命令行来查询: mvn dependency:tree 返回依赖的属性结构
- 利用免费的Spire.XLS控件制作Excel报表
我们小组上个季度接手了一个项目其中需要实现创建excel文档的功能,寻找实现这个功能的控件的任务分配给了我,通过百度搜索我找到了一个免费的控件,它是由E-iceblue公司推出的spire.xls控件 ...
- 关于纠正 C/C++ 之前在函输内改变 变量的一个错误想法。
再这之前,我曾认为,一个变量只要定义为全局变量后,即使把它以传参的方式传进去一个函数内,也能改变它的值 事实证明,这一想法是错的. 下面我用代码说明,具体注释将写在里面 #include<std ...
- 关于BFC不会被浮动元素遮盖的一些解释
简介 在清除浮动一文中提到BFC不会被浮动元素遮盖,并没有详细探究表现行为.规范中指出,在同一个BFC内,作为子元素的BFC的border-box不应该覆盖同为子元素的浮动元素的margin-box. ...
- Oracle Database Server 'TNS Listener'远程数据投毒漏洞(CVE-2012-1675)解决
环境:Windows 2008 R2 + Oracle 10.2.0.3 应用最新bundle patch后,扫描依然报出漏洞 Oracle Database Server 'TNS Listener ...
- HTML5 Canvas 画布
一.Canvas是什么? canvas,是一个画布,canvas元素用于在网页上绘制图形. canvas 拥有多种绘制路径.矩形.圆形.字符以及添加图像的方法. 二.创建Canvas元素 加上基本的属 ...
- NET开发学习项目资源
最近在整理资料时发现自己当初学习NET的一些项目资源,一直放在硬盘里不如拿来分享给初学者学习还是不错的. 项目代码为<精通ASP.NET20+SQL Server2005项目开发>书中源码 ...
- 分享我基于NPOI+ExcelReport实现的导入与导出EXCEL类库:ExcelUtility (续篇)
上周六我发表的文章<分享我基于NPOI+ExcelReport实现的导入与导出EXCEL类库:ExcelUtility>受到了大家的热烈支持与推荐,再此表示感谢,该ExcelUtility ...
- null和undefined的一些区别
读了阮一峰的博客,自己总结一下,便记录一篇博客 在javacript的基本类型中,有2种基本类型,只有1个值,便是null和undefined,都表示的是"无".在一定程度上是相等 ...
- C++面试题汇集
1.在C++ 程序中调用被C 编译器编译后的函数,为什么要加extern “C”?答:首先,extern是C/C++语言中表明函数和全局变量作用范围的关键字,该关键字告诉编译器,其声明的函数和变量可以 ...