OracleLinux6.4+OracleRAC11.2.0.3安装文档

更新时间:2023-04-27 13:03:01 阅读量: 实用文档 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

环境说明

操作系统:OracleLinux6.4 X86_64位

Oracle版本:11.2.0.3

挂载linux安装操作系统镜像

挂载linux安装文件到/mnt下

[root@localhost ~]# mount /opt/soft/Oracle Linux_V37084-01_Oracle_6.4X64.iso /mnt -0 loop 检查挂载

[root@localhost ~]# df -h

文件系统容量已用可用已用%% 挂载点

/dev/mapper/VolGroup-lv_root

22G 6.7G 14G 34% /

tmpfs 4.0G 176K 4.0G 1% /dev/shm

/dev/sda1 485M 55M 405M 12% /boot

/opt/soft/Oracle Linux_V37084-01_Oracle_6.4X64.iso

3.5G 3.5G 0 100% /mnt

配置yum

修改yum配置文件

[root@localhost ~]# cat /etc/yum.repos.d/public-yum-ol6.repo

[oracle]

name=Unbreakable Enterprise Kernel for Oracle Linux $releasever ($basearch)

baseurl=file:/mnt

gpgcheck=0

enabled=1

清除yum原有文件列表

[root@localhost ~]#yum clean

重新生成yum文件列表

[root@localhost ~]#yum list

安装VNCserver

安装VNC

[root@localhost ~]#yum install tiger*

启动VNC服务

[root@localhost ~]#vncserver:1

修改VNC配置文件

[root@localhost ~]# cat /root/.vnc/xstartup

#!/bin/sh

xterm -geometry 80x24+10+10 -ls title "$VNCDESKTOP Desktop" &

gnome-session gnome

twm &

启动VNCserver

[root@localhost ~]vmcserver –kill :1

[root@localhost ~]#vncserver :1

修改系统参数

修改hosts文件

[root@localhost ~]# cat /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

#RAC_D1_131

10.8.1.131 RAC1.localdomain RAC1

10.8.1.132 RAC1-vip.localdomain RAC1-vip

192.168.1.31 RAC1-priv.localdomain RAC1-priv

#RAC_D1_133

10.8.1.133 RAC2.localdomain RAC2

10.8.1.134 RAC2-vip.localdomain RAC2-vip

192.168.1.33 RAC2-priv.localdomain RAC2-priv

#scan-ip

10.8.1.137 scan-cluster.localdomain scan-cluster

修改network文件

[root@localhost ~]# cat /etc/sysconfig/network

NETWORKING=yes

HOSTNAME=RAC2

配置系统限制

[root@localhost ~]# cat /etc/security/limits.d/90-nproc.conf

# Default limit for number of user's processes to prevent

# accidental fork bombs.

# See rhbz #432903 for reasoning.

* - nproc 16384

root soft nproc unlimited

关闭selinux

[root@localhost ~]# cat /etc/sysconfig/selinux

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

# enforcing - SELinux security policy is enforced.

# permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded.

SELINUX=disabled

# SELINUXTYPE= can take one of these two values:

# targeted - Targeted processes are protected,

# mls - Multi Level Security protection. SELINUXTYPE=targeted

关闭防火墙

[root@localhost ~]# service iptables stop

iptables:清除防火墙规则:[确定]

iptables:将链设置为政策ACCEPT:filter [确定] iptables:正在卸载模块:[确定]

[root@localhost ~]# chkconfig iptables off

关闭时钟

[root@localhost ~]# service ntpd stop

关闭ntpd:[失败]

[root@localhost ~]# chkconfig ntpd off

[root@localhost ~]# mv /etc/ntp.conf /etc/ntp.conf.orig [root@localhost ~]# rm /var/run/ntpd.pid

rm: 无法删除"/var/run/ntpd.pid": 没有那个文件或目录

修改安全限制

Add the below at the end of file “/etc/security/limits.conf”#Grid

grid soft nofile 1024

grid hard nofile 65536

grid soft nproc 2047

grid hard nproc 16384

grid soft stack 10240

grid hard stack 32768

设置本地域名解析

[root@localhost ~]# cat /etc/resolv.conf

search localdomain

[root@localhost ~]# service dnsmasq restart

Starting dnsmasq: [确定]

[root@localhost ~]# chkconfig dnsmasq on

添加用户

创建集群用户组

[root@localhost ~]# groupadd -g 1000 oinstall

[root@localhost ~]# groupadd -g 1010 dba

[root@localhost ~]# groupadd -g 1020 asmadmin

[root@localhost ~]# groupadd -g 1030 asmdba

创建grid用户

[root@localhost ~]# useradd -u 1100 -g oinstall -G asmadmin,asmdba grid [root@localhost ~]# mkdir -p /opt/u01/app/11.2.0/grid

[root@localhost ~]# mkdir -p /opt/u01/app/grid

[root@localhost ~]# chown -R grid:oinstall /opt/u01

[root@localhost ~]# passwd grid

创建oracle用户

[root@localhost ~]# useradd -u 1101 -g oinstall -G dba,asmdba oracle [root@localhost ~]# mkdir -p /opt/u01/app/oracle/product/11.2.0 [root@localhost ~]# chown -R oracle:oinstall /opt/u01/app/oracle

[root@localhost ~]# chmod -R 775 /opt/u01

[root@localhost ~]# passwd oracle

设置环境变量

设置oracle环境变量

[root@localhost ~]# su oracle

[oracle@localhost ~]$ vi .bash_profile

RAC1节点

#RAC1_oracle

export ORACLE_HOME=/opt/u01/app/oracle/product/11.2.0

export ORACLE_SID=RAC1

export ORACLE_UNQNAME=RAC

export PATH=$ORACLE_HOME/bin:$PATH

export ORACLE_BASE=/opt/u01/app/oracle

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

RAC2节点

#RAC2_oracle

export ORACLE_HOME=/opt/u01/app/oracle/product/11.2.0

export ORACLE_SID=RAC2

export ORACLE_UNQNAME=RAC

export PATH=$ORACLE_HOME/bin:$PATH

export ORACLE_BASE=/opt/u01/app/oracle

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib 设置grid环境变量

[root@localhost ~]# su - grid

[grid@localhost ~]$ vi .bash_profile

RAC1节点

#RAC1_Grid

export ORACLE_HOME=/opt/u01/app/11.2.0/grid

export ORACLE_SID=+ASM1

export PATH=$ORACLE_HOME/bin:$PATH

export ORACLE_BASE=/opt/u01/app/grid

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

RAC2节点

#RAC2_Grid

export ORACLE_HOME=/opt/u01/app/11.2.0/grid

export ORACLE_SID=+ASM2

export PATH=$ORACLE_HOME/bin:$PATH

export ORACLE_BASE=/opt/u01/app/grid

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib 配置ASM

配置ASM

[root@localhost ~]# oracleasm configure -i

Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library

driver. The following questions will determine whether the driver is

loaded on boot and what permissions it will have. The current values

will be shown in brackets ('[]'). Hitting without typing an

answer will keep that current value. Ctrl-C will abort.

Default user to own the driver interface []: grid

Default group to own the driver interface []: asmadmin

Start Oracle ASM library driver on boot (y/n) [n]: y

Scan for Oracle ASM disks on boot (y/n) [y]: y

Writing Oracle ASM library driver configuration: done

ASM初始化

[root@localhost ~]# oracleasm init

Creating /dev/oracleasm mount point: /dev/oracleasm

Loading module "oracleasm": oracleasm

Configuring "oracleasm" to use device physical block size

Mounting ASMlib driver filesystem: /dev/oracleasm

格式化磁盘

[root@localhost ~]# fdisk /dev/sdb

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel with disk identifier 0x6c2f6c1f.

Changes will remain in memory only, until you decide to write them.

After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to

sectors (command 'u').

Command (m for help): n

Command action

e extended

p primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-1305, default 1):

Using default value 1

Last cylinder, +cylinders or +size{K,M,G} (1-1305, default 1305):

Using default value 1305

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

重启系统

[root@localhost ~]# reboot

创建ASM磁盘

[root@rac1 ~]# oracleasm createdisk ASMDISK1 /dev/sdb1

Writing disk header: done

Instantiating disk: done

[root@rac1 ~]# oracleasm createdisk ASMDISK2 /dev/sdc1

Writing disk header: done

Instantiating disk: done

[root@rac1 ~]# oracleasm createdisk ASMDISK3 /dev/sdd1

Writing disk header: done

Instantiating disk: done

[root@rac1 ~]# oracleasm createdisk ASMDISK4 /dev/sde1

Writing disk header: done

Instantiating disk: done

检测ASM磁盘

[root@rac1 ~]# oracleasm scandisks

Reloading disk partitions: done

Cleaning any stale ASM disks...

Scanning system for ASM disks...

[root@rac1 ~]# oracleasm listdisks

ASMDISK1

ASMDISK2

ASMDISK3

ASMDISK4

安装环境检测

安装检测工具

安装cvuqdisk软件包,该包在grid软件包rpm目录下

[root@rac1 rpm]# pwd

/opt/soft/grid/rpm

[root@rac1 rpm]# ls

cvuqdisk-1.0.9-1.rpm

[root@rac1 rpm]# rpm -ivh cvuqdisk-1.0.9-1.rpm

Preparing... ########################################### [100%] Using default group oinstall to install package

1:cvuqdisk ########################################### [100%]

执行检测

执行检测在安装(该检查应该在配置完毕SSH对等性的情况下进行,可在安装Grid过程中进行检查)

[root@rac1 grid]# su - grid

[grid@rac1 ~]$ cd /opt/soft/grid/

[grid@rac1 grid]$ ./runcluvfy.sh stage -pre crsinst -n RAC1,RAC2 -fixup –verbose

安装Grid

安装准备

[root@rac1 \u684c\u9762]# su - grid [grid@rac1 ~]$ export DISPLAY=:1.0 [grid@rac1 ~]$ export LANG=en_US.UTF-8 [grid@rac1 ~]$cd /opt/soft/grid

[grid@rac1 ~]$./runInstaller

安装Grid

SCAN Name需要和hosts文件名称一致

两台集群节点的网卡名称必须一致,否则该处会报错误

密码:passw0rd

注意:/opt/u01/app/11.2.0/grid/root.sh这个脚本只有一个节点执行完成之后,才能在另外一个节点上执行。

检查集群状态

[root@rac1 disks]# su - grid

查看服务状态

[grid@rac1 ~]$ crs_stat -t

Name Type Target State Host ------------------------------------------------------------

ora.DATA.dg ora....up.type ONLINE ONLINE rac1 ora....ER.lsnr ora....er.type ONLINE ONLINE rac1 ora....N1.lsnr ora....er.type ONLINE ONLINE rac2

ora.asm ora.asm.type ONLINE ONLINE rac1 ora.cvu ora.cvu.type ONLINE ONLINE rac2 ora.gsd ora.gsd.type OFFLINE OFFLINE d7b6635c31126edb6e1a1029work ora....rk.type ONLINE ONLINE rac1 ora.oc4j ora.oc4j.type ONLINE ONLINE rac2 ora.ons ora.ons.type ONLINE ONLINE rac1 ora....SM2.asm application ONLINE ONLINE rac1 ora....C1.lsnr application ONLINE ONLINE rac1 ora.rac1.gsd application OFFLINE OFFLINE

本文来源:https://www.bwwdw.com/article/1hpq.html

Top