单机静默安装GI软件并创建ASM实例和ASM磁盘组
环境:RHEL 6.4 + Oracle 11.2.0.4
需求:单机静默安装GI软件并创建ASM实例和ASM磁盘组,为后续迁移数据库文件到ASM做准备
1. 安装配置GI软件
## 1.1 创建grid用户和相关组,创建目录,确认ASM磁盘权限,配置环境变量 ##
```
-- 创建grid用户和相关组
groupadd asmadmin
groupadd asmdba
groupadd asmoper
useradd -g oinstall -G dba,asmadmin,asmdba,asmoper grid
usermod -g oinstall -G dba,asmadmin,asmdba oracle
passwd grid
-- 创建目录
mkdir -p /u02/app/11.2.0/grid
mkdir -p /u02/app/grid
-- 赋予目录权限
chmod 775 /u02/app
chown -R grid:oinstall /u02/app/11.2.0
chown -R grid:oinstall /u02/app/grid
-- ASM磁盘
$ ls -lh /dev/mapper/ora_vg-lv_asm*
lrwxrwxrwx. 1 root root 7 Dec 1 13:13 /dev/mapper/ora_vg-lv_asm1 -> ../dm-2
lrwxrwxrwx. 1 root root 7 Dec 1 13:14 /dev/mapper/ora_vg-lv_asm2 -> ../dm-3
lrwxrwxrwx. 1 root root 7 Dec 1 13:14 /dev/mapper/ora_vg-lv_asm3 -> ../dm-4
lrwxrwxrwx. 1 root root 7 Dec 1 13:14 /dev/mapper/ora_vg-lv_asm4 -> ../dm-5
lrwxrwxrwx. 1 root root 7 Dec 1 13:14 /dev/mapper/ora_vg-lv_asm5 -> ../dm-6
lrwxrwxrwx. 1 root root 7 Dec 1 13:15 /dev/mapper/ora_vg-lv_asm6 -> ../dm-7
-- 赋权并将赋权操作添加到/etc/rc.local文件中
chown grid:asmadmin /dev/mapper/ora_vg-lv_asm*
-- grid环境变量
export ORACLE_BASE=/u02/app/grid
export ORACLE_HOME=/u02/app/11.2.0/grid
export ORACLE_SID=+ASM
export PATH=$ORACLE_HOME/bin:$PATH
```
注意:生产环境一般用udev绑定新盘,我这里由于是Citrix虚拟化实验环境,用每个lv模拟了一个磁盘。划lv盘过程可参考《[Linux平台oracle 11g单实例 + ASM存储 安装部署 快速参考](http://www.cnblogs.com/jyzhao/p/4332410.html)》相关内容。
## 1.2 解压安装包 ##
```
# chmod 775 /u02/soft/
$ unzip /u02/media/p13390677_112040_Linux-x86-64_3of7.zip -d /u02/soft/
```
## 1.3 静默安装GI ##
```
$ cd /u02/soft/grid/response
$ cp grid_install.rsp grid_install.rsp.bak
$ sed -i 's/^#.*$//g' *.rsp
$ sed -i '/^$/d' *.rsp
```
$ more grid_install.rsp
```
oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v11_2_0
ORACLE_HOSTNAME=JY-DB01
INVENTORY_LOCATION=/u02/app/oraInventory
SELECTED_LANGUAGES=en
oracle.install.option=HA_CONFIG
ORACLE_BASE=/u02/app/grid
ORACLE_HOME=/u02/app/11.2.0/grid
oracle.install.asm.OSDBA=asmdba
oracle.install.asm.OSOPER=asmoper
oracle.install.asm.OSASM=asmadmin
oracle.install.crs.config.gpnp.scanName=
oracle.install.crs.config.gpnp.scanPort=
oracle.install.crs.config.clusterName=
oracle.install.crs.config.gpnp.configureGNS=false
oracle.install.crs.config.gpnp.gnsSubDomain=
oracle.install.crs.config.gpnp.gnsVIPAddress=
oracle.install.crs.config.autoConfigureClusterNodeVIP=
oracle.install.crs.config.clusterNodes=
oracle.install.crs.config.networkInterfaceList=
oracle.install.crs.config.storageOption=ASM_STORAGE
oracle.install.crs.config.sharedFileSystemStorage.diskDriveMapping=
oracle.install.crs.config.sharedFileSystemStorage.votingDiskLocations=
oracle.install.crs.config.sharedFileSystemStorage.votingDiskRedundancy=NORMAL
oracle.install.crs.config.sharedFileSystemStorage.ocrLocations=
oracle.install.crs.config.sharedFileSystemStorage.ocrRedundancy=NORMAL
oracle.install.crs.config.useIPMI=false
oracle.install.crs.config.ipmi.bmcUsername=
oracle.install.crs.config.ipmi.bmcPassword=
oracle.install.asm.SYSASMPassword=oracle
oracle.install.asm.diskGroup.name=data1
oracle.install.asm.diskGroup.redundancy=NORMAL
oracle.install.asm.diskGroup.AUSize=1
oracle.install.asm.diskGroup.disks=/dev/mapper/ora_vg-lv_asm1,/dev/mapper/ora_vg-lv_asm2
oracle.install.asm.diskGroup.diskDiscoveryString=/dev/mapper/ora*
oracle.install.asm.monitorPassword=oracle
oracle.install.crs.upgrade.clusterNodes=
oracle.install.asm.upgradeASM=false
oracle.installer.autoupdates.option=
oracle.installer.autoupdates.downloadUpdatesLoc=
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
PROXY_REALM=
```
### 1.3.1 静默安装 ###
```
./runInstaller -responseFile /u02/soft/grid/response/grid_install.rsp -silent -ignorePrereq -showProgress
```
过程如下:
```
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 20827 MB Passed
Checking swap space: must be greater than 150 MB. Actual 4015 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-12-01_03-47-21PM. Please wait ...[grid@JY-DB01 grid]$ [WARNING] [INS-30011] The SYS password entered does not conform to the Oracle recommended standards.
CAUSE: Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
ACTION: Provide a password that conforms to the Oracle recommended standards.
[WARNING] [INS-30011] The ASMSNMP password entered does not conform to the Oracle recommended standards.
CAUSE: Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
ACTION: Provide a password that conforms to the Oracle recommended standards.
[WARNING] [INS-32018] The selected Oracle home is outside of Oracle base.
CAUSE: The Oracle home selected was outside of Oracle base.
ACTION: Oracle recommends installing Oracle software within the Oracle base directory. Adjust the Oracle home or Oracle base accordingly.
You can find the log of this install session at:
/u01/app/oraInventory/logs/installActions2015-12-01_03-47-21PM.log
Prepare in progress.
.................................................. 9% Done.
Prepare successful.
Copy files in progress.
.................................................. 14% Done.
.................................................. 21% Done.
.................................................. 26% Done.
.................................................. 31% Done.
.................................................. 36% Done.
.................................................. 42% Done.
.................................................. 50% Done.
.................................................. 56% Done.
.................................................. 61% Done.
.................................................. 66% Done.
.................................................. 71% Done.
........................................
Copy files successful.
Link binaries in progress.
..........
Link binaries successful.
..........
Setup files in progress.
.................................................. 76% Done.
.................................................. 89% Done.
Setup files successful.
The installation of Oracle Grid Infrastructure 11g was successful.
Please check '/u01/app/oraInventory/logs/silentInstall2015-12-01_03-47-21PM.log' for more details.
.................................................. 94% Done.
Execute Root Scripts in progress.
As a root user, execute the following script(s):
1. /u02/app/11.2.0/grid/root.sh
.................................................. 100% Done.
Execute Root Scripts successful.
As install user, execute the following script to complete the configuration.
1. /u02/app/11.2.0/grid/cfgtoollogs/configToolAllCommands RESPONSE_FILE=<response_file>
Note:
1. This script must be run on the same host from where installer was run.
2. This script needs a small password properties file for configuration assistants that require passwords (refer to install guide documentation).
Successfully Setup Software.
按提示执行脚本
-- root用户执行root.sh
/u02/app/11.2.0/grid/root.sh
Check /u02/app/11.2.0/grid/install/root_JY-DB01_2015-12-01_15-54-30.log for the output of root script
-- 启动资源
$ crsctl start resource -all
-- 检查has,css,evm都是online
crsctl check has
crsctl check css
crsctl check evm
-- 创建密码文件
$ cd $ORACLE_HOME/dbs
$ orapwd file=orapw+ASM password=oracle entries=10 ignorecase=y
-- grid用户执行配置
$ /u02/app/11.2.0/grid/cfgtoollogs/configToolAllCommands RESPONSE_FILE=/u02/soft/grid/response/grid_install.rsp
注意:如果执行root.sh的脚本日志中遇到libcap.so.1找不到的错误可参考《[Oracle 11g安装GI后,运行roothas.pl脚本报错libcap.so.1找不到](http://www.cnblogs.com/jyzhao/p/3855555.html)》解决。
<h1 id="2">2. 创建ASM实例</h1>
-- ASM实例参数文件
INSTANCE_TYPE=ASM
DB_UNIQUE_NAME=+ASM
ASM_POWER_LIMIT=1
ASM_DISKSTRING=/dev/mapper/ora*
ASM_DISKGROUPS=data1
LARGE_POOL_SIZE=16M
-- 启动到nomount
SQL> startup nomount pfile='$ORACLE_HOME/dbs/init+ASM.ora'
ASM instance started
Total System Global Area 1135747072 bytes
Fixed Size 2260728 bytes
Variable Size 1108320520 bytes
ASM Cache 25165824 bytes
<h1 id="3">3. 创建ASM磁盘组DATA1</h1>
## 3.1 查询可用ASM磁盘 ##
--查询v$asm_disk
set linesize 200
col path for a50
select GROUP_NUMBER, DISK_NUMBER, MOUNT_STATUS, NAME, FAILGROUP, CREATE_DATE, PATH from v$asm_disk;
--结果如下:
GROUP_NUMBER DISK_NUMBER MOUNT_S NAME FAILGROUP CREATE_DA PATH
0 0 CLOSED /dev/mapper/ora_vg-lv_asm6
0 1 CLOSED /dev/mapper/ora_vg-lv_asm5
0 5 CLOSED /dev/mapper/ora_vg-lv_asm1
0 3 CLOSED /dev/mapper/ora_vg-lv_asm3
0 4 CLOSED /dev/mapper/ora_vg-lv_asm2
0 2 CLOSED /dev/mapper/ora_vg-lv_asm4
6 rows selected.
-- 查询v$asm_diskgroup
select GROUP_NUMBER, NAME, TYPE, TOTAL_MB, FREE_MB, USABLE_FILE_MB from v$asm_diskgroup;
## 3.2 创建磁盘组 ##
创建ASM磁盘组data1,普通冗余,指定2个故障组。
create diskgroup data1 normal redundancy
failgroup fg1 disk '/dev/mapper/ora_vg-lv_asm1' name d1a
failgroup fg2 disk '/dev/mapper/ora_vg-lv_asm2' name d1b;
执行过程输出信息:
SQL> create diskgroup data1 normal redundancy
2 failgroup fg1 disk '/dev/mapper/ora_vg-lv_asm1' name d1a
3 failgroup fg2 disk '/dev/mapper/ora_vg-lv_asm2' name d1b;
Diskgroup created.
SQL> select GROUP_NUMBER, DISK_NUMBER, MOUNT_STATUS, NAME, FAILGROUP, CREATE_DATE, PATH from v$asm_disk;
GROUP_NUMBER DISK_NUMBER MOUNT_S NAME FAILGROUP CREATE_DA PATH
0 0 CLOSED /dev/mapper/ora_vg-lv_asm6
0 1 CLOSED /dev/mapper/ora_vg-lv_asm5
0 2 CLOSED /dev/mapper/ora_vg-lv_asm4
0 3 CLOSED /dev/mapper/ora_vg-lv_asm3
1 1 CACHED D1B FG2 02-DEC-15 /dev/mapper/ora_vg-lv_asm2
1 0 CACHED D1A FG1 02-DEC-15 /dev/mapper/ora_vg-lv_asm1
6 rows selected.
SQL> select GROUP_NUMBER, NAME, TYPE, TOTAL_MB, FREE_MB, USABLE_FILE_MB from v$asm_diskgroup;
GROUP_NUMBER NAME TYPE TOTAL_MB FREE_MB USABLE_FILE_MB
1 DATA1 NORMAL 10240 10138 5069
## 3.3 注册磁盘组到crsctl中 ##
### 3.3.1 添加asm服务 ###
[grid@JY-DB01 ~]$ srvctl add asm
[grid@JY-DB01 ~]$ crsctl stat res -t
NAME TARGET STATE SERVER STATE_DETAILS
Local Resources
ora.LISTENER.lsnr
ONLINE ONLINE jy-db01
ora.asm
OFFLINE OFFLINE jy-db01
ora.ons
OFFLINE OFFLINE jy-db01
Cluster Resources
ora.cssd
1 ONLINE ONLINE jy-db01
ora.diskmon
1 OFFLINE OFFLINE
ora.evmd
1 ONLINE ONLINE jy-db01
### 3.3.2 创建spfile,重启ASM实例 ###
SQL> create spfile from pfile;
File created.
SQL> shutdown immediate;
ASM diskgroups volume disabled
ASM diskgroups dismounted
ASM instance shutdown
SQL> startup
ASM instance started
Total System Global Area 1135747072 bytes
Fixed Size 2260728 bytes
Variable Size 1108320520 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
ASM diskgroups volume enabled
SQL> show parameter pfile
NAME TYPE VALUE
spfile string /u02/app/11.2.0/grid/dbs/spfil
e+ASM.ora
### 3.3.3 查看资源,DATA1磁盘组已经自动注册 ###
$ crsctl stat res -t
NAME TARGET STATE SERVER STATE_DETAILS
Local Resources
ora.DATA1.dg
ONLINE ONLINE jy-db01
ora.LISTENER.lsnr
ONLINE ONLINE jy-db01
ora.asm
ONLINE ONLINE jy-db01 Started
ora.ons
OFFLINE OFFLINE jy-db01
Cluster Resources
ora.cssd
1 ONLINE ONLINE jy-db01
ora.diskmon
1 OFFLINE OFFLINE
ora.evmd
1 ONLINE ONLINE jy-db01
单机静默安装GI软件并创建ASM实例和ASM磁盘组的更多相关文章
- CentOS7.9静默安装Oracle19C软件
CentOS7.9静默安装Oracle19C软件 Oracle发布了支持的版本.可以看到了Oracle11gR2和Oracle12C.一直到2022年就不支持patch和服务.(感慨Oracle 11 ...
- 创建ASM实例及ASM数据库
--======================== -- 创建ASM实例及ASM数据库 --======================== 一.ASM相关概念 1.什么是ASM(Auto Stor ...
- 创建ASM实例及ASM数据库(转载)
--======================== -- 创建ASM实例及ASM数据库 --======================== 一.ASM相关概念 1.什么是ASM(Auto Stor ...
- oracle11g ASM(修复损坏的磁盘组头asm修复2)
--编KFED [oracle@rac2 lib]$cd $ORACLE_HOME/rdbms/lib [oracle@rac2 lib]$ pwd /u01/app/oracle/product/1 ...
- [置顶] Oracle 11g R2 ASM:了解 Oracle ASM 基本概念
About Oracle ASM Instances About Oracle ASM Disk Groups About Mirroring and Failure Groups About Ora ...
- Oracle ASM 磁盘组基础知识整理(收藏版)
转至:https://cloud.tencent.com/developer/article/1494403 为什么要写这么一篇基础知识呢?还是有那么一点点原因的,不是胡编乱造还真是有真实存在的事件的 ...
- Windows软件静默安装
Install Software in A Slient Way 一般来说,不同的软件的封装类型都有固定的静默安装命令. 查看软件的封装类型 双击setup.exe,在弹出窗口的左上角单击,选择&qu ...
- RHEL7.5 静默安装(silent mode)oracle11gr2数据库软件
如果没有图形界面多可怕,或者图形界面安装总报些奇怪的错误多可怕,静默安装数据库软件了解一下 修改主机名.关闭selinux [root@localhost ~]$ sed -i '3,$d' /etc ...
- Oracle 12c RAC 静默安装文档
参考文档: https://docs.oracle.com/en/database/oracle/oracle-database/12.2/cwlin/index.html https://docs. ...
随机推荐
- 几个比较”有意思“的JS脚本
1.获取内网和公网真实IP地址(引用地址) <!DOCTYPE html> <html> <head> <meta http-equiv="Cont ...
- Android之常见问题集锦Ⅱ
Android问题集锦Ⅰ:http://www.cnblogs.com/AndroidJotting/p/4608025.html EditText输入内容改变事件监听 _edit.addTextCh ...
- html5 与视频
1.视频支持格式. 有3种视频格式被浏览器广泛支持:.ogg,.mp4,.webm. Theora+Vorbis=.ogg (Theora:视频编码器,Vorbis:音频编码器) H.264+$$$ ...
- C++随笔:.NET CoreCLR之corleCLR核心探索之coreconsole(2)
这篇文章是上篇的续集,本文将会继续介绍coreconsole.cpp里面的逻辑.也许大家会看一些CLR的书,我承认我没有看过,因为我觉得一个人,他再NB,那也是他自己的眼光,而且说句难听的,CLR也不 ...
- 用FSM一键制作逐帧动画雪碧图 Vue2 + webpack
因为工作需要要将五六十张逐帧图拼成雪碧图,网上想找到一件制作工具半天没有找到,就自己用canvas写了一个. 写成之后就再没有什么机会使用了,因此希望有人使用的时候如果遇到bug了能及时反馈给我. 最 ...
- [原]HAproxy 代理技术原理探究
HAproxy 技术分享 简介 HAProxy是一款提供高可用性.负载均衡以及基于TCP(第四层)和HTTP(第七层)应用的代理软件 Features 1.免费 2.能够做到4层以上代理 3.高性能 ...
- C++ 事件驱动型银行排队模拟
最近重拾之前半途而废的C++,恰好看到了<C++ 实现银行排队服务模拟>,但是没有实验楼的会员,看不到具体的实现,正好用来作为练习. 模拟的是银行的排队叫号系统,所有顾客以先来后到的顺序在 ...
- EC笔记:第4部分:21、必须返回对象时,别返回引用
使用应用可以大幅减少构造函数与析构函数的调用次数,但是引用不可以滥用. 如下: struct St { int a; }; St &func(){ St t; return t; } 在返回t ...
- 用django创建一个项目
首先你得安装好python和django,然后配置好环境变量,安装python就不说了,从配置环境变量开始 1.配置环境变量 在我的电脑处点击右键,或者打开 控制面板\系统和安全\系统 -> 左 ...
- IteratorPattern(迭代子模式)
/** * 迭代子模式 * @author TMAC-J * 聚合:某一类对象的集合 * 迭代:行为方式,用来处理聚合 * 是一种行为模式,用于将聚合本身和操作聚合的行为分离 * Java中的COLL ...