完整版见https://jadyer.github.io/2014/05/18/centos-install-oracle/

/**
* CentOS-6.4-DVD系统中安装Oracle-11.2.0.4
* ----------------------------------------------------------------------------------------------------------------------
* 【前言】
* 本来是在CentOS-6.4-minimal-64bit系统中安装Oracle-11.2.0.4.0-Linux-x86_64,结果整整折腾两天都没成功安装
* 总是在最后一步[./runInstaller]运行命令后打印以下的提示
* Checking monitor: must be configured to display at least 256 colors
* >>>Could not execute auto check for display colors using command /usr/bin/xdpyinfo.
* Check if the DISPLAY variable is set. Failed <<<<
* 后来即便安装了图形界面(安装方法见http://blog.csdn.net/jadyer/article/details/18324297),结果还是打印这个提示
* 于是各种Google,弄了非常多东西,当中有一次打印了以下的提示
* ls: 无法訪问/usr/sbin/smartctl: 没有那个文件或文件夹 /usr/sbin/smartctl not found
* 听一个DBA说:假设报smartctl找不到,就须要先安装smartmontools,之后再安装cvuqdisk,smartmontools包是Linux系统光盘自带的
* [root@CentOS64 sbin]# yum install -y smartmontools
* [root@CentOS64 sbin]# cd /app
* [root@CentOS64 app]# rpm -ivh cvuqdisk-1.0.9-1.rpm
* 最后辗转找到"runcluvfy.sh"和"cvuqdisk-1.0.9-1.rpm"俩文件,安装后再运行[./runInstaller]
* 发现还是打印这个Checking monitor: must be configured to display at least 256 colors提示
* 后来又把CentOS的"id:3:initdefault:"改成5,启动图形界面,在CentOS里面去运行[./runInstaller](之前都是在xshell里操作)
* 结果还是打印Checking monitor: must be configured to display at least 256 colors提示,无奈换回DVD系统
* 曾经就听DBA说过:Oracle搞了非常多的手段和策略,当中之中的一个就是为数据库安装工作添加了很多小零件的限制
* 这就使得在Oracle自己的Linux系统上安装Oracle数据库时,非常的方便,畅通无阻
* 但在其他Linux系统上安装不同版本号的Oracle时,就会提示你缺少这个缺少那个的,没点经验的还未必搞得定
* ----------------------------------------------------------------------------------------------------------------------
* 【准备】
* 本文记述的是在VirtualBox里面的CentOS-6.4-DVD系统中安装Oracle-11.2.0.4.0-Linux-x86_64
* 关于VirtualBox和CentOS的安装配置就略了,这里主要说一下Oracle-11.2.0.4.0-Linux-x86-64安装包的下载
* 眼下Oracle的11g版本号已经停止更新了,以后仅仅会更新12c版本号
* 因为12c刚出来不久,考虑到企业中应用11g很多其他一些,所以本文演示的是11g的安装方式
* 而11g的最后一个版本号号就是11.2.0.4.0,可是我们在Oracle官网仅仅能找到11.2.0.1.0的下载
* 地址为http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
* 是不是有些奇怪,别急,在这个页面同一时候也会看到以下这样一段描写叙述
* 7/13: Patch Set 11.2.0.4 for Linux and Solaris is now available on support.oracle.com.
* Note: it is a full installation (you do not need to download 11.2.0.1 first)
* 翻译过来就是:能够到support.oracle.com去下载11.2.0.4,而且下载到的会是一个完整的安装包,也不须要预先安装11.2.0.1
* 有Oracle帐户的朋友能够到support.oracle.com下载,没有的也没关系,我在百度网盘共享了:http://pan.baidu.com/s/1dDpC14P
* Oracle-11.2.0.4.0-Linux-x86_64安装包共同拥有7个文件,当中1of7和2of7就是数据库的完整的安装文件,我们这里仅仅须要1和2就够了
* ----------------------------------------------------------------------------------------------------------------------
* 【文档】
* Oracle提供了非常详尽的安装和使用文档,下载地址例如以下
* http://www.oracle.com/technetwork/database/enterprise-edition/documentation/index.html
* 它的在线浏览地址为http://www.oracle.com/pls/db112/homepage
* 接下来我们找一下和安装有关的那部分内容
* 点击左側"Installing and Upgrading",再点击右側"Database Installation Guide for Linux"后面的HTML链接
* 接下来就会看到非常多的安装说明,这里我们仅仅看"Oracle Database Preinstallation Tasks"部分就够了
* ----------------------------------------------------------------------------------------------------------------------
* @create May 17, 2014 10:16:21 PM
* @author 玄玉<http://blog.csdn.net/jadyer>
*/
/**
* 下面是安装前的准备工作
* ----------------------------------------------------------------------------------------------------------------------
* 【步骤】
* 1)Create group(oinstall,dba)/user account(oracle)---->创建组和用户
* 2)Configure environment variables for oracle--------->配置环境变量
* 3)Check and add RPM package-------------------------->检查安装所需的RPM包
* 4)Modify kernel parameter---------------------------->改动内核參数
* 5)Change oracle limits------------------------------->改动oracle用户的shell限制(能够提升性能)
* 6)./runInstaller------------------------------------->安装Oracle
* ----------------------------------------------------------------------------------------------------------------------
* 【创建组和用户】
* [root@CentOS64 ~]# groupadd oinstall (创建一个名为oinstall的组,也能够用别的名字,仅仅是习惯性用oinstall而已)
* [root@CentOS64 ~]# groupadd dba (创建一个名为dba的组)
* [root@CentOS64 ~]# useradd -g oinstall -G dba oracle (创建一个名为oracle的用户,其主组为oinstall,其副组为dba)
* [root@CentOS64 ~]# passwd oracle (设置用户oracle的登录password,这里设为22)
* [root@CentOS64 ~]# chown -R oracle:oinstall /app (改动/app文件夹的拥有着,这里/app文件夹是我提前创建的)
* [root@CentOS64 ~]# yum install -y unzip (CentOS-6.4-minimal系统中默认是没有unzip包的)
* [root@CentOS64 ~]# su - oracle (切换到oracle用户)
* [oracle@CentOS64 ~]$ cd /app/ (切换到/app文件夹,然后解压Oracle安装包)
* [oracle@CentOS64 app]# unzip /app/software/p13390677_112040_Linux-x86-64_1of7.zip
* [oracle@CentOS64 app]# unzip /app/software/p13390677_112040_Linux-x86-64_2of7.zip
* ----------------------------------------------------------------------------------------------------------------------
* 【配置环境变量】
* [root@CentOS64 ~]# hostname (查看主机名,得到"CentOS64")
* [root@CentOS64 ~]# vi /etc/hosts (在hosts中加上"192.168.0.103 CentOS64"映射,该IP是"ifconfig"得到的)
* [root@CentOS64 ~]# vi /etc/selinux/config (设置SELINUX=disabled,即关掉安全增强工具,然后最好reboot重新启动一下)
* [root@CentOS64 ~]# su - oracle (切换到oracle用户)
* [oracle@CentOS64 ~]$ pwd (列出当前文件夹,即"/home/oracle")
* [oracle@CentOS64 ~]$ ls -la (-a表示显示隐藏文件,这里我们会发现一个名为".bash_profile"的隐藏文件)
* [oracle@CentOS64 ~]$ vi .bash_profile (编辑.bash_profile文件,这样oracle用户登录时就会依照此文件设置的去运行)
* # .bash_profile
* # Get the aliases and functions
* if [ -f ~/.bashrc ]; then
* . ~/.bashrc
* fi
* # User specific environment and startup programs
* ORACLE_BASE=/app
* ORACLE_HOME=$ORACLE_BASE/oracle
* ORACLE_SID=xuanyu
* DISPLAY=192.168.0.102:0.0
* PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
* LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
* stty erase ^h
* export PATH LD_LIBRARY_PATH DISPLAY ORACLE_BASE ORACLE_HOME ORACLE_SID
* :x
* [oracle@CentOS64 ~]$ cat .bash_profile
* 【环境变量的部分说明】
* stty:它的作用是,sqlplus中输错字符再按Backspace键回删时,就不会出现乱码字符.若未设置这个则可Ctrl+Backspace
* DISPLAY:它指向的IP就是我的win7的IP(确切来说是网关的地址),作用是若Linux运行的程序有图形界面,那么它就会在Windows下显示
* 这里在安装Oracle11g时,能够选择图形界面安装,但我的CentOS在启动时会读取到"id:3:initdefault:",即没有以桌面环境启动
* 全部我们就要借助Xmanager-Passive来实现图形界面的功能,上面DISPLAY參数的IP地址实际上是指向安装了Xmanager的Windows系统
* 最后就会通过启动Xmanager-Passive来显示Oracle的安装图形界面
* 当然前提是在运行[./runInstaller]命令前,先在Windows下启动Xmanager-Passive(它是Xmanager_Enterprise_4组件中的一个)
* ----------------------------------------------------------------------------------------------------------------------
* 【检查安装所需的RPM包】
* Oracle文档上都有描写叙述,地址为http://docs.oracle.com/cd/E11882_01/install.112/e47689/pre_install.htm#LADBI1085
* 详见2.4.3章节Package Requirements,我们这里用的是64位的CentOS
* 所以看这一段就可以了"Oracle Database Package Requirements for Linux x86-64"
* 接下来的就一一对照"Oracle Linux 6 and Red Hat Enterprise Linux 6 The following packages..... must be installed"就可以
* [root@CentOS64 database]# rpm -qa | grep binutils
* 然后查看控制台输出就可以了,我这里输出的是binutils-2.20.51.0.2-5.36.el6.x86_64,表明已安装了binutils
* 若无输出则表明未安装binutils(注意要通过root用户来查找)
* 假设没搜索到,那么比較便捷的方法是运行[yum install -y binutils]安装就可以
* 若yum方式安装无效,还能够到http://pkgs.org/下载相应的rpm文件,然后运行[rpm -ivh ksh-20120801-10.el6.x86_64.rpm]命令安装
* 除此外,若想在linux上使用ODBC,那么还要把下面几个包也装上(详见"2.4.5.1 Oracle ODBC Drivers"章节描写叙述)
* unixODBC-2.2.14-11.el6 (x86_64) or later
* unixODBC-2.2.14-11.el6.i686 or later
* unixODBC-devel-2.2.14-11.el6 (x86_64) or later
* unixODBC-devel-2.2.14-11.el6.i686 or later
* ----------------------------------------------------------------------------------------------------------------------
* 【改动内核參数】
* http://docs.oracle.com/cd/E11882_01/install.112/e47689/pre_install.htm#LADBI1188
* 在上个页面的2.13.1章节Displaying and Changing Kernel Parameter Values描写叙述了须要改动的内核參数
* [root@CentOS64 ~]# vi /etc/sysctl.conf (将下面配置拷到sysctl.conf文件末尾)
* fs.aio-max-nr = 1048576
* fs.file-max = 6815744
* kernel.shmall = 2097152
* kernel.shmmax = 4294967295
* kernel.shmmni = 4096
* 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 = 1048576
* [root@CentOS64 ~]# sysctl -p
* [root@CentOS64 ~]#
* 这样,上面改动的内核參数就生效了.我们能够使用"sysctl -a | grep net.core.wmem_max"命令查看
* ----------------------------------------------------------------------------------------------------------------------
* 【改动oracle用户的shell限制】
* http://docs.oracle.com/cd/E11882_01/install.112/e47689/pre_install.htm#LADBI1188
* 在上个页面的2.12章节Checking Resource Limits for the Oracle Software Installation Users描写叙述了须要改动的资源限制參数
* [root@CentOS64 oracle]# vi /etc/security/limits.conf (将下面配置拷到sysctl.conf文件末尾,然后保存就可以)
* oracle hard nofile 65536
* oracle hard nproc 16384
* oracle soft nproc 2047
* oracle hard stack 32768
* ----------------------------------------------------------------------------------------------------------------------
* 【安装Oracle】
* 有两种方式安装,一个是有图形界面的可视化安装,一个是无图形界面的静默安装
* 这里演示的是有图形界面的安装
* 首先打开Win7系统中安装的Xmanager_Enterprise_4组件中的Xmanager-Passive工具(它会自己主动最小化到右下角任务栏)
* 然后以oracle用户运行[./runInstaller]命令(接下来Xmanager-Passive就自己主动起作用了,Oracle安装界面自己主动呈现出来了)
* ----------------------------------------------------------------------------------------------------------------------
* @create May 18, 2014 10:06:30 AM
* @author 玄玉<http://blog.csdn.net/jadyer>
*/
/**
* 接下来描写叙述一下安装界面中的各个步骤,以及怎样创建和启动停止数据库
* ----------------------------------------------------------------------------------------------------------------------
* 【安装步骤】
* 1)Configure Security Updates
* 取消勾选I wish to receive security Updates via My Oracle Support
* 此时点"Next"后会弹出来一个窗体You have not provided an email address,我们点"Yes"即可了
* 2)Download Software Updates
* 勾选Skip software udpates
* 3)Installation Option
* 勾选Install database software only
* 4)Grid Installation Options
* 勾选Single instance database installation
* 这里不能选择RAC,由于CentOS上是没办法安装RAC的,这是由于Oracle仅仅会在它自己的Linux公布RAC所须要一些特殊软件和包
* 5)Product Languages
* 默认的English即可
* 6)Database Edition
* 勾选Enterprise Edition(4.5GB)
* 7)Installation Location
* 这里Oracle Base和Software Location就会自己主动找到之前设置的环境变量设定的安装文件夹
* 8)Create Inventory
* Inventory Directory值改动为"/home/oracle/oraInventory" (Inventory Directory指的是Oracle的配置文件文件夹)
* oraInventory Group Name採用默认的oinstall即可
* 9)Operating System Groups
* Database Administrator(OSDBA) Group採用默认的dba选项即可
* Database Operator(OSOPER) Group(Optional)也採用默认的空选项即可
* 10)Prerequisite Checks
* 这一步就是在检查之前设置的内核參数、所需的包等等是否满足Oracle的安装要求
* 这一步可能会提示缺少"pdksh-5.2.14"的包,对于pdksh而言,我们能够忽略掉(假设是提示缺少其他包,还要细致看一下),点击右上角的Ingore All
* 然后会弹出个对话框[INS-13016]You have chosen to ingore some of the prerequisite....Are you sure you want to continue?
* 这里点"Yes"即可
* 11)Summary
* 这一步会告诉我们都设置了哪些安装參数,然后点"Install"即可了
* 12)Install Product
* 这一步就是開始安装了,我们看着它安装即可了
* 经过漫长的等待,它会弹出一个对话框The following configuration scripts need to be executed as the "root" use
* 并会列出两个脚本路径给我们/home/oracle/oraInventory/orainstRoot.sh和/app/oracle/root.sh
* 我们回到Xshell中,以root登录,分别运行这俩脚本(先运行orainstRoot.sh,再运行root.sh)
* 两个脚本运行完成,再回到Oracle安装界面,在这个弹出的对话框中点击"OK"即可了
* 13)Finish
* The installation of Oracle Database was successfull.
* ----------------------------------------------------------------------------------------------------------------------
* 【创建数据库】
* 1)创建一个Listener
* [oracle@CentOS64 oracle]$ netca (控制台会打印Oracle Net Services Configuration,稍候会自己主动弹出图形界面)
* [oracle@CentOS64 oracle]$ ps -ef | grep lsn (图形界面创建Listener完成后,通过这个命令就能够看到Listener是否启动了)
* 2)创建数据库
* [oracle@CentOS64 oracle]$ dbca (该命令会自己主动弹出创建数据库的图形界面,Database Configuration Assistant,创建过程一共同拥有12步)
* 1of12:选择Create a Database
* 2of12:选择General Purpose or Transaction Processing,即通用的
* 3of12:建议输入和上面配置的环境变量中的ORACLE_SID同样,即xuanyu
* 4of12:取消勾选Configure Enterprise Manager
* 5of12:设置管理员口令,这里点击"Next"时可能会弹出提示你设置的password不安全Do you want to continue,我们选择"Yes"即可
* 6of12:Storage Type就默认的File System即可,Storage Locations也是默认的Use Database File Locations from Template即可
* 7of12:勾选Enable Archiving(即设置归档),另外Specify Fast Recovery Area就依照默认的勾选即可
* 8of12:勾选Sample Schemas
* 9of12:Character Sets标签下勾选Use Unicode(AL32UTF8)字符集,其余三个标签依照默认即可
* 10of12:一些说明文字,直接"Next"即可
* 11of12:也是依照它默认的勾选Create Database即可,然后点击"Finish"開始创建(这是它会弹出一个总结报告的对话框,点击"OK"即可)
* 12of12:接下来就会看到我们所熟悉的创建数据库的界面,这个过程比較漫长,我们等待即可
* [oracle@CentOS64 oracle]$ ps -ef | grep ora_ (图形界面创建数据库完成后,通过这个命令就能够看到Oracle实例是否在运行了)
* ----------------------------------------------------------------------------------------------------------------------
* 【关闭数据库】
* [oracle@CentOS64 oracle]$ sqlplus /nolog (启动SQLPLUS)
* SQL> conn /as sysdba
* Connected.
* SQL> SELECT * FROM v$version; (查看Oracle版本号)
* SQL> shutdown immediate (关闭数据库)
* Database closed.
* Database dismounted.
* ORACLE instance shut down.
* SQL> quit (退出SQLPLUS)
* [oracle@CentOS64 oracle]$ ps -ef | grep ora_ (这时会发现没有不论什么打印,说明数据库被停止了)
* ----------------------------------------------------------------------------------------------------------------------
* 【启动数据库】
* [oracle@CentOS64 oracle]$ sqlplus /nolog (启动SQLPLUS)
* SQL> conn /as sysdba
* Connected to an idle instance.
* SQL> startup (启动数据库)
* ORACLE instance started.
* Total System Global Area 845348864 bytes
* Fixed Size 1367904 bytes
* Variable Size 549453984 bytes
* Database Buffers 289406976 bytes
* Redo Buffers 5120000 bytes
* Database mounted.
* Database opened.
* SQL> ! (退出SQLPLUS)
* [oracle@CentOS64 oracle]$ ps -ef | grep ora_ (这时会发现打印出一大堆东西,说明数据库被启动了)
* ----------------------------------------------------------------------------------------------------------------------
* @create May 18, 2014 10:07:19 AM
* @author 玄玉<http://blog.csdn.net/jadyer>
*/

CentOS-6.4-DVD系统中安装Oracle-11.2.0.4的更多相关文章

  1. centos6.5 x86_64安装oracle 11.2.0.3grid

     centos6.5 x86_64安装oracle 11.2.0.3grid 1.安装前的准备 工作 1.1.配置node1 1.1.1.配置虚拟机并安装centos 安装node1----- 1 ...

  2. Asianux 7.3安装Oracle 11.2.0.4单实例体验

    环境:Asianux 7.3 需求:安装Oracle 11.2.0.4 单实例 背景:系统使用默认的最小安装部署,Oracle安装额外需要的包统一使用yum安装. 查看当前系统相关信息: [root@ ...

  3. CentOS 7 安装 Oracle 11.2.0.4

    一.安装环境 CentOS Linux release 7.2.1511 (Core) Oracle Database 11g Release 2 (11.2.0.4) 二.安装前准备 2.1 修改主 ...

  4. centos6.8 静默安装 oracle 11.2.0.4

    安装环境及系统要求    (下文具体参数值与路径根据自己的环境调整)操作系统:Red Hat Enterprise Linux 6 (x86) 或者CentOS 6 (x64) 数据库:Oracle ...

  5. 安装Oracle 11.2.0.3 Client Win 32-bit

    第一步:安装Oracle 11.2 32-bit数据库1.双击setup文件,进入安装界面 2.选择跳过升级选项 3.设置oracle安装根目录 4.确认选项,没有问题点击“安装” 第二步:创建数据库

  6. Linux系统中安装Oracle数据库

    安装前的准备 三个包:winx64_12201_database.zip(oracle数据库) window_7(安装在虚拟机中的window7纯净版系统) client.zip(oracle的监听器 ...

  7. Linux系统中安装Oracle过程记录

    第一章 安装数据库软件 1.1 修改密码及创建目录和权限 创建oracle用户和组 创建相关目录并赋权 1.2 设置oracle用户环境变量 ORACLE_BASE:产品基目录 ORACLE_HOME ...

  8. 【实战】静默安装-oracle 11.2.0.3 on centos 5.10

    发现网上静默安装的文章非常多,乱七八糟,五花八门!来个扫盲的!   centos 5.10 下安装oracle 11g_r2 ************************************* ...

  9. [IOT] - 在树莓派的 Raspbian 系统中安装 .Net Core 3.0 运行环境

    之前在 Docker 中配置过 .Net Core 运行环境,地址:[IOT] - Raspberry Pi 4 Model B 系统初始化,Docker CE + .Net Core 开发环境配置 ...

  10. 【转】:Oracle Linux6.9下安装Oracle 11.2.0.4.0及psu补丁升级

    为方便截图,本文操作都在vmware虚拟机上完成. 目录: 1.操作系统安装 2.数据库安装 3.PSU补丁升级卸载   part1 操作系统安装 Oracle (Enterprise) Linux ...

随机推荐

  1. PHP——基本使用(一)

    Apache安装与配置 install 下载地址:https://www.apachelounge.com/download/,选择2.4.33版本64位 将程序解压到一个英文目录下,以管理身份打开c ...

  2. MySql学习笔记(二) —— 正则表达式的使用

    前面介绍利用一些关键字搭配相应的SQL语句进行数据库查找过滤,但随着过滤条件的复杂性的增加,where 子句本身的复杂性也会增加.这时我们就可以利用正则表达式来进行匹配查找. 1.基本字符匹配 ' o ...

  3. Springboot + SLF4j + Log4j2 打印异常日志时,耗时要5-6秒

    1.使用jps -l 查看springboot项目的进程ID 2.使用命令jstack -l 进程ID > log.txt 打印堆栈信息到文件,内容如下: "http-nio-8065 ...

  4. CAD绘制一个单行文字(com接口VB语言)

    主要用到函数说明: _DMxDrawX::DrawText 绘制一个单行文字.详细说明如下: 参数 说明 DOUBLE dPosX >文字的位置的X坐标 DOUBLE dPosY 文字的位置的Y ...

  5. wpf mvvm模式下 在ViewModel关闭view

    本文只是博主用来记录笔记,误喷 使用到到了MVVM中消息通知功能 第一步:在需要关闭窗体中注册消息 public UserView() { this.DataContext = new UserVie ...

  6. 2019西安多校联训 Day2

    试题链接:http://www.accoders.com/contest.php?cid=1894   考试密码请私信; T1 残忍WA 0,明明就是一道非常菜的字符串QAQ 思路:一共找四种东西,A ...

  7. iphone6,iphone6 plus适配,旧项目出现黑线问题

    问题:可能开始适配iPhone6和iPhone6 plus的朋友很快就发现,模块器头部和底部会出线一条黑线.但是在其他模拟器完全没有问题.程序也能正常跑.如下图 很清楚的看到头部有一条黑线. 解决办法 ...

  8. WIndows 系统下的常用命令 和 检测方法

    ### 一.检测硬盘速度(Windows 自带工具) #### 使用windows 系统自带的工具测试硬盘读写速度 > 在使用下面命令前,需要获得管理员权限,才会在Dos窗口上显示(否则,一闪而 ...

  9. Linux学习笔记记录(三)

    压缩: 例如将/etc 目录压缩为压缩包tar -cjvf  /aaa.tar.bz2  /etc           tar -czvf /aaa.tar.gz  /etc 解压: tar -xjv ...

  10. * format-- set command window output display format

    the displayed number may not match the input number due to display format default: 4 decimal syntax: ...