CENTOS6.6上搭建单实例ORACLE12C

时间:2024-08-17 19:34:14

本文来自我的github pages博客http://galengao.github.io/ 即www.gaohuirong.cn

摘要:

  • 自己在centos6.6上搭建的单实例oracle12c
  • 由于搭建过程有些不好写,所以图片偏多
  • *由于截图不规则导致排版有点乱,已经安装过来了,有些截图不能回头截图了,见谅

  • oracle软件与linux 认证版本

CENTOS6.6上搭建单实例ORACLE12CCENTOS6.6上搭建单实例ORACLE12C

  • 检查硬件要求(Check Hardware Requirements) 
    Check CPU
grep "model name" /proc/cpuinfo
cat /proc/cpuinfo | grep "processor" | wc -l
cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l

CENTOS6.6上搭建单实例ORACLE12C

Check Memory

grep MemTotal /proc/meminfo
grep SwapTotal /proc/meminfo
free -g

CENTOS6.6上搭建单实例ORACLE12C

Oracle 12c 对系统内存的最低要求为1G,推荐2G或更大的内存
Oracle对交换分区(Swap Space)的推荐设置如下

CENTOS6.6上搭建单实例ORACLE12C

Check Disk Capacity

df -h

CENTOS6.6上搭建单实例ORACLE12C

Oracle 12c 企业版的需要6.4G大小的磁盘空间,标准版需要6.1G大小的磁盘空间。/tmp 需要至少1G的大小

  • 检查软件要求(Checking the Software Requirements)
    操作系统版本检测

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

uname -m
uname -r
more /etc/redhat-release
uname -a
lsb_release -id

CENTOS6.6上搭建单实例ORACLE12C

依赖包检查

Packages for Oracle Linux 6 and Red Hat Enterprise Linux 6

The following packages (or later versions) must be installed:
binutils-2.20.51.0.-5.11.el6 (x86_64)
compat-libcap1-1.10- (x86_64)
compat-libstdc++--3.2.-.el6 (x86_64)
compat-libstdc++--3.2.-.el6 (i686)
gcc-4.4.-.el6 (x86_64)
gcc-c++-4.4.-.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.-.el6 (i686)
libgcc-4.4.-.el6 (x86_64)
libstdc++-4.4.-.el6 (x86_64)
libstdc++-4.4.-.el6 (i686)
libstdc++-devel-4.4.-.el6 (x86_64)
libstdc++-devel-4.4.-.el6 (i686)
libaio-0.3.-.el6 (x86_64)
libaio-0.3.-.el6 (i686)
libaio-devel-0.3.-.el6 (x86_64)
libaio-devel-0.3.-.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. (x86_64)
libXau-1.0. (i686)
libxcb-1.5 (x86_64)
libxcb-1.5 (i686)
libXi-1.3 (x86_64)
libXi-1.3 (i686)
make-3.81-.el6
sysstat-9.0.-.el6 (x86_64)
检查包
rpm -q binutils compat-libcap1 compat-libstdc++ gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXext libXtst libX11 libXau libXi make sysstat

CENTOS6.6上搭建单实例ORACLE12C

还有7个没安装

yum install compat-libcap1 compat-libstdc++ gcc gcc-c++  ksh libaio-devel libstdc++-devel

如yum没有的就从本地光盘或者下载来安装

  • service iptables stop
chkconfig iptables off
  • vi /etc/selinux/config

修改
SELINUX=disabled

CENTOS6.6上搭建单实例ORACLE12C

  • vi etc/hosts

增加
192.168.1.140 dgp

CENTOS6.6上搭建单实例ORACLE12C

  • vi /etc/security/limits.conf
oracle soft nproc
oracle hard nproc
oracle soft nofile
oracle hard nofile
oracle soft stack
oracle hard stack ###若RAC,需要增加如下
grid soft nproc
grid hard nproc
grid soft nofile
grid hard nofile
grid soft stack
grid hard stack

CENTOS6.6上搭建单实例ORACLE12C

  • vi /etc/sysctl.conf
fs.aio-max-nr =
fs.file-max =
kernel.shmall =
kernel.shmmax =
kernel.shmmni =
kernel.sem =
net.ipv4.ip_local_port_range =
net.core.rmem_default =
net.core.rmem_max =
net.core.wmem_default =
net.core.wmem_max =

CENTOS6.6上搭建单实例ORACLE12C

注:因为kernel.shmall和kernel.shmmax 系统里已经有比它大的值了,所以把这两个参数注释

sysctl -p 生效

CENTOS6.6上搭建单实例ORACLE12C

  • vi /etc/profile
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p
ulimit -n
else
ulimit -u -n
fi
fi

篇幅太长,截取部分

CENTOS6.6上搭建单实例ORACLE12C

  • vi /etc/pam.d/login
session required /lib/security/pam_limits.so
session required pam_limits.so

CENTOS6.6上搭建单实例ORACLE12C

  • 上传oracle12c软件并解压
mkdir /u01

CENTOS6.6上搭建单实例ORACLE12C

  • 创建oracle用户和用户组
groupadd dba
groupadd oinstall
useradd -g oinstall -G dba oracle
passwd oracle
chown -R oracle:oinstall /u01
  • 启动xmanager图形界面安装
    如果没图形界面,需要先安装
yum groupinstall "X Window System"
yum -y groupinstall Desktop
runlevel
vi /etc/inittab
id::initdefault:

先启动Xmanager - Passive
然后启动 Xstart
输入主机地址,协议用SSH,然后弹出输入密码

CENTOS6.6上搭建单实例ORACLE12C

进入securecrt 切换到oracle用户
su - oracle
输入export DISPLAY=192.168.10.20:0.0 ##本地ip

  • 开始安装oracle12c
cd database
./runInstaller

CENTOS6.6上搭建单实例ORACLE12C

  • 不需要支持,弹出提示时点yes

CENTOS6.6上搭建单实例ORACLE12C

  • 先仅安装数据库软件

CENTOS6.6上搭建单实例ORACLE12C

  • 这里安装单实例的

CENTOS6.6上搭建单实例ORACLE12C

  • 选择默认英语

CENTOS6.6上搭建单实例ORACLE12C

  • 默认企业版

CENTOS6.6上搭建单实例ORACLE12C

  • 软件安装路径

CENTOS6.6上搭建单实例ORACLE12C

如果空间不够,新增一块硬盘,然后格式化并挂载上去
fdisk -l
fdisk /dev/sdb

CENTOS6.6上搭建单实例ORACLE12C

CENTOS6.6上搭建单实例ORACLE12C

  • 默认

CENTOS6.6上搭建单实例ORACLE12C

  • 默认

CENTOS6.6上搭建单实例ORACLE12C

  • 安装条件检查,前面准备好一般没什么问题;

CENTOS6.6上搭建单实例ORACLE12C

  • 然后开始安装

CENTOS6.6上搭建单实例ORACLE12CCENTOS6.6上搭建单实例ORACLE12C

  • 配置环境变量

CENTOS6.6上搭建单实例ORACLE12C

source .bash_profile

  • dbca创建实例

CENTOS6.6上搭建单实例ORACLE12C

  • 设置全局库名及密码下一步

CENTOS6.6上搭建单实例ORACLE12C

  • 先决条件检查,这里空间不够先忽略

CENTOS6.6上搭建单实例ORACLE12C

  • 前面设置的预览

CENTOS6.6上搭建单实例ORACLE12C

  • 点结束开始安装

CENTOS6.6上搭建单实例ORACLE12C

  • 检查

至此就安装结束了