1 描述
OEL7.2x8664版本上静默安装12.2.0.1.0 grid infrastrure for a standalone server,asm磁盘使用lvm和磁盘分区形式.
尝试在vmware fusion环境中使用scsi_id显示磁盘的uuid,但失败。因此udev映射磁盘部分由udevadm命令替代。
12.2.0.1版本的grid安装文件名linuxx64_12201_grid_home.zip 将此文件直接解压到grid用户的$ORACLE_HOME下即可。
2 操作环境
2.1 OS info
OEL7U2 x8664
3 过程设计
创建用户与组
配置用户环境变量
创建目录结构
配置磁盘
静默安装
4 详细步骤操作
4.1 创建用户与组
# groupadd -g 54321 oinstall
# groupadd -g 54322 dba
# groupadd -g 54323 oper
# groupadd -g 54324 backupdba
# groupadd -g 54325 dgdba
# groupadd -g 54326 kmdba
# groupadd -g 54327 asmdba
# groupadd -g 54328 asmoper
# groupadd -g 54329 asmadmin
# groupadd -g 54330 racdba
# useradd -u 54320 -g oinstall -G asmadmin,asmdba grid
4.2 配置用户环境变量
[grid@localhost Nover:(NoDb) ~ ] $ cat ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/local/bin:$HOME/bin
export PATH
export PATH_BASIC=${PATH}
export ORACLE_BASE=/u01/app/grid
export ORACLE_VERSION=Nover
export ORACLE_SID=NoDb
export LD_LIBRARY_PATH=/usr/lib:/usr/dt/lib:/usr/openwin/lib:/usr/ccs/lib
export LD_LIBRARY_PATH_BASIC=/usr/lib:/usr/dt/lib:/usr/openwin/lib:/usr/ccs/lib
export PS1='[\u@\h ${ORACLE_VERSION}:($ORACLE_SID) \W ] \$ '
alias env12.2.0.1.0='. ${HOME}/local/bin/env12.2.0.1.0'
alias ora_+asm='. ${HOME}/local/bin/ora_+asm'
[grid@localhost Nover:(NoDb) ~ ] $
[grid@localhost Nover:(NoDb) ~ ] $ cat ${HOME}/local/bin/env12.2.0.1.0
#!/bin/sh
set -a
#
#Setting up environment for Oracle 12.2.0.1.0
#
ORACLE_VERSION=12.2.0.1.0
ORACLE_HOME=${ORACLE_BASE}/product/${ORACLE_VERSION}
TNS_ADMIN=${ORACLE_BASE}/admin/network
NLS_DATE_FORMAT='DD-MON-YYYY HH24:MI:SS'
NLS_LANG=AMERICAN_AMERICA.AL32UTF8
LD_LIBRARY_PATH=${LD_LIBRARY_PATH_BASIC}:${ORACLE_HOME}/lib
PATH=${PATH_BASIC}:${ORACLE_HOME}/bin:${ORACLE_BASE}/local/bin:${ORACLE_HOME}/OPatch
set +a
[grid@localhost Nover:(NoDb) ~ ] $ cat ${HOME}/local/bin/ora_+asm
#!/bin/sh
#
# Set Oracle home enviroment
#
. ${HOME}/local/bin/env12.2.0.1.0
set -a
#
# Define location of Oracle files.
#
ORA_NLS33=${ORACLE_HOME}/nls/data
TNS_ADMIN=${ORACLE_BASE}/admin/network
PATH=$ORACLE_HOME/bin:$HOME/bin:$ORACLE_BASE/bin:$PATH
SHLIB_PATH=$ORACLE_HOME/lib32:$ORACLE_HOME/rdbms/lib32
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:$ORACLE_HOME/rdbms/lib
#
#
# Set database and instance name.
# Is placed here because of cronjobs.
#
DBNAME=+ASM
ORACLE_SID=${DBNAME}
#
# Mics.
#
ORACLE_TERM=vt220
NLS_LANG=AMERICAN_AMERICA.AL32UTF8
NLS_DATE_FORMAT='DD-MON-YYYY HH24:MI:SS'
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
set +a
[grid@localhost Nover:(NoDb) ~ ] $
4.3 创建目录结构
# mkdir -p /u01/app/grid
# chown grid:oinstall /u01
# chown -R grid:oinstall /u01/app/grid
# chmod -R 775 /u01/
4.4 配置磁盘
本系统另分两块50GB的磁盘sdc和sdd,分区大小如下,其中sdc2将被lvm使用,由udev分配至asm group,sdd1直接由udev管理分配至asm group.
[root@localhost ~]# fdisk -l /dev/sdc /dev/sdd
Disk /dev/sdc: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x715f22ee
Device Boot Start End Blocks Id System
/dev/sdc1 2048 31459327 15728640 83 Linux
/dev/sdc2 31459328 62916607 15728640 83 Linux
/dev/sdc3 62916608 104857599 20970496 83 Linux
Disk /dev/sdd: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xe4574e0f
Device Boot Start End Blocks Id System
/dev/sdd1 2048 20973567 10485760 83 Linux
/dev/sdd2 20973568 41945087 10485760 83 Linux
/dev/sdd3 41945088 62916607 10485760 83 Linux
/dev/sdd4 62916608 104857599 20970496 5 Extended
[root@localhost ~]#
创建LVM
[root@localhost ~]# pvcreate /dev/sdc2
Physical volume "/dev/sdc2" successfully created
[root@localhost ~]# vgcreate asmvg /dev/sdc2
Volume group "asmvg" successfully created
[root@localhost ~]# lvcreate -L 5G -n asmlv1 asmvg
Logical volume "asmlv1" created.
[root@localhost ~]# lvdisplay /dev/asmvg/asmlv1
--- Logical volume ---
LV Path /dev/asmvg/asmlv1
LV Name asmlv1
VG Name asmvg
LV UUID Hga6nq-QUkZ-u19t-Clhi-rzSL-0ZYm-UnHpLX
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2017-04-09 12:06:54 +0800
LV Status available
# open 0
LV Size 5.00 GiB
Current LE 1280
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 252:4
[root@localhost ~]#
[root@localhost ~]# udevadm info --query=all --name=/dev/asmvg/asmlv1 |grep -i dm_uuid
E: DM_UUID=LVM-T3LKONAceqx7H0CNNi70pzPRQ7sysl2NHga6nqQUkZu19tClhirzSL0ZYmUnHpLX
[root@localhost ~]# udevadm info --query=all --name=/dev/asmvg/asmlv1 |grep -i dm_uuid
E: DM_UUID=LVM-T3LKONAceqx7H0CNNi70pzPRQ7sysl2NHga6nqQUkZu19tClhirzSL0ZYmUnHpLX
[root@localhost ~]# vi /etc/udev/rules.d/99-oracle-asmdevices.rules
[root@localhost ~]# cat /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="dm-*",ENV{DM_UUID}=="LVM-T3LKONAceqx7H0CNNi70pzPRQ7sysl2NHga6nqQUkZu19tClhirzSL0ZYmUnHpLX",SYMLINK+="asmlv1",OWNER="grid",GROUP="asmadmin",MODE="0660"
[root@localhost ~]#
[root@localhost ~]# udevadm control --reload-rules
[root@localhost ~]# udevadm trigger
[root@localhost ~]# ls -l /dev/asmlv1
lrwxrwxrwx 1 root root 4 Apr 9 12:46 /dev/asmlv1 -> dm-4
[root@localhost ~]# ls -l /dev/dm-4
brw-rw---- 1 grid asmadmin 252, 4 Apr 9 12:46 /dev/dm-4
[root@localhost ~]#
[root@localhost ~]# udevadm info /dev/sdd1
P: /devices/pci0000:00/0000:00:10.0/host2/target2:0:3/2:0:3:0/block/sdd/sdd1
N: sdd1
S: asmdisk1
S: disk/by-path/pci-0000:00:10.0-scsi-0:0:3:0-part1
E: DEVLINKS=/dev/asmdisk1 /dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:3:0-part1
E: DEVNAME=/dev/sdd1
E: DEVPATH=/devices/pci0000:00/0000:00:10.0/host2/target2:0:3/2:0:3:0/block/sdd/sdd1
E: DEVTYPE=partition
E: ID_BUS=scsi
E: ID_MODEL=VMware_Virtual_S
E: ID_MODEL_ENC=VMware\x20Virtual\x20S
E: ID_PART_ENTRY_DISK=8:48
E: ID_PART_ENTRY_NUMBER=1
E: ID_PART_ENTRY_OFFSET=2048
E: ID_PART_ENTRY_SCHEME=dos
E: ID_PART_ENTRY_SIZE=20971520
E: ID_PART_ENTRY_TYPE=0x83
E: ID_PART_TABLE_TYPE=dos
E: ID_PATH=pci-0000:00:10.0-scsi-0:0:3:0
E: ID_PATH_TAG=pci-0000_00_10_0-scsi-0_0_3_0
E: ID_REVISION=1.0
E: ID_SCSI=1
E: ID_TYPE=disk
E: ID_VENDOR=VMware_
E: ID_VENDOR_ENC=VMware\x2c\x20
E: MAJOR=8
E: MINOR=49
E: SUBSYSTEM=block
E: TAGS=:systemd:
E: USEC_INITIALIZED=296094
[root@localhost ~]# cat /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="dm-*",ENV{DM_UUID}=="LVM-T3LKONAceqx7H0CNNi70pzPRQ7sysl2NHga6nqQUkZu19tClhirzSL0ZYmUnHpLX",SYMLINK+="asmlv1",OWNER="grid",GROUP="asmadmin",MODE="0660"
####KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode",RESULT=="1IET_00020002", RUN+="/bin/sh -c 'mknod /dev/asmdisk01p1 b $major $minor; chown grid:dba /dev/asmdisk01p1; chmod 0660 /dev/asmdisk01p1'"
####KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id",RESULT=="14f70656e66696c00000000", OWNER="grid", GROUP="asmadmin", MODE="0660"
####KERNEL=="sdc1", SUBSYSTEM=="block", SYSFS{size}=="16771797", SYSFS{start}=="63", NAME="asmdisk1-crs", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sdd1", ENV{DEVPATH}=="/devices/pci0000:00/0000:00:10.0/host2/target2:0:3/2:0:3:0/block/sdd/sdd1",SUBSYSTEM=="block", SYMLINK+="asmdisk1", OWNER="grid", GROUP="asmadmin", MODE="0660"
[root@localhost ~]#
[root@localhost ~]# udevadm control --reload-rules
[root@localhost ~]# udevadm trigger
[root@localhost ~]# ls -l /dev/asm*
lrwxrwxrwx 1 root root 4 Apr 9 14:11 /dev/asmdisk1 -> sdd1
lrwxrwxrwx 1 root root 4 Apr 9 14:11 /dev/asmlv1 -> dm-4
/dev/asmvg:
total 0
lrwxrwxrwx 1 root root 7 Apr 9 14:11 asmlv1 -> ../dm-4
[root@localhost ~]# ls -l /dev/sdd1
brw-rw---- 1 grid asmadmin 8, 49 Apr 9 14:11 /dev/sdd1
[root@localhost ~]#
4.5 静默安装
12.2.0.1版本的grid安装文件名linuxx64_12201_grid_home.zip 将此文件直接解压到grid用户的$ORACLE_HOME下即可。
[grid@localhost 12.2.0.1.0:(NoDb) ~ ] $ echo $ORACLE_HOME
/u01/app/grid/product/12.2.0.1.0
[grid@localhost 12.2.0.1.0:(NoDb) ~ ] $ mkdir -p $ORACLE_HOME
[grid@localhost 12.2.0.1.0:(NoDb) ~ ] $ cd $ORACLE_HOME
[grid@localhost 12.2.0.1.0:(NoDb) 12.2.0.1.0 ] $
[grid@localhost 12.2.0.1.0:(NoDb) 12.2.0.1.0 ] $ ./gridSetup.sh --help
ERROR: Unable to verify the graphical display setup. This application requires X display. Make sure that xdpyinfo exist under PATH variable.
[INS-04003] Invalid argument passed from command line. Specified argument ([--help]) is not a supported argument for this application.
Usage: gridSetup.sh [<flag>] [<option>]
Following are the possible flags:
-help - display help.
-silent - run in silent mode. The inputs can be a response file or a list of command line variable value pairs.
[-lenientInstallMode - perform the best effort installation by automatically ignoring invalid data in input parameters.]
[-ignorePrereqFailure - ignore all prerequisite checks failures.]
-responseFile - specify the complete path of the response file to use.
-logLevel - enable the log of messages up to the priority level provided in this argument. Valid options are: severe, warning, info, config, fine, finer, finest.
-executePrereqs | -executeConfigTools | -createGoldImage | -switchGridHome
-executePrereqs - execute the prerequisite checks only.
-executeConfigTools - execute the config tools for an installed home.
-responseFile - specify the complete path of the response file to use.
[-all - execute all the config tools for an installed home, including the config tools that have already succeeded.]
[-skipStackCheck - skip the stack status check.]
-createGoldImage - create a gold image from the current Oracle home.
-destinationLocation - specify the complete path to where the created gold image will be located.
[-exclFiles - specify the complete paths to the files to be excluded from the new gold image.]
-switchGridHome - change the Oracle Grid Infrastructure home path.
-debug - run in debug mode.
-printdiskusage - log the debug information for the disk usage.
-printmemory - log the debug information for the memory usage.
-printtime - log the debug information for the time usage.
-waitForCompletion - wait for the completion of the installation, instead of spawning the installer and returning the console prompt.
-noconfig - do not execute the config tools.
-noconsole - suppress the display of messages in the console. The console is not allocated.
-skipPrereqs - skip the prerequisite checks.
-ignoreInternalDriverError - ignore any internal driver errors.
-noCopy - add a new node to the existing configuration without copying the software on to the specified nodes.
-version - get the product version.
[grid@localhost 12.2.0.1.0:(NoDb) 12.2.0.1.0 ] $
----此版本静默安装过程中netca部分有出错。 不同于图形可以重试。 使用脚本无重试部分。 待解决。 此内容使用UI创建无问题。
5 个人总结
----此版本静默安装过程中netca部分有出错。 不同于图形可以重试。 使用脚本无重试部分。 待解决。 此内容使用UI创建无问题。
6 资料参考引用
http://docs.oracle.com/database/122/CWLIN/toc.htm
http://blog.csdn.net/seteor/article/details/6708025
http://blog.itpub.net/31381589/viewspace-2123737/
http://docs.oracle.com/cd/E11882_01/install.112/e41961/storage.htm#CWLIN303
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11780477/viewspace-2137485/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/11780477/viewspace-2137485/