系统:redhat 6.3
|
|
节点1 |
节点2 |
|
主机名 |
rac1 |
Rac2 |
|
eth0:Public IP |
192.168.2.101 |
192.168.2.102 |
|
eth0:VIP |
192.168.2.103 |
192.168.2.104 |
|
eth1:Private IP |
192.168.1.101 |
192.168.1.102 |
2. 硬件环境
|
项目 |
要求 |
检查方法 |
|
内存 |
只安装grid 内存至少要1.5G |
Grip MemTotal/proc/meminfo |
|
Swap空间 |
取决于节点的物理内存数 |
/sbin/swapon-s |
|
临时空间 |
/tmp>1GB |
|
|
Grid home目录空间 |
Oracle建议5.5G,如果考虑到补丁,log文件,定义到10GB |
|
|
ASM voting/OCR |
这个文件取决于选择的冗余方式 |
|
4. 安装虚拟机
略
5. 配置
[root@rac1 ~]# vi /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
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@rac1 ~]# /sbin/sysctl -p
[root@rac1 ~]# vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240
[root@RACDB1 ~]# vi /etc/hosts
##Public Network - (eth0)
192.168.2.101 rac1
192.168.2.102 rac2
##Private Interconnect - (eth1)
192.168.1.101 rac1-priv
192.168.1.102 rac2-priv
##Public Virtual IP (VIP) addresses - (eth0)
192.168.2.103 rac1-vip
192.168.2.104 rac2-vip
##scan IP
192.168.2.110 rac-scan
设置IP地址
[root@rac1 network-scripts]# pwd
/etc/sysconfig/network-scripts
[root@rac3 network-scripts]# cat ifcfg-eth0
# Intel Corporation 82540EM Gigabit Ethernet Controller
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.2.107
NETMASK=255.255.255.0
GETWAY=192.168.2.1
ONBOOT=yes
6. 创建用户和组
groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
groupadd -g 504 asmadmin
groupadd -g 505 asmdba
groupadd -g 506 asmoper
useradd -u 501 -d /home/grid -g oinstall -G asmadmin,asmdba,asmoper grid
passwd grid
useradd -u 502 -d /home/oracle -g oinstall -G dba,asmdba,oper oracle
passwd oracle
7. 创建存放安装目录
mkdir /soft
chown -R oracle:oinstall /soft
chmod -R 775 /soft
8. 创建目录
mkdir -p /u01/app/11.2.0/grid
mkdir -p /u01/app/grid
mkdir -p /u01/app/oracle
mkdir -p /u01/app/oracle/11.2.0
chown -R oracle:oinstall /u01
chown -R grid:oinstall /u01/app/grid
chown -R grid:oinstall /u01/app/11.2.0
chmod -R 775 /u01/
9. 设置环境变量
su - oracle
vi .bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=racdb1
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
su - grid
vi .bash_profile
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/11.2.0/grid
export ORACLE_SID=+ASM1
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH
10.安装rpm包
root用户下
vi /etc/yum.repos.d/yum-el5.repo
[oel6]
name = Enterprise Linux 6.3 DVD
baseurl=file:///mnt/
gpgcheck=0
enabled=1
[root@rac1 ~]# mount /dev/cdrom /mnt
[root@rac1 ~]# yum install binutils.x86_64 compat-libcap1.x86_64 compat-libstdc++-33.x86_64 compat-libstdc++-33.i686 gcc.x86_64 gcc-c++.x86_64 glibc.i686 glibc.x86_64 glibc-devel.x86_64 glibc-devel.i686 ksh.x86_64 libgcc.i686 libgcc.x86_64 libstdc++.x86_64 libstdc++.i686 libstdc++-devel.x86_64 libstdc++-devel.i686 libaio.x86_64 libaio.i686 libaio-devel.x86_64 libaio-devel.i686 make.x86_64 sysstat.x86_64 unixODBC.x86_64 unixODBC.i686 unixODBC-devel.x86_64 unixODBC-devel.i686
11.复制虚拟机
修改主机名:vi /etc/sysconfig/network
修改MAC地址和ip地址
或重新生成网络文件/etc/udev/rule.d
修改oracle和grid用户的环境变量
关闭防火墙
12.创建共享磁盘
关闭RAC1,RAC1两个虚拟机
E:
cd E:\vm\server\RAC1
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" createhd -filename racasm1.vdi -size 1024 -format VDI -variant Fixed
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" createhd -filename racasm2.vdi -size 1024 -format VDI -variant Fixed
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" createhd -filename racasm3.vdi -size 1024 -format VDI -variant Fixed
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" createhd -filename racasm4.vdi -size 1024 -format VDI -variant Fixed
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" createhd -filename racasm5.vdi -size 1024 -format VDI -variant Fixed
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd racasm1.vdi --type shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd racasm2.vdi --type shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd racasm3.vdi --type shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd racasm4.vdi --type shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd racasm5.vdi --type shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach rac1 --storagectl "SATA" --port 1 --device 0 --type hdd --medium racasm1.vdi --mtype shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach rac1 --storagectl "SATA" --port 2 --device 0 --type hdd --medium racasm2.vdi --mtype shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach rac1 --storagectl "SATA" --port 3 --device 0 --type hdd --medium racasm3.vdi --mtype shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach rac1 --storagectl "SATA" --port 4 --device 0 --type hdd --medium racasm4.vdi --mtype shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach rac1 --storagectl "SATA" --port 5 --device 0 --type hdd --medium racasm5.vdi --mtype shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach rac2 --storagectl "SATA" --port 1 --device 0 --type hdd --medium racasm1.vdi --mtype shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach rac2 --storagectl "SATA" --port 2 --device 0 --type hdd --medium racasm2.vdi --mtype shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach rac2 --storagectl "SATA" --port 3 --device 0 --type hdd --medium racasm3.vdi --mtype shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach rac2 --storagectl "SATA" --port 4 --device 0 --type hdd --medium racasm4.vdi --mtype shareable
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach rac2 --storagectl "SATA" --port 5 --device 0 --type hdd --medium racasm5.vdi --mtype shareable
do
echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\", RESULT==\"`/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$z`\", NAME=\"asm-disk$z\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\""
done
[root@rac1 rules.d]# pwd
/etc/udev/rules.d
vi 89-uuid.rules
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB7c47afb8-9ec18577", NAME="asm-diskb", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VBb276925f-61458c69", NAME="asm-diskc", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB8f56d430-a5a80f9a", NAME="asm-diskd", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VBfb8f8ec2-dde20807", NAME="asm-diske", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB98c4e500-ca582559", NAME="asm-diskf", OWNER="grid", GROUP="asmadmin", MODE="0660"
[root@rac1 rules.d]# start_udev
[root@rac1 ~]# cd /dev
[root@rac1 dev]# ls
asm-diskb disk loop3 null ram3 sda3 tty0 tty23 tty38 tty52 ttyS0 vcsa
asm-diskc dvd loop4 nvram ram4 sg0 tty1 tty24 tty39 tty53 ttyS1 vcsa1
asm-diskd fb loop5 oldmem ram5 sg1 tty10 tty25 tty4 tty54 ttyS2 vcsa2
asm-diske fb0 loop6 port ram6 sg3 tty11 tty26 tty40 tty55 ttyS3 vcsa3
asm-diskf
[root@rac2 rules.d]# vi 89-uuid.rules
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB7c47afb8-9ec18577", NAME="asm-diskb", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VBb276925f-61458c69", NAME="asm-diskc", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB8f56d430-a5a80f9a", NAME="asm-diskd", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VBfb8f8ec2-dde20807", NAME="asm-diske", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB98c4e500-ca582559", NAME="asm-diskf", OWNER="grid", GROUP="asmadmin", MODE="0660"
[root@rac2 rules.d]# start_udev
Starting udev:
[ OK ]
[root@rac2 dev]# pwd
/dev
[root@rac2 dev]# ls
13.安装
上传安装介质并解压
[grid@rac1 soft]$ ls
p13390677_112040_Linux-x86-64_3of7.zip
[grid@rac1 soft]$ unzip p13390677_112040_Linux-x86-64_3of7.zip
[grid@rac1 soft]$ ls
grid p13390677_112040_Linux-x86-64_3of7.zip
[grid@rac1 soft]$ cd grid
[grid@rac1 grid]$ ls
install readme.html response rpm runcluvfy.sh runInstaller sshsetup stage welcome.html
[grid@rac1 grid]$ ./ runInstaller
选择安装集群
选择高级安装
选择安装语言:
添加节点:“add"
选择OCR和votingdisk 安装位置:oracle ASM
选择ASM磁盘组:
为账号设置密码
选择默认
清单目录:默认
安装条件检查
选择忽略
开始安装
分别在rac1和rac2执行两个脚本
在rac1和rac2的root用户下执行以上2个脚本
[root@rac1 ~]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to
oinstall.
The execution of the script is complete.
[root@rac1 ~]# /u01/app/11.2.0/grid/root.sh
安装完成:close
解压
./runInstaller
跳过软件升级
只安装数据库软件
节点建立互信
互信建立成功
安装企业版本
默认的安装目录
默认的系统组
安装环境检查
忽略
开始安装
在rac1和rac2执行脚本
[root@rac2 ~]#
/u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome_1
Enter the full pathname of the local bin directory:
[/usr/local/bin]:
The contents of "dbhome" have not changed.
No need to overwrite.
The contents of "oraenv" have not changed.
No need to overwrite.
The contents of "coraenv" have not changed.
No need to overwrite.
Entries will be added to the /etc/oratab file as
needed by
Database Configuration Assistant when a database is
created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
[root@rac1 ~]#
/u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome_1
Enter the full pathname of the local bin directory:
[/usr/local/bin]:
The contents of "dbhome" have not changed.
No need to overwrite.
The contents of "oraenv" have not changed.
No need to overwrite.
The contents of "coraenv" have not changed.
No need to overwrite.
Entries will be added to the /etc/oratab file as
needed by
Database Configuration Assistant when a database is
created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
[root@rac1 ~]#
数据库软件安装完成
grid用户下
[grid@rac1 ~]$ asmca
数据文件建立磁盘组
2节点建立互信:”ssh connectivity"
提示密码不符合要求:点击“yes"
故障隔离:选择”do
not use IPMI"
安装概要
选择安装语言
安装概要
创建闪回磁盘组
su - oracle
[oracle@rac1 ~]$ dbca
选择集群数据库
创建数据库
用第一项创建数据库
选择管理策略
EM设置
设置管理员密码
定义数据文件存放方式
设置闪回区和归档
Normal 0 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.5pt; mso-bidi-font-size:11.0pt; font-family:"Calibri",sans-serif; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-font-kerning:1.0pt;}
创建schemas
Normal 0 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.5pt; mso-bidi-font-size:11.0pt; font-family:"Calibri",sans-serif; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-font-kerning:1.0pt;}
设置内存
Normal 0 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.5pt; mso-bidi-font-size:11.0pt; font-family:"Calibri",sans-serif; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-font-kerning:1.0pt;}
连接数
Normal 0 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.5pt; mso-bidi-font-size:11.0pt; font-family:"Calibri",sans-serif; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-font-kerning:1.0pt;}
字符集
Normal 0 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.5pt; mso-bidi-font-size:11.0pt; font-family:"Calibri",sans-serif; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-font-kerning:1.0pt;}
链接模式
Normal 0 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.5pt; mso-bidi-font-size:11.0pt; font-family:"Calibri",sans-serif; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-font-kerning:1.0pt;}
数据库存储
Normal 0 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.5pt; mso-bidi-font-size:11.0pt; font-family:"Calibri",sans-serif; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-font-kerning:1.0pt;}
创建数据库
Normal 0 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.5pt; mso-bidi-font-size:11.0pt; font-family:"Calibri",sans-serif; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-font-kerning:1.0pt;}
完成 退出
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31437328/viewspace-2145043/ ,如需转载,请注明出处,否则将追究法律责任。