一步一步在OEL5.5 64位Linux上安装Oracle 10gR2 RAC(1)
来源:互联网 发布:上海市政总院 知乎 编辑:程序博客网 时间:2024/05/16 03:05
概述:
继本人上一个系列的Oracle 11gR2 RAC+DG项目实战教程发布已一年有余,在此期间,那个系列的教程得到众多网友的喜爱与好评,更是在互联网上畅销不衰。为此,众多网友也一直希望本人推出Oracle 10gR2 RAC的系列教程,恰逢前不久,深圳某客户需要将一套Oracle 10gR2双节点RAC生产数据库升级至Oracle 11gR2 RAC,所以便有了本系列实战的教程。
为更贴切还原生产过程中的实际操作,本系列教程一个分两大部分:
第一部分从零开始一步一步搭建一套在OEL 5.5 X86_64位环境下的双节点10gR2 RAC数据库,并将数据库升级至10.2.0.5.0版本。
第二部分,一步一步将10gR2 RAC升级至Oracle 11gR2 RAC,数据库版本选择11g最新的11.2.0.4.0版本。
第一部分主要步骤:
一、准备软件;
二、配置虚拟机;
三、配置/etc/hosts文件;
四、建用户、改口令、修改用户配置文件;
五、建路径、改权限
六、修改/etc/security/limits.conf,配置oracle、grid用户的shell限制
七、修改/etc/pam.d/login配置文件
八、修改/etc/profile文件
九、修改内核配置文件
十、 配置oracle用户SSH对等性
十一、 配置共享磁盘
十二、 在共享磁盘上创建分区
十三、 配置裸设备以存放OCR、Voting Disk
十四、 安装asm软件包、创建ASM磁盘
十五、 安装clusterware软件
十六、 升级clusterware软件
十七、 安装oracle软件
十八、 升级oracle软件
十九、 创建RAC监听
二十、 创建ASM磁盘组、RAC数据库
1 准备软件:
软件名称
官方下载
百度网盘
360网盘
OEL 5.5 X86_64
https://edelivery.oracle.com/linux
http://pan.baidu.com/share/link?shareid=513608932&uk=3409299182
http://yunpan.cn/QDHwHk63tepJU
VMware Server
http://www.vmware.com/download/server/
http://pan.baidu.com/share/link?shareid=765358990&uk=3409299182
http://yunpan.cn/QDHwcLuECp2Lp
10201_clusterware_linux_x86_64
N/A
http://pan.baidu.com/share/link?shareid=1472026032&uk=3409299182
http://yunpan.cn/QDBQw49Thgjdz
10201_database_linux_x86_64
N/A
http://pan.baidu.com/share/link?shareid=1472026032&uk=3409299182
http://yunpan.cn/QDBQw49Thgjdz
p8202632_10205_Linux-x86-64
N/A
http://pan.baidu.com/share/link?shareid=1472026032&uk=3409299182
http://yunpan.cn/QDBQw49Thgjdz
p13390677_112040_Linux-x86-64_3of7 [Grid软件]
N/A
http://pan.baidu.com/share/link?shareid=1479956116&uk=3409299182
http://yunpan.cn/QDBQaw93MzR8z
p13390677_112040_Linux-x86-64_1of7
p13390677_112040_Linux-x86-64_2of7 [Oracle软件]
N/A
http://pan.baidu.com/share/link?shareid=1479956116&uk=3409299182
http://yunpan.cn/QDBQaw93MzR8z
Oracle ASM软件包
N/A
http://pan.baidu.com/s/1mgK6aYO
请稍后
2 配置虚拟机,安装OEL 5.5 X86_64位Linux操作系统
这里,我们需要在VMware ESXi Version 4.0的虚拟主机上创建两台虚拟机,其中每台机器至少需要配置双网卡,一块网卡作为Public,另一块作为Private,建议IP地址均选择手动配置,而不是DHCP动态分配,且要求指定的IP在网络里是唯一的。主机名也分别要求指定为唯一,避免冲突。主机名、IP地址在前期规划要慎重,一经指定,最好不要轻易改变,避免一些不必要的麻烦。这里列出两台机器前期规划的主机名、IP地址信息:
Hostname
Hostname alias
Type
IP Address
Interface
node1.oracleonlinux.cn
node1
Public IP
172.16.0.33
eth0
node1-vip.oracleonlinux.cn
node1-vip
Virtual IP
172.16.0.35
eth0:1
node1-priv.oracleonlinux.cn
node1-priv
Private IP
192.168.94.11
eth1
node2.oracleonlinux.cn
node2
Public IP
172.16.0.34
eth0
node2-priv.oracleonlinux.cn
node2-vip
Virtual IP
172.16.0.36
eth0:1
node2-priv.oracleonlinux.cn
node2-priv
Private IP
192.168.94.12
eth1
scan-cluster.oracleonlinux.cn
scan-cluster
SCAN IP
172.16.0.223
eth0
(Figure 1.1网络配置信息表)
Note:
上述中配置的SCAN IP是为后期我们将10gR2 RAC 升级到11gR2 RAC预留的。
其中,每台机器至少需要配置3个IP地址,在安装操作系统的过程中,我们需要配置公网IP和私有IP即可,虚拟IP在安装集群件时自动配置。Public IP、Virtual IP、SCAN IP必须配置在同一网段。SCAN IP是Oracle 11g新推出的,在配置11g RAC时需要指定。我们的SCAN IP通过配置DNS服务器来实现。
3 配置/etc/hosts文件
参照上述1.1网络配置信息表来配置/etc/hosts文件。在双节点上均需执行。
节点1:
[root@node1 ~]# hostname
node1.oracleonlinux.cn
[root@node1 ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost
::1 localhost6.localdomain6 localhost6
# public
172.16.0.33 node1.oracleonlinux.cn node1
172.16.0.34 node2.oracleonlinux.cn node2
# private
192.168.94.11 node1-priv.oracleonlinux.cn node1-priv
192.168.94.12 node2-priv.oracleonlinux.cn node2-priv
# virtual
172.16.0.35 node1-vip.oracleonlinux.cn node1-vip
172.16.0.36 node2-vip.oracleonlinux.cn node2-vip
# scan-ip
172.16.0.223 scan-cluster.oracleonlinux.cn scan-cluster
[root@node1 ~]#
节点2:
[root@node2 ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost
::1 localhost6.localdomain6 localhost6
# public
172.16.0.33 node1.oracleonlinux.cn node1
172.16.0.34 node2.oracleonlinux.cn node2
# private
192.168.94.11 node1-priv.oracleonlinux.cn node1-priv
192.168.94.12 node2-priv.oracleonlinux.cn node2-priv
# virtual
172.16.0.35 node1-vip.oracleonlinux.cn node1-vip
172.16.0.36 node2-vip.oracleonlinux.cn node2-vip
# scan-ip
172.16.0.223 scan-cluster.oracleonlinux.cn scan-cluster
[root@node2 ~]#
4 建用户、改口令、修改用户配置文件;
以root用户执行事先配置的脚本1preuser_dir.sh,脚本具体内容请见附件1。在双节点上均需执行。
[root@node1 shell]# pwd
/root/media/shell
[root@node1 shell]# ll
total 24
-rw-r--r-- 1 root root 1625 Dec 19 14:10 1preuser_dir.sh
-rw-r--r-- 1 root root 477 Dec 19 14:11 2predir.sh
-rw-r--r-- 1 root root 631 Dec 19 14:11 3prelimits.sh
-rw-r--r-- 1 root root 465 Dec 19 14:11 4prelogin.sh
-rw-r--r-- 1 root root 632 Dec 19 14:12 5preprofile.sh
-rw-r--r-- 1 root root 931 Dec 19 14:12 6presysctl.sh
[root@node1 shell]#
[root@node1 shell]# sh 1preuser_dir.sh
Now create two groups named 'oinstall' and 'dba', plus a user named 'oracle'.Also setting the Environment
Now create the necessary directory for oracle user and change the authention to oracle user...
Changing password for user oracle.
passwd: all authentication tokens updated successfully.
The two groups named 'oinstall' and 'dba' plus the oracle user has been created.
The Environment variable for oracle user also has been setted sussessfully.
[root@node1 shell]#
Note:
节点2上执行该脚本时,需要将脚本中的ORACLE_SID改为devdb2,或者根据实际情况修改为自己的SID。
5 建路径、改权限
以root用户执行事先配置的脚本2predir.sh,脚本具体内容请见附件1。以root用户在双节点上均需执行。
执行命令:sh 2predir.sh
脚本执行具体过程及输出,不再赘述。
6 修改/etc/security/limits.conf,配置oracle、grid用户的shell限制
以root用户执行事先配置的脚本3prelimits.sh,脚本具体内容请见附件1。以root用户在双节点上均需执行。
执行命令:sh 3prelimits.sh
脚本执行具体过程及输出,不再赘述。
7 修改/etc/pam.d/login配置文件
以root用户执行事先配置的脚本4prelogin.sh,脚本具体内容请见附件1。以root用户在双节点上均需执行。
执行命令:sh 4prelogin.sh
脚本执行具体过程及输出,不再赘述。
8 修改/etc/profile文件
以root用户执行事先配置的脚本5preprofile.sh,脚本具体内容请见附件1。以root用户在双节点上均需执行。
执行命令:sh 5preprofile.sh
脚本执行具体过程及输出,不再赘述。
9 修改内核配置文件
以root用户执行事先配置的脚本6presysctl.sh,脚本具体内容请见附件1。以root用户在双节点上均需执行。
执行命令:sh 6presysctl.sh
脚本执行具体过程及输出,不再赘述。
10 配置oracle用户SSH对等性
Node1:
[root@node1 ~]# su - oracle
node1-> hostname
node1.oracleonlinux.cn
node1-> mkdir ~/.ssh
node1-> chmod 700 ~/.ssh
node1-> ls -al
total 44
drwx------ 4 oracle oinstall 4096 Dec 19 14:28 .
drwxr-xr-x 3 root root 4096 Dec 19 14:18 ..
-rw------- 1 oracle oinstall 18 Dec 19 14:28 .bash_history
-rw-r--r-- 1 oracle oinstall 33 Dec 19 14:18 .bash_logout
-rw-r--r-- 1 oracle oinstall 544 Dec 19 14:18 .bash_profile
-rw-r--r-- 1 oracle oinstall 124 Dec 19 14:18 .bashrc
-rw-r--r-- 1 oracle oinstall 515 Dec 19 14:18 .emacs
drwxr-xr-x 4 oracle oinstall 4096 Dec 19 14:18 .mozilla
drwx------ 2 oracle oinstall 4096 Dec 19 14:28 .ssh
-rw-r--r-- 1 oracle oinstall 658 Dec 19 14:18 .zshrc
node1-> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_rsa.
Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
fe:9a:d5:0a:c6:68:4e:c9:b2:af:7f:ad:a0:f9:07:c9 oracle@node1.oracleonlinux.cn
node1-> ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_dsa.
Your public key has been saved in /home/oracle/.ssh/id_dsa.pub.
The key fingerprint is:
4a:e4:b0:a5:d6:74:18:0b:39:c3:0f:cc:59:b2:23:18 oracle@node1.oracleonlinux.cn
node1->
Node2:
[root@node2 ~]# su - oracle
node2-> hostname
node2.oracleonlinux.cn
node2-> mkdir ~/.ssh
node2-> chmod 700 ~/.ssh
node2-> ls -al
total 72
drwx------ 4 oracle oinstall 4096 Dec 19 14:30 .
drwxr-xr-x 3 root root 4096 Dec 19 14:26 ..
-rw-r--r-- 1 oracle oinstall 33 Dec 19 14:26 .bash_logout
-rw-r--r-- 1 oracle oinstall 544 Dec 19 14:26 .bash_profile
-rw-r--r-- 1 oracle oinstall 124 Dec 19 14:26 .bashrc
-rw-r--r-- 1 oracle oinstall 515 Dec 19 14:26 .emacs
drwxr-xr-x 4 oracle oinstall 4096 Dec 19 14:26 .mozilla
drwx------ 2 oracle oinstall 4096 Dec 19 14:30 .ssh
-rw-r--r-- 1 oracle oinstall 658 Dec 19 14:26 .zshrc
node2-> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_rsa.
Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
40:21:4a:ef:c7:3d:1e:48:fa:5e:45:ce:57:60:df:6c oracle@node2.oracleonlinux.cn
node2-> ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_dsa.
Your public key has been saved in /home/oracle/.ssh/id_dsa.pub.
The key fingerprint is:
50:4d:9c:dd:d0:92:ac:e6:d0:d1:e8:1d:1a:cb:b2:08 oracle@node2.oracleonlinux.cn
node2->
重新回到节点1:
node1-> hostname
node1.oracleonlinux.cn
node1-> cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys
node1-> cat ~/.ssh/id_dsa.pub >>~/.ssh/authorized_keys
node1-> ssh node2 cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys
The authenticity of host 'node2 (172.16.0.34)' can't be established.
RSA key fingerprint is 42:bc:46:40:87:81:b7:23:d1:6b:0a:b3:1c:04:cd:ed.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'node2,172.16.0.34' (RSA) to the list of known hosts.
oracle@node2's password:
node1-> ssh node2 cat ~/.ssh/id_dsa.pub >>~/.ssh/authorized_keys
oracle@node2's password:
node1-> scp ~/.ssh/authorized_keys node2:~/.ssh/authorized_keys
oracle@node2's password:
authorized_keys 100% 2060 2.0KB/s 00:00
node1->
验证oracle用户的SSH对等性:
node1-> ssh node1 date
Thu Dec 19 16:39:31 CST 2013
node1-> ssh node2 date
Thu Dec 19 16:39:35 CST 2013
node1-> ssh node1-priv date
Thu Dec 19 16:39:45 CST 2013
node1-> ssh node2-priv date
Thu Dec 19 16:39:49 CST 2013
node1-> ssh node1.oracleonlinux.cn date
Thu Dec 19 16:40:16 CST 2013
node1-> ssh node2.oracleonlinux.cn date
Thu Dec 19 16:40:20 CST 2013
node1-> ssh node1-priv.oracleonlinux.cn date
Thu Dec 19 16:40:30 CST 2013
node1-> ssh node2-priv.oracleonlinux.cn date
Thu Dec 19 16:40:35 CST 2013
node1->
Note:
在2个节点上以oracle用户可以顺利执行上述命令,而不再提示需要oracle用户的密码,则说明配置成功!
如无特别说明,本站文章皆为原创,若要转载,务必请注明以下原文信息:
日志标题:《一步一步在OEL5.5 64位Linux上安装Oracle 10gR2 RAC(1)》
日志链接:http://www.oracleonlinux.cn/2013/12/step-by-step-install-10gr2rac-on-oel-1/
博客名称:OracleOnLinux
- 一步一步在OEL5.5 64位Linux上安装Oracle 10gR2 RAC(1)
- 一步一步在OEL5.5 64位Linux上安装Oracle 10gR2 RAC(5)
- 一步一步在OEL5.5 64位Linux上安装Oracle 10gR2 RAC(2)
- 一步一步在OEL5.5 64位Linux上安装Oracle 10gR2 RAC(3)
- 一步一步在OEL5.5 64位Linux上安装Oracle 10gR2 RAC(4)
- 一步一步在OEL5.5 64位Linux上安装Oracle 10gR2 RAC(6)
- 一步一步在OEL5.5 64位Linux上安装Oracle 10gR2 RAC(7)
- 一步一步在OEL5.5 64位Linux上安装Oracle 10gR2 RAC(8)
- 一步一步在OEL5.5 64位Linux上安装Oracle 10gR2 RAC(附)
- 一步一步在Linux上安装Oracle 11gR2 RAC (5)
- 一步一步在Linux上安装Oracle 11gR2 RAC (5)
- 一步一步在Linux上安装Oracle 11gR2 RAC (1)
- 一步一步在Linux上安装Oracle 11gR2 RAC (1)
- 一步一步在Linux上安装Oracle 11gR2 RAC (2)
- 一步一步在Linux上安装Oracle 11gR2 RAC (3)
- 一步一步在Linux上安装Oracle 11gR2 RAC (4)
- 一步一步在Linux上安装Oracle 11gR2 RAC (6)
- 一步一步在Linux上安装Oracle 11gR2 RAC (7)
- Canny边缘检测算法原理及其VC实现详解(一)
- linux学习笔记
- 折半查找递归与非递归实现
- C#中ToString()格式详解
- Canny边缘检测算法原理及其VC实现详解(二)
- 一步一步在OEL5.5 64位Linux上安装Oracle 10gR2 RAC(1)
- 看图了解Java中JDK与JRE、JVM的各自的作用及区别
- There is no getter for property named '**' in 'class java.lang.String'
- 矩阵求和-HDOJ2156
- recovery图片资源的再分析
- Pow(x, n)
- 白话机器学习算法(七)LDA
- qsort的使用
- 一步一步在OEL5.5 64位Linux上安装Oracle 10gR2 RAC(2)