Table of Contents
牛刀小试Oracle之ORACLE 11GR2 RAC安装配置--先决配置阶段
1.网络规划
2.操作系统设置
3.共享磁盘设置
4. 安装RAC
4.1 先决条件
4.1.1 yum配置
4.1.2 vnc配置
4.2 配置/etc/hosts文件(所有节点)
4.3 添加组合用户(所有节点)
4.4.建立目录(所有节点)
4.5. 修改内核参数(所有节点)
4.6 .禁用防火墙和SELINUX(所有节点)
4.7 .检查安装包
4.8 .配置用户环境变量(grid和oracle用户_所有节点)
4.9. ASM磁盘组规划&分区
4.9.1 使用fdisk划分磁盘,如下:
4.9.2 安装asm
4.9.3 配置asm
4.10.grid和oracle用户配置SSH互信
4.11.配置NTP
Home php教程 php手册 牛刀小试Oracle之ORACLE 11GR2 RAC安装配置--先决配置阶段

牛刀小试Oracle之ORACLE 11GR2 RAC安装配置--先决配置阶段

Jun 13, 2016 am 08:43 AM
android

牛刀小试Oracle之ORACLE 11GR2 RAC安装配置--先决配置阶段

基于VMwarevCenter Server中的Linux RedHat 6.4 安装Oracle 11GR2 11.2.0.4 RAC集群

1.网络规划

其中public和private要划分到不同的网段。保证安全传输

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

127.0.0.1 localhost localhost.localdomain localhost4localhost4.localdomain4

::1 localhost localhost.localdomainlocalhost6 localhost6.localdomain6

10.2.13.80 zracnode1

10.2.13.81 zracnode2

10.2.13.82 zracnode1-vip

10.2.13.83 zracnode2-vip

10.2.12.140 zracnode1-priv

10.2.12.141 zracnode2-priv

10.2.13.142 zrac-scan

10.2.13.143 zrac-scan

10.2.13.144 zrac-scan

2.操作系统设置

*.安装的操作系统是LinuxRedhat 6.4

*.磁盘划分配置

磁盘目录

磁盘大小

/

30GB

swap

16GB

/u01

100GB

3.共享磁盘设置

共享磁盘配置有多种方式,nfs,磁盘阵列直接映射划分,我这里采用的是通过vmware vCenter server上的共享磁盘技术,操作步骤如下:

3.1. 需要对SCSI 控制器,进行配置。对总线配置为[物理]模式。参数解释如下:

选项

描述

其他虚拟机不能共享虚拟磁盘。

虚拟

同一台服务器上的虚拟机可以共享虚拟磁盘。

物理

任何服务器上的虚拟机均可共享虚拟磁盘。

3.2 新建SCSI controller 1控制器,并设置相关参数,VmwarevCenter操作页面如下:

3.3 新建硬盘,硬盘类型为[Thick provision eager zeroed].并且设置virtual Device Node为[SCSI(1:0)].在设置磁盘模式为[Independent-Persistent].操作页面如下:

3.4 添加已存在磁盘,在ZRAC02节点上面,添加磁盘。操作页面如下:

4. 安装RAC

4.1 先决条件

4.1.1 yum配置

挂载镜像配置yum

mount -oloop -t iso9660 /u01/software/rhel-server-6.4-x86_64-dvd.iso /u01/iso

[root@Zracnode1u01]# cat /etc/yum.repos.d/rhel-source.repo

[Server]

name=Server

baseurl=file:///u01/iso

gpgcheck=0

gpgkey=file:///u01/iso/RPM-GPG-KEY-redhat-release

4.1.2 vnc配置

VNC在Linux上的安装

#yuminstall tigervnc-server

#vncserver #该命令在服务器端启动一个VNC进程。允许一个

VNC View连接进来;如果需要多个View连接到服务器,需要多次执行上述命令;

Password: # 为了不想任何人都可以任意遥控此计算机。因此当第1次启动VNC server时,会要求设置网络遥控的密码。

Verify: # 验证密码;

进入root主目录下的.vnc隐含目录, 找到 xstartup文件并编辑:

# cd/root/.vnc

# vi xstartup

# twm& (注释掉该行)

startkde& (添加该行)

# killallXvnc

#vncserver

4.2 配置/etc/hosts文件(所有节点)

[root@rac01network-scripts]# vi /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4localhost4.localdomain4

::1 localhost localhost.localdomainlocalhost6 localhost6.localdomain6

10.2.13.80 Zracnode1

10.2.13.81 Zracnode2

10.2.13.82 Zracnode1-vip

10.2.13.83 Zracnode2-vip

10.2.13.140 Zracnode1-priv

10.2.13.141 Zracnode2-priv

10.2.13.142 Zrac-scan

4.3 添加组合用户(所有节点)

groupadd -g500 oinstall

groupadd -g501 dba

groupadd -g502 oper

groupadd -g503 asmadmin

groupadd -g504 asmoper

groupadd -g505 asmdba

useradd -goinstall -G dba,asmdba,oper oracle

useradd -goinstall -G asmadmin,asmdba,asmoper,oper,dba grid

检测用户oracle和grid

[root@rac1~]# id oracle

uid=500(oracle)gid=500(oinstall) groups=500(oinstall),501(dba),502(oper),505(asmdba)

[root@rac1~]# id grid

uid=501(grid)gid=500(oinstall) groups=500(oinstall),501(dba),502(oper),503(asmadmin),504(asmoper),505(asmdba)

对用户oracle和grid设置密码

[root@rac1~]# passwd oracle

[root@rac1~]# passwd grid

4.4.建立目录(所有节点)

mkdir/u01/app

chown -Rgrid:oinstall /u01/app/

chmod -R 775/u01/app/

mkdir -p/u01/app/oraInventory

chown -Rgrid:oinstall /u01/app/oraInventory/

chmod -R 775/u01/app/oraInventory/

mkdir -p/u01/app/grid

mkdir -p/u01/app/oracle

chown -Rgrid:oinstall /u01/app/grid/

chown -Roracle:oinstall /u01/app/oracle/

chmod -R 775/u01/app/grid/

chmod -R 775/u01/app/oracle/

4.5. 修改内核参数(所有节点)

[root@rac01~]# vi /etc/sysctl.conf

# for oracle11g

fs.aio-max-nr= 1048576

fs.file-max =6815744

kernel.shmall= 2147483648

kernel.shmmax= 68719476736

kernel.shmmni= 4096

kernel.sem =250 32000 100 128

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= 1048586

使修改参数立即生效:

[root@rac01~]# /sbin/sysctl -p

[root@rac01~]# /etc/security/limits.conf

grid soft nproc 2047

grid hard nproc 16384

grid soft nofile 1024

grid hard nofile 65536

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

[root@rac01~]# /etc/pam.d/login

session required pam_limits.so

[root@rac01 ~]#/etc/profile

if [ $USER ="oracle" ] || [ $USER = "grid" ]; then

if [ $SHELL = "/bin/ksh" ];then

ulimit -p 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

umask 022

fi

4.6 .禁用防火墙和SELINUX(所有节点)

serviceiptables stop

chkconfigiptables off

chkconfigiptables --list

setenforce 0

sed -i's/SELINUX=.*/SELINUX=disabled/' /etc/selinux/config

4.7 .检查安装包

rpm -q --qf'%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils \

compat-libstdc++-33\

elfutils-libelf\

elfutils-libelf-devel\

gcc \

gcc-c++ \

glibc \

glibc-common\

glibc-devel \

glibc-headers\

ksh \

libaio \

libaio-devel\

libgcc \

libstdc++ \

libstdc++-devel\

make \

sysstat \

unixODBC \

4.8 .配置用户环境变量(grid和oracle用户_所有节点)

grid用户:

[grid@rac01 ~]# vi .bash_profile

export ORACLE_SID=+ASM1/+ASM2

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=/u01/app/grid/11.2

export PATH=$PATH:$ORACLE_HOME/bin

oracle用户:

[oracle@rac01 ~]# vi .bash_profile

export ORACLE_SID=racdb1/racdb2

export ORACLE_UNQNAME=$ORACLE_SID

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/11.2/db_1

export PATH=$PATH:$ORACLE_HOME/bin

4.9. ASM磁盘组规划&分区

4.9.1 使用fdisk划分磁盘,如下:

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

划分效果如下:

---------------------------------------------------------------------------

Device Boot Start End Blocks Id System

/dev/sdb1 1 132 1060258+ 83 Linux //CRS1 900M

/dev/sdb2 133 264 1060290 83 Linux //CRS2 900M

/dev/sdb3 265 396 1060290 83 Linux //CRS3 900M

/dev/sdb4 397 13054 101675385 5 Extended

/dev/sdb5 397 3008 20980858+ 83 Linux //DATA1 30GB

/dev/sdb6 3009 5620 20980858+ 83 Linux //DATA2 30GB

/dev/sdb7 5621 8232 20980858+ 83 Linux //DATA3 30GB

/dev/sdb8 8233 9538 10490413+ 83 Linux //REC1 30GB

/dev/sdb9 9539 13054 28242238+ 83 Linux //REC2 30GB

4.9.2 安装asm

[root@rac02software]# rpm -ivh kmod-oracleasm-2.0.6.rh1-2.el6.x86_64.rpm

warning:kmod-oracleasm-2.0.6.rh1-2.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, keyID fd431d51: NOKEY

Preparing... ########################################### [100%]

1:kmod-oracleasm ########################################### [100%]

[root@rac02 software]# rpm -ivhoracleasm-support-2.1.8-1.el6.x86_64.rpm

warning: oracleasm-support-2.1.8-1.el6.x86_64.rpm:Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY

Preparing... ########################################### [100%]

1:oracleasm-support ########################################### [100%]

[root@rac02 software]# rpm -ivhoracleasmlib-2.0.4-1.el6.x86_64.rpm

warning:oracleasmlib-2.0.4-1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key IDec551f03: NOKEY

Preparing... ########################################### [100%]

1:oracleasmlib ###########################################[100%]

4.9.3 配置asm

RAC01执行下列操作:

[root@rac1 ~]# /etc/init.d/oracleasmconfigure

[root@rac1 ~]# /etc/init.d/oracleasmconfigure

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 driverconfiguration: done

Initializing the Oracle ASMLib driver: [ OK ]

Scanning the system for Oracle ASMLibdisks: [ OK ]

RAC02执行下列操作:

[root@rac02 software]# /etc/init.d/oracleasmconfigure

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 driverconfiguration: done

Initializing the Oracle ASMLib driver: [ OK ]

Scanning the system for Oracle ASMLibdisks: [ OK ]

以下操作在rac其中一个节点上进行,我在rac1上操作

[root@rac1 ~]# /etc/init.d/oracleasmcreatedisk CRS1 /dev/sdb1

[root@rac1 ~]# /etc/init.d/oracleasmcreatedisk CRS2 /dev/sdb2

[root@rac1 ~]# /etc/init.d/oracleasmcreatedisk CRS3 /dev/sdb3

[root@rac1 ~]# /etc/init.d/oracleasmcreatedisk DATA1 /dev/sdb5

[root@rac1 ~]# /etc/init.d/oracleasmcreatedisk DATA2 /dev/sdb6

[root@rac1 ~]# /etc/init.d/oracleasmcreatedisk DATA3 /dev/sdb7

[root@rac1 ~]# /etc/init.d/oracleasmcreatedisk REC1 /dev/sdb8

[root@rac1 ~]# /etc/init.d/oracleasmcreatedisk REC2 /dev/sdb9

以下操作在另一个节点上进行,RAC2上操作

[root@rac02 software]# oracleasm scandisks

Reloading disk partitions: done

Cleaning any stale ASM disks...

Scanning system for ASM disks...

[root@Zracnode2 software]# oracleasmlistdisks

CRS1

CRS2

CRS3

DATA1

DATA2

DATA3

REC1

REC2

4.10.grid和oracle用户配置SSH互信

为ssh和scp创建连接

ls -l /usr/local/bin/ssh

ls -l /usr/local/bin/scp

不存在则创建

[root@rac01 ~]# /bin/ln -s /usr/bin/ssh/usr/local/bin/ssh

[root@rac01 ~]# /bin/ln -s /usr/bin/scp/usr/local/bin/scp

为grid用户配置SSH:

在每个节点上:

[root@rac01 ~]# su – grid

[grid@rac01 ~]# mkdir ~/.ssh

[grid@rac01 ~]#cd .ssh

[grid@rac01 ~]# ssh-keygen -t rsa

[grid@rac01 ~]# ssh-keygen -t dsa

在节点1上:

[grid@rac01 ~]# touch authorized_keys

[grid@rac01 ~]# ssh rac01 cat/home/grid/.ssh/id_rsa.pub >> authorized_keys

[grid@rac01 ~]# ssh rac02 cat/home/grid/.ssh/id_rsa.pub >> authorized_keys

[grid@rac01 ~]# ssh rac01 cat /home/grid/.ssh/id_dsa.pub>> authorized_keys

[grid@rac01 ~]# ssh rac02 cat/home/grid/.ssh/id_dsa.pub >> authorized_keys

[grid@rac01 ~]# scp authorized_keysrac02:/home/grid/.ssh/

分别在每个节点上:

[grid@rac01 ~]# ssh rac01 date

[grid@rac01 ~]# ssh rac02 date

[grid@rac01 ~]# ssh-agent $SHELL

[grid@rac01 ~]# ssh-add

为oracle用户配置SSH:

在每个节点上:

[root@rac01 ~]# su – oracle

[oracle@rac01 ~]# mkdir ~/.ssh

[oracle@rac01 ~]#cd .ssh

[oracle@rac01 ~]# ssh-keygen -t rsa

[oracle@rac01 ~]# ssh-keygen -t dsa

在节点1上:

[oracle@rac01 ~]# touch authorized_keys

[oracle@rac01 ~]# ssh rac01 cat /home/oracle/.ssh/id_rsa.pub>> authorized_keys

[oracle@rac01 ~]# ssh rac02 cat /home/oracle/.ssh/id_rsa.pub>> authorized_keys

[oracle@rac01 ~]# ssh rac01 cat /home/oracle/.ssh/id_dsa.pub>> authorized_keys

[oracle@rac01 ~]# ssh rac02 cat /home/oracle/.ssh/id_dsa.pub>> authorized_keys

[oracle@rac01 ~]# scp authorized_keysrac02:/home/oracle/.ssh/

分别在每个节点上:

[oracle@rac01 ~]# ssh rac01 date

[oracle@rac01 ~]# ssh rac02 date

[oracle@rac01 ~]# ssh-agent $SHELL

[oracle@rac01 ~]# ssh-add

4.11.配置NTP

[root@rac01 ~]#vi /etc/ntp.conf

...

#server 0.centos.pool.ntp.org

#server 1.centos.pool.ntp.org

#server 2.centos.pool.ntp.org

server xxx.xxx.xxx.xxx

#server127.127.1.0 # local clock

#fudge 127.127.1.0 stratum 10

[root@rac01 ~]# vi /etc/sysconfig/ntpd

# Drop root to id 'ntp:ntp' by default.

OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"

# Set to 'yes' to sync hw clock aftersuccessful ntpdate

SYNC_HWCLOCK=yes

# Additional options for ntpdate

NTPDATE_OPTIONS=""

启动

[root@rac01 ~]# chkconfig ntpd on

[root@rac01 ~]# service ntpd start

[root@rac01 ~]# ntpdate -d -u xxx.xxx.xxx.xxx

启用name service cache daemon

[root@rac01 ~]# chkconfig --level 35 nscdon

[root@rac01 ~]# service nscd restart


-----------后面两个阶段,分别是GI安装和oracle安装,未完待续!~

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

New report delivers damning assessment of rumoured Samsung Galaxy S25, Galaxy S25 Plus and Galaxy S25 Ultra camera upgrades New report delivers damning assessment of rumoured Samsung Galaxy S25, Galaxy S25 Plus and Galaxy S25 Ultra camera upgrades Sep 12, 2024 pm 12:23 PM

In recent days, Ice Universe has been steadily revealing details about the Galaxy S25 Ultra, which is widely believed to be Samsung's next flagship smartphone. Among other things, the leaker claimed that Samsung only plans to bring one camera upgrade

Samsung Galaxy S25 Ultra leaks in first render images with rumoured design changes revealed Samsung Galaxy S25 Ultra leaks in first render images with rumoured design changes revealed Sep 11, 2024 am 06:37 AM

OnLeaks has now partnered with Android Headlines to provide a first look at the Galaxy S25 Ultra, a few days after a failed attempt to generate upwards of $4,000 from his X (formerly Twitter) followers. For context, the render images embedded below h

IFA 2024 | TCL\'s NXTPAPER 14 won\'t match the Galaxy Tab S10 Ultra in performance, but it nearly matches it in size IFA 2024 | TCL\'s NXTPAPER 14 won\'t match the Galaxy Tab S10 Ultra in performance, but it nearly matches it in size Sep 07, 2024 am 06:35 AM

Alongside announcing two new smartphones, TCL has also announced a new Android tablet called the NXTPAPER 14, and its massive screen size is one of its selling points. The NXTPAPER 14 features version 3.0 of TCL's signature brand of matte LCD panels

Vivo Y300 Pro packs 6,500 mAh battery in a slim 7.69 mm body Vivo Y300 Pro packs 6,500 mAh battery in a slim 7.69 mm body Sep 07, 2024 am 06:39 AM

The Vivo Y300 Pro just got fully revealed, and it's one of the slimmest mid-range Android phones with a large battery. To be exact, the smartphone is only 7.69 mm thick but features a 6,500 mAh battery. This is the same capacity as the recently launc

New report delivers damning assessment of rumoured Samsung Galaxy S25, Galaxy S25 Plus and Galaxy S25 Ultra camera upgrades New report delivers damning assessment of rumoured Samsung Galaxy S25, Galaxy S25 Plus and Galaxy S25 Ultra camera upgrades Sep 12, 2024 pm 12:22 PM

In recent days, Ice Universe has been steadily revealing details about the Galaxy S25 Ultra, which is widely believed to be Samsung's next flagship smartphone. Among other things, the leaker claimed that Samsung only plans to bring one camera upgrade

Samsung Galaxy S24 FE billed to launch for less than expected in four colours and two memory options Samsung Galaxy S24 FE billed to launch for less than expected in four colours and two memory options Sep 12, 2024 pm 09:21 PM

Samsung has not offered any hints yet about when it will update its Fan Edition (FE) smartphone series. As it stands, the Galaxy S23 FE remains the company's most recent edition, having been presented at the start of October 2023. However, plenty of

Motorola Razr 50s shows itself as possible new budget foldable in early leak Motorola Razr 50s shows itself as possible new budget foldable in early leak Sep 07, 2024 am 09:35 AM

Motorola has released countless devices this year, although only two of them are foldables. For context, while most of the world has received the pair as the Razr 50 and Razr 50 Ultra, Motorola offers them in North America as the Razr 2024 and Razr 2

Xiaomi Redmi Note 14 Pro Plus arrives as first Qualcomm Snapdragon 7s Gen 3 smartphone with Light Hunter 800 camera Xiaomi Redmi Note 14 Pro Plus arrives as first Qualcomm Snapdragon 7s Gen 3 smartphone with Light Hunter 800 camera Sep 27, 2024 am 06:23 AM

The Redmi Note 14 Pro Plus is now official as a direct successor to last year'sRedmi Note 13 Pro Plus(curr. $375 on Amazon). As expected, the Redmi Note 14 Pro Plus heads up the Redmi Note 14 series alongside theRedmi Note 14and Redmi Note 14 Pro. Li

See all articles