Oracle 11g Grid for Linux安装指南

1、创建oracle用户及用户组

groupadd oinstall 

groupadd dba

useradd -g oinstall -G dba -m oracle

设置oracle用户的口令:

passwd oracle

我这里设置为oracle

2、创建相关目录

mkdir -p /u01

chown -R oracle.oinstall /u01

3、修改oracle用户环境变量

su - oracle

vi .bash_profile

export PATH 

export ORACLE_SID=+ASM

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/grid

export PATH=$ORACLE_HOME/bin:$PATH

4、vi /etc/sysctl.conf

kernel.shmmax = 4046471168

kernel.shmmni = 4096

kernel.shmall = 2097152

kernel.sem = 250 32000 100 128

fs.file-max = 6815744

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

fs.aio-max-nr = 1048576

执行如下命令:使内核参数生效

sysctl -p

5、修改linux shell参数

vi /etc/security/limits.conf 

oracle soft nofile 65536

oracle hard nofile 65536

oracle soft nproc 16384

oracle hard nproc 16384

6、vim /etc/pam.d/login

sessionrequired pam_limits.so

7、共享目录(/mnt/hgfs)

[root@oel ~]# mount

/dev/mapper/vg_oel-lv_root on / type ext4 (rw)

proc on /proc type proc (rw)

sysfs on /sys type sysfs (rw)

devpts on /dev/pts type devpts (rw,gid=5,mode=620)

tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")

/dev/sda1 on /boot type ext4 (rw)

none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

.host:/ on /mnt/hgfs type vmhgfs (rw,ttl=1)

vmware-vmblock on /var/run/vmblock-fuse type fuse.vmware-vmblock (rw,nosuid,nodev,default_permissions,allow_other)

sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

8、创建8快 2G asm 存储

挂载镜像文件

mount  

fdisk -l  

[root@oel hgfs]# ll

total 4

drwxrwxrwx. 1 root root 4096 May  5 19:37 soft

[root@oel hgfs]# fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes

255 heads, 63 sectors/track, 3916 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00037ab3

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          64      512000   83  Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2              64        3917    30944256   8e  Linux LVM

Disk /dev/sdc: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

Disk /dev/sdd: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

Disk /dev/sdb: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

Disk /dev/sde: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

Disk /dev/sdf: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

Disk /dev/sdg: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

Disk /dev/sdh: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

Disk /dev/sdi: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

Disk /dev/mapper/vg_oel-lv_root: 23.3 GB, 23295164416 bytes

255 heads, 63 sectors/track, 2832 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

Disk /dev/mapper/vg_oel-lv_swap: 8388 MB, 8388608000 bytes

255 heads, 63 sectors/track, 1019 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

mkdir  /mnt/iso

mount -o loop /mnt/hgfs/soft/V17794-01/Enterprise-R5-U4-Server-x86_64-dvd.iso /mnt/iso

9、配置yum源

vim /etc/yum.repos.d/myoel.repo

[dvdinfo]

name=myoel

baseurl=file:///mnt/iso/Server

enabled=1

gpgcheck=0

yum makecache

10、对磁盘进行逻辑卷划分

fdisk /dev/sdb 

n p 1  回车 回车   w保存退出

fdisk /dev/sdc

fdisk /dev/sdd

fdisk /dev/sde

fdisk /dev/sdf

fdisk /dev/sdg

fdisk /dev/sdh

fdisk /dev/sdi

配置udev生成裸设备

vim /etc/udev/rules.d/60-raw.rules

ACTION=="add",KERNEL=="sdb1",RUN+="/bin/raw /dev/raw/raw1 %N"

ACTION=="add",KERNEL=="sdc1",RUN+="/bin/raw /dev/raw/raw2 %N"

ACTION=="add",KERNEL=="sdd1",RUN+="/bin/raw /dev/raw/raw3 %N"

ACTION=="add",KERNEL=="sde1",RUN+="/bin/raw /dev/raw/raw4 %N"

ACTION=="add",KERNEL=="sdf1",RUN+="/bin/raw /dev/raw/raw5 %N"

ACTION=="add",KERNEL=="sdg1",RUN+="/bin/raw /dev/raw/raw6 %N"

ACTION=="add",KERNEL=="sdh1",RUN+="/bin/raw /dev/raw/raw7 %N"

ACTION=="add",KERNEL=="sdi1",RUN+="/bin/raw /dev/raw/raw8 %N"

KERNEL=="raw[1]",MODE="0660",GROUP="oinstall",OWNER="oracle"

KERNEL=="raw[2]",MODE="0660",GROUP="oinstall",OWNER="oracle"

KERNEL=="raw[3]",MODE="0660",GROUP="oinstall",OWNER="oracle"

KERNEL=="raw[4]",MODE="0660",GROUP="oinstall",OWNER="oracle"

KERNEL=="raw[5]",MODE="0660",GROUP="oinstall",OWNER="oracle"

KERNEL=="raw[6]",MODE="0660",GROUP="oinstall",OWNER="oracle"

KERNEL=="raw[7]",MODE="0660",GROUP="oinstall",OWNER="oracle"

KERNEL=="raw[8]",MODE="0660",GROUP="oinstall",OWNER="oracle"

启动udev服务

start_udev

查看裸设备

raw -qa

[root@oel ~]# raw -qa

/dev/raw/raw1:bound to major 8, minor 17

/dev/raw/raw2:bound to major 8, minor 33

/dev/raw/raw3:bound to major 8, minor 49

/dev/raw/raw4:bound to major 8, minor 65

/dev/raw/raw5:bound to major 8, minor 81

/dev/raw/raw6:bound to major 8, minor 97

/dev/raw/raw7:bound to major 8, minor 113

/dev/raw/raw8:bound to major 8, minor 129

11、解压缩Grid安装介质

root

xhost +

mkdir -p  /u01/app/oracle/product/11.2.0/grid

mkdir -p /u01/app/oracle

su - oracle

./runInstaller

安装如下:

第一步:

第二步:

第三步:

第四步:

第五步:

第六步:

第7步:

第八步:

第9步:

用root用户执行2个脚本

/u01/app/oraInventory/orainstRoot.sh

/u01/app/oracle/product/11.2.0/grid/root.sh

安装完成后

查看ASM进程

crs_stat -t 

安装完成了!

猜你喜欢

转载自www.linuxidc.com/Linux/2017-05/143518.htm
今日推荐