目录

  • 目录
  • 软件环境
  • 前言
  • 初始化RHEL61
  • 硬件检测
  • 预安装软件包
  • 安装oratoolkit
  • 创建Oracle用户
  • 修改配置文件
  • 系统版本伪装
  • 解压并运行Oracle10gr2安装包
  • 安装rlwrap实用工具
  • 最后

软件环境

  • 操作系统

    • RHEL6.1
    • 内存 2G
    • Swap 4G
    • /tmp 2G
    • LANG=en_US.UTF-8
  • 软件
    • Oracle10gR2
    • OraToolkit

前言

Oracle的学习从安装开始,尤其是在Linux上的安装会相对复杂一些。连写了3篇Oracle的安装博客,也是没谁了。 :(

初始化RHEL6.1

Step1:修改Hostname

[root@jmilkfan Desktop]# hostname
jmilk.fan.com

Step2:关闭Selinux
vim /etc/sysconfig/selinux

SELINUX=disabbled

Step3:修改网络配置
vim /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"
HWADDR="00:0C:29:8A:11:38"
NM_CONTROLLED="yes"
ONBOOT="yes"
IPADDR=10.100.100.130
NETMASK=255.0.0.0

Step4:修改Hosts文件
当然可以使用DNS Server,主要在Oracle Client使用Oracle监听程序连接到Oracle Server的时候可以进行IP、域名解析,不需要修改tnsnames.ora配置文件。
Vim /etc/hosts

10.100.100.130  jmilk.fan.com  jmilk

Step5:关闭防火墙

service iptables stop
chkconfig iptables off

Step6:重启系统

硬件检测

[root@jmilk Desktop]# grep MemTotal /proc/meminfo
#官方要求内存大于512M
[root@jmilk Desktop]# grep SwapTotal /proc/meminfo
#官方给出了内存和Swap分区大小的配比,这里建议Swap给到内存的2倍
[root@jmilk Desktop]# df -m /tmp
#在安装Oracle过程中Tmp必须有400M的空余空间

预安装软件包

Step1:配置YUM源,RHEL6.1安装光盘就能够满足

Step2:确定内核版本

[root@jmilk Desktop]# uname -a
Linux jmilk.fan.com 2.6.32-131.0.15.el6.x86_64 #1 SMP Tue May 10 15:42:40 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux

Step3:检测软件包是否安装完整
这些软件包能够支撑,Oracle安装程序在安装的过程中对某些模块进行重新编译,然后再安装。我们可以Oracle官方文档在或者oraToolKit中找到。

 rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils glibc glibc-common libaio libgcc libstdc++ make ksh libgomp sysstat kernel-headers libstdc++-devel elfutils-libelf-devel mpfr libXmu libXt libXxf86misc glibc-headers libXxf86vm glibc-headers libXxf86vm xorg-x11-xauth cpp libtool-ltdl unixODBC cloog-ppl ppl libmcpp mcpp xorg-x11-server-utils compat-db42 compat-db43 libdmx libXv libXxf86dga libIDL ORBit2 GConf2 libbonobo gtk2-engines shared-mime-info libdaemon avahi avahi-glib gnome-vfs2 xorg-x11-utils compat-libstdc++-33 celt051 libXp ConsoleKit-x11 xorg-x11-xinit glibc-devel gcc compat-gcc-34 ncurses-devel gcc-c++ libgnome readline-devel compat-db libaio-devel compat-gcc-34-c++   
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' libgcc nss-softokn-freebl glibc libaio libstdc++ ncurses-libs readline libICE libtool-ltdl libSM libuuid unixODBC libXau libX11 libxcb libXext libXi compat-libstdc++-33 libXt libXtst libaio-devel unixODBC-devel glibc-devel

需要将没安装的rpm包都安装上之后,才能成功安装Oracle,当然我们也可以直接yum安装。

32位包:

rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' libgcc nss-softokn-freebl glibc libaio libstdc++ ncurses-libs readline libICE libtool-ltdl libSM libuuid unixODBC libXau libX11 libxcb libXext libXi compat-libstdc++-33 libXt libXtst libaio-devel unixODBC-devel glibc-devel

64位包:

yum install -y celt051 libXp compat-gcc-34 libaio-devel unixODBC-devel compat-gcc-34-c++ libaio-0.3.107-10.el6.i686 ncurses-libs-5.7-3.20090208.el6.i686 readline-6.0-3.el6.i686 libICE-1.0.6-1.el6.i686 libtool-ltdl-2.2.6-15.5.el6.i686 libSM-1.1.0-7.1.el6.i686 libuuid unixODBC-2.2.14-11.el6.i686 libXau-1.0.5-1.el6.i686 libX11-1.3-2.el6.i686 libxcb-1.5-1.el6.i686 libXext-1.1-3.el6.i686 libXi-1.3-3.el6.i686 compat-libstdc++-33-3.2.3-69.el6.i686 libXt-1.0.7-1.el6.i686 libXtst-1.0.99.2-3.el6.i686 libaio-devel-0.3.107-10.el6.i686 unixODBC-devel-2.2.14-11.el6.i686 glibc-devel-2.12-1.25.el6.i686 ksh-20100621-6.el6.x86_64 

进入到光盘挂载目录下的Package目录下,强制安装一个rpm包。这是一个BUG,明明没安装却告诉你安装了。

rpm -ivh libXp-1.0.0-15.1.el6.i686.rpm --force
rpm -ivh libXp-1.0.0-15.1.el6.x86_64.rpm --force

安装oratoolkit

OraToolKit是一个辅助安装Oracle的工具,我们能通过它来检测我们的系统环境是否满足安装Oracle的需求。

[root@jmilk tmp]# rpm -ivh oratoolkit-1.0.2.1.5-1.noarch.rpm
Preparing...                ########################################### [100%]
usermod: user oracle is currently logged in1:oratoolkit             ########################################### [100%]
usermod: user oracle is currently logged in

验证系统环境是否满足安装Oracle

[root@jmilk otk]# pwd
/opt/oracle/otk/current/tools/
[root@jmilk tools]# /opt/oracle/otk/current/bin/installManager swReqCheck osSetup10gR2.cfg

如果最终检测结果出现了ERROR表示不满足安装条件,需要进一步的进行配置,一般是安装缺少的软件包。如果出现了Warning或Successfully表示可以安装Oracle。

创建Oracle用户

在手动创建Oracle用户之前,其实我们在安装oraToolkit的时候就已经自动的创建了一个oracle用户和oinstall、dba这两个组,家目录默认为/opt/oracle/otk/home。如果不希望使用默认用户的话,可以手动的删除他。

groupdel oinstall
groupdel dba
userdel oraclegroupadd oinstall                                     #只有oinstall组内的用户才能够执行安装程序
groupadd dba                                          #只有dba组内的用户才能够创建数据库
mkdir -p /u01/oracle
useradd -g oinstall -G dba -d /u01/oracle oracle
(echo fanguiju;echo fanguiju) | passwd --stdin oracle
chown -R oracle:oinstall /u01
more /etc/passwd|grep oracle
su - oracle

现在创建的oracle用户并没有.bash_profile.bashrc个性化的环境配置文件,需要手动创建。
vi .bash_profile

    # .bash_profile# Get the aliases and functionsif [ -f ~/.bashrc ]; then. ~/.bashrcfi# User specific environment and startup programsPATH=$PATH:$HOME/binexport PATHunset USERNAME#下面这些环境变量配置,会在运行Oracle安装程序的时候被加载ORACLE_BASE=/u01ORACLE_HOME=$ORACLE_BASE/oracleORACLE_SID=demoPATH=$ORACLE_HOME/bin:$PATHexport ORACLE_BASE ORACLE_HOME ORACLE_SID PATHalias sqlplus="rlwrap sqlplus"alias rman="rlwrap rman"alias lsnrctl="rlwrap lsnrctl"export EDITOR=vistty erase ^h

vi .bashrc

    # .bashrc# User specific aliases and functionsalias rm='rm -i'alias cp='cp -i'alias mv='mv -i'# Source global definitionsif [ -f /etc/bashrc ]; then. /etc/bashrcfi

加载环境变量

source ./.bash_profile
source ./.bashrc

修改配置文件

Step1:修改sysctl.conf配置文件
为了限定Oracle Instance所占用的内存。

    # Kernel sysctl configuration file for Red Hat Linux## For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and# sysctl.conf(5) for more details.# Controls IP packet forwardingnet.ipv4.ip_forward = 0# Controls source route verificationnet.ipv4.conf.default.rp_filter = 1# Do not accept source routingnet.ipv4.conf.default.accept_source_route = 0# Controls the System Request debugging functionality of the kernelkernel.sysrq = 0# Controls whether core dumps will append the PID to the core filename.# Useful for debugging multi-threaded applications.kernel.core_uses_pid = 1# Controls the use of TCP syncookiesnet.ipv4.tcp_syncookies = 1# Disable netfilter on bridges.# net.bridge.bridge-nf-call-ip6tables = 0  在这行前加## net.bridge.bridge-nf-call-iptables = 0    在这行前加## net.bridge.bridge-nf-call-arptables = 0 在这行前加## Controls the maximum size of a message, in byteskernel.msgmnb = 65536# Controls the default maxmimum size of a message queuekernel.msgmax = 65536# Controls the maximum shared segment size, in byteskernel.shmmax = 68719476736# Controls the maximum number of shared memory segments, in pageskernel.shmall = 4294967296 删除这行并添加以下内容:kernel.shmall = 2097152kernel.shmmax = 2147483648kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 1024 65000net.core.rmem_default = 1048576net.core.rmem_max = 1048576net.core.wmem_default = 262144net.core.wmem_max = 262144#shmall 是全部允许使用的共享内存大小#shmmax 是单个segment段允许使用的大小#shmmni= 整个系统的内存segment的总个数 #sem =内核信号量#修改这个配置文件的意义在于,限定Oracle数据库使用的共享内存池

重新加载配置文件

sysctl -p

Step2: 修改limits.conf配置文件
为了限定oracle用户能够启用的进程数量和能够打开的文件数量。
vim /etc/security/limits.conf

    # /etc/security/limits.conf##Each line describes a limit for a user in the form:##<domain> <type> <item> <value>##Where:#<domain> can be:# - an user name# - a group name, with @group syntax# - the wildcard *, for default entry# - the wildcard %, can be also used with %group syntax,# for maxlogin limit##<type> can have the two values:# - "soft" for enforcing the soft limits# - "hard" for enforcing hard limits##<item> can be one of the following:# - core - limits the core file size (KB)# - data - max data size (KB)# - fsize - maximum filesize (KB)# - memlock - max locked-in-memory address space (KB)# - nofile - max number of open files# - rss - max resident set size (KB)# - stack - max stack size (KB)# - cpu - max CPU time (MIN)# - nproc - max number of processes# - as - address space limit (KB)# - maxlogins - max number of logins for this user# - maxsyslogins - max number of logins on the system# - priority - the priority to run user process with# - locks - max number of file locks the user can hold# - sigpending - max number of pending signals# - msgqueue - max memory used by POSIX message queues (bytes)# - nice - max nice priority allowed to raise to values: [-20, 19]# - rtprio - max realtime priority##<domain> <type> <item> <value>##* soft core 0#* hard rss 10000#@student hard nproc 20#@faculty soft nproc 20#@faculty hard nproc 50#ftp hard nproc 0#@student - maxlogins 4# End of file 加入以下内容:oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536#linux limits.conf  配置文件实际是 Linux PAM(插入式认证模块,Pluggable Authentication Modules)中 pam_limits.so 的配置文件#这个配置文件限制oracle用户启动的最大进程数和能够打开的最大文件数

Step3:修改login配置文件
为了让oracle登陆的同时使limits.conf配置文件生效。
vi /etc/pam.d/login

    #%PAM-1.0auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.soauth include system-authaccount required pam_nologin.soaccount include system-authpassword include system-auth# pam_selinux.so close should be the first session rulesession required pam_selinux.so closesession required pam_loginuid.sosession optional pam_console.so# pam_selinux.so open should only be followed by sessions to be executed in the user contextsession required pam_selinux.so opensession required pam_namespace.sosession optional pam_keyinit.so force revokesession include system-auth-session optional pam_ck_connector.so 加入以下内容:session    required     /lib/security/pam_limits.sosession    required     pam_limits.so#在linux中执行有些程序时,这些程序在执行前首先要对启动它的用户进行认证,符合一定的要求之后才允许执行#在linux中进行身份或是状态的验证程序是由PAM来进行的,PAM(Pluggable Authentication Modules)可动态加载验证模块#因为可以按需要动态的对验证的内容进行变更,所以可以大大提高验证的灵活性。#这个配置文件,就是让 limits.conf 的配置内容在oracle登陆的时候生效

Step4:修改profile配置文件
避免用户使用zsh,导致的进程数量过高,所以加入了一段Shell代码。当oracle是以zsh登陆的时候,也能够正确的限制启动进程数量。
vi /etc/profile

    # /etc/profile# System wide environment and startup programs, for login setup# Functions and aliases go in /etc/bashrc# It's NOT a good idea to change this file unless you know what you# are doing. It's much better to create a custom.sh shell script in# /etc/profile.d/ to make custom changes to your environment, as this# will prevent the need for merging in future updates.pathmunge () {case ":${PATH}:" in*:"$1":*);;*)if [ "$2" = "after" ] ; thenPATH=$PATH:$1elsePATH=$1:$PATHfiesac}if [ -x /usr/bin/id ]; thenif [ -z "$EUID" ]; then# ksh workaroundEUID=`id -u`UID=`id -ru`fiUSER="`id -un`"LOGNAME=$USERMAIL="/var/spool/mail/$USER"fi# Path manipulationif [ "$EUID" = "0" ]; thenpathmunge /sbinpathmunge /usr/sbinpathmunge /usr/local/sbinelsepathmunge /usr/local/sbin afterpathmunge /usr/sbin afterpathmunge /sbin afterfiHOSTNAME=`/bin/hostname 2>/dev/null`HISTSIZE=1000if [ "$HISTCONTROL" = "ignorespace" ] ; thenexport HISTCONTROL=ignorebothelseexport HISTCONTROL=ignoredupsfiexport PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL# By default, we want umask to get set. This sets it for login shell# Current threshold for system reserved uid/gids is 200# You could check uidgid reservation validity in# /usr/share/doc/setup-*/uidgid fileif [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; thenumask 002elseumask 022fifor i in /etc/profile.d/*.sh ; doif [ -r "$i" ]; thenif [ "${-#*i}" != "$-" ]; then. "$i"else. "$i" >/dev/null 2>&1fifidoneUnset iunset pathmunge 加入以下内容:if [ $USER = "oracle" ]; thenif [ $SHELL = "/bin/ksh" ]; thenulimit -p 16384ulimit -n 65536elseulimit -u 16384 -n 65536fifi#ulimit用于shell启动进程所占用的资源#profile文件是系统整体的环境变量配置文件

系统版本伪装

su - root
cp /etc/redhat-release /etc/redhat-release.bak

vi /etc/redhat-release

    Red Hat Enterprise Linux Server release 4

解压并运行Oracle10gr2安装包

cd /tmp
mkdir -p oracle10gr2
cd oracle10gr2/
zcat 10201_database_linux_x86_64.cpio.gz | cpio -idmv
mv database/ /u01
cd /u01
chown -R oracle:oinstall database/
ls -l
init 6

重启并且以oracle用户登录:为了避免不能加载x11 window的错误

init 6
cd /u01/database/
./runInstaller

选择高级安装模式

选择一个存储目录和选择一个执行安装程序的组

选择安装企业版本

添加支持简体中文

选择Oracle安装的家目录

忽略这个错误

安装环境检测,如果有没有通过检测项目,需要排查,或者手动勾选

这里可以选择同时创建数据库或者选择仅仅安装RDBMS

概览

等待安装结束

这是一个BUG,可以忽略

这里不能够着急点OK,点了就前功尽弃了。
先以登陆到root在执行这两个脚本

[root@jmilk ~]/u01/oracle/root.sh
[root@jmilk ~]/u01/oraInventory/orainstRoot.sh

执行完这两个脚本后,点击OK

完成安装点击Exit

测试

[oracle@jmilk ~]$ sqlplus /nologSQL*Plus: Release 10.2.0.1.0 - Production on Wed May 25 13:25:41 2016Copyright (c) 1982, 2005, Oracle.  All rights reserved.

安装rlwrap实用工具

在Linux下面使用sqlplus很不爽,上下键,退格键都不能用,严重降低生产效率。而rlwrap可以完美的解决这个问题。

[root@jmilk rlwrap]# pwd
/opt/oracle/otk/current/tools/rlwrap
[root@jmilk rlwrap]# ./configure && make && make install[root@jmilk rlwrap]# rlwrap
Usage: rlwrap [options] command ...Options:-a[password:]              --always-readline[=password:]
  -A                         --ansi-colour-aware
  -b <chars>                 --break-chars=<chars>
  -c                         --complete-filenames
  -C <name|N>                --command-name=<name|N>
  -D <0|1|2>                 --history-no-dupes=<0|1|2>
  -f <completion list>       --file=<completion list>
  -F <format string>         --history-format=<format string>
  -h                         --help
  -H <file>                  --history-filename=<file>
  -i                         --case-insensitive
  -l <file>                  --logfile=<file>
  -n                         --no-warnings
  -p[ANSI colour spec]       --prompt-colour[=ANSI colour spec]
  -P <input>                 --pre-given=<input>
  -q <chars>                 --quote-characters=<chars>
  -m[newline substitute]     --multi-line[=newline substitute]
  -r                         --remember
  -v                         --version
  -s <N>                     --histsize=<N> (negative: readonly)
  -t <name>                  --set-term-name=<name>

bug reports, suggestions, updates:
http://utopia.knoware.nl/~hlub/uck/rlwrap/

最后

这样我们的Oracle10gr2就在RHEL6.1上安装玩车个了,但是需要注意的是严格来说我们只是安装了RDBMS,而RDBMS是没有数据库的,所以我们还需要在额外的为RDBMS创建数据库并且创建监听程序。

RHEL6.1 安装 Oracle10gr2 (图文、解析)相关推荐

  1. 华为服务器centos安装系统,华为裸金属服务器泰山200安装Centos7图文解析

    我们知道,华为的泰山服务器功能强大,是国内业界少有的可以比肩世界高端企业级服务器的选手,对此我前文做过对比解析比肩intel最高端铂金系列,华为CPU鲲鹏920最新SPEC跑分, 这次我们就拿一台配置 ...

  2. 超详细在Ubuntu下安装JDK图文解析

    我们选择的是jdk1.6.0_30版本.安装文件名为jdk-6u30-linux-i586.bin. 1.复制jdk到安装目录 (1)假设jdk安装文件在桌面,我们指定的安装目录是:/usr/loca ...

  3. 在Red Hat 4 AS U7上安装oracle10gR2

    软件:Red Hat 4 AS U7, Oracle 10g R2 for linux32, VMWare 7, Windows 7 详细步骤清单: 在Red Hat 4 AS U7上安装oracle ...

  4. 图文解析如何配置网络交换机配置

    <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> 交换机的配置一 ...

  5. Nginx安装与配置文件解析

    导读 Nginx是一款开放源代码的高性能HTTP服务器和反向代理服务器,同时支持IMAP/POP3代理服务,是一款自由的软件,同时也是运维工程师必会的一种服务器,下面我就简单的说一下Nginx服务器的 ...

  6. 【数据结构与算法】4.数据结构图文解析系列

    数据结构图文解析系列 数据结构系列文章 数据结构图文解析之:数组.单链表.双链表介绍及C++模板实现 数据结构图文解析之:栈的简介及C++模板实现 数据结构图文解析之:队列详解与C++模板实现 数据结 ...

  7. Ubuntu之Pycharm:Ubuntu系统内Pycharm安装的图文教程

    Ubuntu之Pycharm:Ubuntu系统内Pycharm安装的图文教程 目录 Pycharm安装的图文教程 1.官网下载Pycharm 2.解压操作 3.进入Pycharm文件夹的bin目录,输 ...

  8. mysql安装教程8.0.21安装_mysql8.0.21安装教程图文详解

    1.下载 下载链接 点击download,这里可能需要登录甲骨文的账号,登录一下即可 2.解压 下载好会得到一个安装包 把它解压到一个能找到的目录下即可,我的是这样(my.ini文件你们应该没有) 3 ...

  9. QT5.10.0安装教程图文教程以及安装成功QT5.10.0后环境配置图文步骤

    引用:https://www.cnblogs.com/chenmingjun/p/8392713.html QT5.10.0安装教程图文教程以及安装成功QT5.10.0后环境配置图文教程 文章目录 Q ...

最新文章

  1. Java多线程面试题通关手册!
  2. 谷歌发布TensorFlow Privacy​:大幅提升AI模型中的隐私保护
  3. 嵌入式VxWorks系统开发与应用
  4. linux正则表达式BRE
  5. 20144303 20145239 实验三 实时系统的移植
  6. Linux服务器和客户端之间的数据同步(备份)
  7. 颜色协调模型Color Harmoniztion
  8. MVVM架构~knockoutjs系列之验证信息自定义输出~续
  9. MySQL数据库课程实验报告_创建数据库并插入数据
  10. diff git 指定时间_Git 自救指南
  11. Windows下NLB(分工作组与域环境)、服务器群集简单搭建
  12. 编译原理第三版王生原pdf_CS143:编译原理 | 环境搭建HelloWorld
  13. 吴恩达深度学习课程第四章第二周编程作业(pytorch实现)
  14. 手势解锁java后端设计_Android进阶 - 手势解锁
  15. javalinux服务器上写文件,java 读取linux服务器上文件
  16. LKA linux kernel architechture
  17. 友盟统计 H5 vue 隐藏友盟图标
  18. 从继承和组合理解面向对象,并从面向对象与继承的意义理解白马非马问题
  19. HaaS EDU K1 快速搭建Python开发环境
  20. 遥感影像语义分割论文笔记(一)FarSeg CVPR2020

热门文章

  1. 结构体和数组之间的映射关系
  2. android朋友圈图片背景图片,做个很哇塞的女孩背景图朋友圈
  3. 怎样快速学习html5,如何快速学习HTML5?带你了解HTML5学什么?
  4. springboot2 war页面放在那_成为微服务架构师--SpringBoot2学习笔记
  5. linux ppp拨号 socket,请问GPRS模块ppp拨号不成功是什么原因
  6. python windows窗口置顶_Python入门:第一个程序“Hello, world”
  7. Java实用教程笔记 常用实用类
  8. 【 Vivado 】输出延迟约束(Constraining Ouput Delay)
  9. vue小项目总结与笔记【六】——使用axios发送ajax请求
  10. Html5浏览器支持