操作环境:Citrix虚拟化环境中申请一个Linux6.4主机(模板)
目标:创建单机11g + ASM存储 数据库

1. 主机准备

IP地址:
主机名:JY-DB
目录:/u01
磁盘:从主机本地磁盘资源划分50G硬盘1个,从磁阵资源划分10G硬盘3个

1.1 检查主机名和IP地址的映射:hostname -i

hostname
vi /etc/sysconfig/network
vi /etc/hosts

1.2 分配/u01目录为oracle软件安装目录,lv_asm1,lv_asm2,lv_asm3为ASM磁盘

/dev/xvdb 50G 格式化后挂载到/u01目录

/dev/xvdc /dev/xvde /dev/xvdf 各10G,不用格式化,给ASM使用

pvcreate /dev/xvdc /dev/xvde /dev/xvdf
vgcreate ora_vg /dev/xvdc /dev/xvde /dev/xvdf
lvcreate -L 10g -n lv_asm1 ora_vg
lvcreate -L 10g -n lv_asm2 ora_vg
vgdisplay ora_vg
lvcreate -l -n lv_asm3 ora_vg

在后面创建grid用户后,创建ASM前,需要更改lv的磁盘权限

chown grid:asmadmin /dev/mapper/ora*

1.3 配置YUM,安装依赖包

yum配置参考:http://www.cnblogs.com/jyzhao/p/3938290.html

yum install binutils compat-libstdc++- elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc- gcc-c++ libaio-devel libaio libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel pdksh ksh compat-libcap1

若之前安装系统没有安装图形,需要安装图形界面和xterm

yum groupinstall "X Window System"

yum install xterm

1.4 关闭系统防火墙开机启动

service iptables stop
chkconfig iptables off

2. 创建ORACLE 用户和组成员

groupadd oinstall
groupadd dba
groupadd oper
groupadd asmadmin
groupadd asmdba
groupadd asmoper
useradd -g oinstall -G dba,asmdba,oper oracle
useradd -g oinstall -G dba,asmadmin,asmdba,asmoper grid

分别指定oracle、grid用户的密码

passwd oracle
passwd grid

3. 创建以下目录并赋予对应权限

mkdir -p /u01/app/11.2./grid
mkdir -p /u01/app/grid
mkdir -p /u01/app/oracle/product/11.2./db_1
chown -R oracle:oinstall /u01/app
chmod -R /u01/app

4. 设置oracle、grid用户的环境变量

4.1 oracle用户登陆: vi ~/.bash_profile

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2./db_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:.
export NLS_LANG=american_america.ZHS16GBK
export ORACLE_SID=jyzhao
export PATH=$PATH:$ORACLE_HOME/bin:.

4.2 grid用户登录:vi ~/.bash_profile

export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/11.2./grid
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:.
export NLS_LANG=American_america.ZHS16GBK
export PATH=$PATH:$ORACLE_HOME/bin:.
export ORACLE_SID=+ASM

5. root用户更改系统参数

5.1 vi /etc/sysctl.conf

fs.aio-max-nr =
fs.file-max =
kernel.shmall =
kernel.shmmax = //一般设置为系统内存75%单位是字节
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 =

使设置立即生效: /sbin/sysctl -p

5.2 vi /etc/security/limits.conf

oracle soft nproc
oracle hard nproc
oracle soft nofile
oracle hard nofile
oracle soft stack
grid soft nproc
grid hard nproc
grid soft nofile
grid hard nofile
grid soft stack

5.3 vi /etc/pam.d/login

#oracle
session required /lib64/security/pam_limits.so
session required pam_limits.so

6. 上传Oracle安装介质到/u01/tmp目录下

mkdir -p /u01/tmp

p13390677__Linux-x86-_1of7.zip
p13390677__Linux-x86-_2of7.zip
p13390677__Linux-x86-_3of7.zip

7. 安装grid组件

#cd /u01/tmp/
#unzip p10404530__Linux-x86-_3of7.zip
#chown -R grid:oinstall grid Xmanager软件用grid用户登录
$cd /u01/tmp/grid
$./runInstaller

图形界面安装,最后root用户执行两个脚本,执行脚本的屏幕输出如下:

# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world. Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete. # /u01/app/11.2./grid/root.sh
Performing root user operation for Oracle 11g The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/11.2./grid Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ... Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed. To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:
/u01/app/11.2./grid/perl/bin/perl -I/u01/app/11.2./grid/perl/lib -I/u01/app/11.2./grid/crs/install /u01/app/11.2./grid/crs/install/roothas.pl To configure Grid Infrastructure for a Cluster execute the following command:
/u01/app/11.2./grid/crs/config/config.sh This command launches the Grid Infrastructure Configuration Wizard. The wizard also supports silent operation, and the parameters can be passed through the response file that is available in the installation media.

8. 根据上步执行的脚本输出提示,确定单节点需要root用户执行下面的命令

/u01/app/11.2./grid/perl/bin/perl -I/u01/app/11.2./grid/perl/lib -I/u01/app/11.2./grid/crs/install /u01/app/11.2./grid/crs/install/roothas.pl

9. 使用asmca创建ASM 磁盘组

Xmanager软件用grid用户登录

$asmca

10. 安装oralce软件

#cd /u01/tmp/
#unzip p13390677__Linux-x86-_1of7.zip;unzip p13390677__Linux-x86-_2of7.zip
#chown -R oracle:oinstall database Xmanager软件用oracle用户登录
$cd /u01/tmp/database/
$./runInstaller 图形界面安装,最后root用户执行一个脚本
#/u01/app/oracle/product/11.2./db_/root.sh

11. 创建数据库

Xmanager软件用oracle用户登录

$dbca

图形界面建库,Storage Type选择ASM,+DATA1磁盘组,数据库字符集根据实际情况选择。

12. 使用grid用户创建监听

Xmanager软件用grid用户登录

$netca

13. 客户端测试数据库连接

ping IP地址
tnsping IP地址 sqlplus system/oracle@IP地址/jyzhao

14. 由于lv的权限在重启后会变回root用户,需要添加开机启动脚本

vi /etc/rc.d/rc.local
chown grid:asmadmin /dev/mapper/ora* 创建rc.local的链接文件 ln -sf /etc/rc.d/rc.local /etc/rc.d/rc1.d/S999rc.local &&
ln -sf /etc/rc.d/rc.local /etc/rc.d/rc2.d/S999rc.local &&
ln -sf /etc/rc.d/rc.local /etc/rc.d/rc3.d/S999rc.local &&
ln -sf /etc/rc.d/rc.local /etc/rc.d/rc4.d/S999rc.local &&
ln -sf /etc/rc.d/rc.local /etc/rc.d/rc5.d/S999rc.local &&
ln -sf /etc/rc.d/rc.local /etc/rc.d/rc6.d/S999rc.local

15. 重启测试

15.1 关闭数据库

# su - oracle
$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4. Production on Thu Mar :: Copyright (c) , , Oracle. All rights reserved. Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4. - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>

15.2 关闭has

$ su - grid
Password:
$ crsctl stop has
CRS-: Starting shutdown of Oracle High Availability Services-managed resources on 'jy-db'
CRS-: Attempting to stop 'ora.LISTENER.lsnr' on 'jy-db'
CRS-: Attempting to stop 'ora.DATA1.dg' on 'jy-db'
CRS-: Stop of 'ora.LISTENER.lsnr' on 'jy-db' succeeded
CRS-: Stop of 'ora.DATA1.dg' on 'jy-db' succeeded
CRS-: Attempting to clean 'ora.DATA1.dg' on 'jy-db'
CRS-: Clean of 'ora.DATA1.dg' on 'jy-db' succeeded
CRS-: Attempting to stop 'ora.asm' on 'jy-db'
CRS-: Stop of 'ora.asm' on 'jy-db' succeeded
CRS-: Attempting to stop 'ora.cssd' on 'jy-db'
CRS-: Stop of 'ora.cssd' on 'jy-db' succeeded
CRS-: Attempting to stop 'ora.evmd' on 'jy-db'
CRS-: Stop of 'ora.evmd' on 'jy-db' succeeded
CRS-: Shutdown of Oracle High Availability Services-managed resources on 'jy-db' has completed
CRS-: Oracle High Availability Services has been stopped.

15.3 重启主机

# sync
# sync
# sync # shutdown -Fr now Broadcast message from root@JY-DB (/dev/pts/) at : ... The system is going down for reboot NOW!

15.4主机启动后,查看crs状态

# /u01/app/11.2./grid/bin/crsctl stat res -t

--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA1.dg
ONLINE ONLINE jy-db
ora.LISTENER.lsnr
ONLINE ONLINE jy-db
ora.asm
ONLINE ONLINE jy-db Started
ora.ons
OFFLINE OFFLINE jy-db
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
ONLINE ONLINE jy-db
ora.diskmon
OFFLINE OFFLINE
ora.evmd
ONLINE ONLINE jy-db
ora.jyzhao.db
OFFLINE OFFLINE Instance Shutdown

15.5 启动数据库

# /u01/app/11.2./grid/bin/srvctl start database -d jyzhao

# /u01/app/11.2./grid/bin/crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA1.dg
ONLINE ONLINE jy-db
ora.LISTENER.lsnr
ONLINE ONLINE jy-db
ora.asm
ONLINE ONLINE jy-db Started
ora.ons
OFFLINE OFFLINE jy-db
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
ONLINE ONLINE jy-db
ora.diskmon
OFFLINE OFFLINE
ora.evmd
ONLINE ONLINE jy-db
ora.jyzhao.db
ONLINE ONLINE jy-db Open      

15.6 客户端测试

C:\Users\Alfred>sqlplus system/oracle@IP地址/jyzhao
SQL*Plus: Release 11.2.0.1. Production on 星期四 月 ::
Copyright (c) , , Oracle. All rights reserved. 连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.4. - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options SQL>

至此,Linux平台oracle 11g单实例 + ASM存储 安装部署全部完成。

Linux平台oracle 11g单实例 + ASM存储 安装部署 快速参考的更多相关文章

  1. Linux平台oracle 11g单实例 安装部署配置 快速参考

    1.重建主机的Oracle用户 组 统一规范 uid gid 以保证共享存储挂接或其他需求的权限规范 userdel -r oracle groupadd -g 7 oinstall groupadd ...

  2. Oracle 11g 单实例静默安装实战记录(linux)

    oracle 11g 单实例静默安装 AUTHOR:Oracle_Ran 环境规划: OS Version : Red Hat Enterprise Linux Server release 6.7 ...

  3. Oracle 11g 单实例到单实例OGG同步实施文档-OGG initial load

    Oracle 11g 单实例到单实例OGG同步实施文档-OGG initial load 2018-06-07 00:514730原创GoldenGate 作者: leo 本文链接:https://w ...

  4. Oracle 11g 单实例到单实例OGG同步实施文档-RMAN 初始化

    Oracle 11g 单实例到单实例OGG同步实施文档-RMAN 初始化 2018-06-07 13:455170原创GoldenGate 作者: leo 本文链接:https://www.cndba ...

  5. Oracle 11g 单实例到单实例OGG同步实施文档-EXPDP初始化

    Oracle 11g 单实例到单实例OGG同步实施文档-EXPDP初始化 2018-06-07 00:446470原创GoldenGate 作者: leo 本文链接:https://www.cndba ...

  6. 在 Oracle Linux 6.5 上安装 Oracle 11g 单实例数据库

    Checking the Hardware Requirements 系统必须满足下面最小的硬件要求 Memory Requirements Minimum: 1 GB of RAMRecommend ...

  7. VM虚拟机下在LINUX上安装ORACLE 11G单实例数据库

    1.环境及安装前规划:虚拟机及OS如下 环境:VMware Wordstation ACE版 6.0.2 操作系统:OracleLinux-R5-U8-Server-i386-dvd    3.2G ...

  8. Oracle 11g 单实例安装文档

    这里介绍在Red Hat Enterprise Linux Server release 5.7 (Tikanga)下安装ORACLE 11.2.0.1.0的过程,本文仅仅是为了写这样安装指导文档而整 ...

  9. Linux平台Oracle多个实例启动说明

    环境说明:oracle实例1的SID为orcl(为默认启动的实例),第二个实例的SID为orcl2 启动步骤:  1)启动数据库实例完成后,启动数据库监听服务 #lsnrctl   start 2)切 ...

随机推荐

  1. .NET跨平台之旅:将示例站点升级至 ASP.NET Core 1.1

    微软今天在 Connect(); // 2016 上发布了 .NET Core 1.1 ,ASP.NET Core 1.1 以及 Entity Framework Core 1.1.紧跟这次发布,我们 ...

  2. .NET Core中间件的注册和管道的构建(1)---- 注册和构建原理

    .NET Core中间件的注册和管道的构建(1)---- 注册和构建原理 0x00 问题的产生 管道是.NET Core中非常关键的一个概念,很多重要的组件都以中间件的形式存在,包括权限管理.会话管理 ...

  3. ASP.NET是如何在IIS下工作的

    ASP.NET与IIS是紧密联系的,由于IIS6.0与IIS7.0的工作方式的不同,导致ASP.NET的工作原理也发生了相应的变化. IIS6(IIS7的经典模式)与IIS7的集成模式的不同 IIS6 ...

  4. Sublime Text 3中文乱码解决方法以及安装包管理器方法

    一般出现乱码是因为文本采用了GBK编码格式,Sublime Text默认不支持GBK编码. 安装包管理器 简单安装 使用Ctrl+`快捷键或者通过View->Show Console菜单打开命令 ...

  5. 微信小程序体验(2):驴妈妈景区门票即买即游

    驴妈妈因为出色的运营能力,被腾讯选为首批小程序内测单位.驴妈妈的技术开发团队在很短的时间内完成了开发任务,并积极参与到张小龙团队的内测问题反馈.驴妈妈认为,移动互联网时代,微信是巨大的流量入口,也是旅 ...

  6. C#基础篇 - 正则表达式入门

    1.基本概念 正则表达式(Regular Expression)就是用事先定义好的一些特定字符(元字符)或普通字符.及这些字符的组合,组成一个“规则字符串”,这个“规则字符串”用来判断我们给定的字符串 ...

  7. 引人瞩目的 CSS 变量(CSS Variable)

    这是一个令人激动的革新. CSS 变量,顾名思义,也就是由网页的作者或用户定义的实体,用来指定文档中的特定变量. 更准确的说法,应该称之为 CSS 自定义属性 ,不过下文为了好理解都称之为 CSS 变 ...

  8. ASP.NET MVC开发:Web项目开发必备知识点

    最近加班加点完成一个Web项目,使用Asp.net MVC开发.很久以前接触的Asp.net开发还是Aspx形式,什么Razor引擎,什么MVC还是这次开发才明白,可以算是新手. 对新手而言,那进行A ...

  9. webapp应用--模拟电子书翻页效果

    前言: 现在移动互联网发展火热,手机上网的用户越来越多,甚至大有超过pc访问的趋势.所以,用web程序做出仿原生效果的移动应用,也变得越来越流行了.这种程序也就是我们常说的单页应用程序,它也有一个英文 ...

  10. 编写高质量代码:改善Java程序的151个建议(第8章:多线程和并发___建议126~128)

    建议126:适时选择不同的线程池来实现 Java的线程池实现从根本上来说只有两个:ThreadPoolExecutor类和ScheduledThreadPoolExecutor类,这两个类还是父子关系 ...