27. 为了保证安装顺利,请点选下列组件以确保相关必要工具存在:
?Desktop Environments > GNOME Desktop Environment
?Applications > Editors
?Applications > Graphical Internet
?Development > Development Libraries
?Development > Development Tools
?Servers > Server Configuration Tools
?Base System > Administration Tools
?Base System > Base
?Base System > System Tools
?Base System > X Window System
Next.
40. Oracle 安装前预设置:
在操作系统安装后,还需要对系统进行进一步设置安装以满足 Oracle
安装需要。使用 root 登陆 tony1。
1.修改/etc/hosts 文件
[root@tony1 ~]# vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
#tony1
192.168.8.20 tony1.yellowsand.com tony1
192.168.8.22 tony1-vip.yellowsand.com tony1-vip
41. 10.10.10.2 tony1-priv.yellowsand.com tony1-priv
#tony2
192.168.8.21 tony2.yellowsand.com tony2
192.168.8.23 tony2-vip.yellowsand.com tony2-vip
10.10.10.3 tony2-priv.yellowsand.com tony2-priv
#scan ip
192.168.8.202 scan-cluster.yellow_sand.com scan-cluster
2.添加用户、用户组
配置 11g R2 RAC 需要安装 Oracle Grid Infrastructure 软件、
Oracle 数据库软件,其中 Grid 软件件等同于 10g Oracle 的
Clusterware 集群件。Oracle 建议不同的用户分别安装 Grid
Infrastructure 软件、Oracle 数据库软件, grid 用户安装 Oracle
Grid Infrastructure ,oracle 用户安装 Oracle 数据库。 并且
grid、oracle 用户需要属于不同的用户组。在配置 RAC 时,还需求这
两个用户在 RAC 的不同节点上 UID, GID 要一致。用户、组的对应信
息表。
Group Name Group ID Group Info Oracle User(400) Grid User(500)
oinstall 4000 Inventory Group Y Y
dba 4001 OSDBA Group Y
oper 4002 OSOPER Group Y
asmadmin 5000 OSASM Y
asmdba 5001 OSDBA for ASM Y Y
asmoper 5002 OSOPER for ASM Y
42. groupadd -g 4000 oinstall
groupadd -g 4001 dba
groupadd -g 4002 oper
groupadd -g 5000 asmadmin
groupadd -g 5001 asmdba
groupadd -g 5002 asmoper
useradd -u 500 -g oinstall -G asmadmin,asmdba,asmoper -d /home/gird -s /bin/bash -c "Grid
Infrastructure Owner" grid
useradd -u 400 -g oinstall -G dba,oper,asmdba -d /home/oracle -s /bin/bash -c "Oracle Software
Owner" oracle
user grid, password is oracle
[root@tony1 ~]# passwd grid
Changing password for user grid.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@tony1 ~]# passwd oracle
Changing password for user oracle.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
3.建立 Oracle 对应文件目录
mkdir /u01
mkdir /g01
mkdir -p /u01/app/oracle
mkdir -p /g01/app/grid
chown –R oracle:oinstall /u01
chown -R grid:oinstall /g01
43. 4.检查网络状态
service iptables status
service ntpd status
因为 Oracle Cluster Time Synchronization Service (ctssd)能同步 RAC 节点时间。因此
禁用 NTP 且清理相关文件:
chkconfig ntpd off
mv /etc/ntp.conf /etc/ntp.conf.orig
rm /var/run/ntpd.pid
[root@tony1 ~]# service iptables status
Firewall is stopped.
[root@tony1 ~]# service ntpd status
ntpd is stopped
[root@tony1 ~]# ls /etc/ntp.conf
/etc/ntp.conf
[root@tony1 ~]# mv /etc/ntp.conf /etc/ntp.conf.orig
[root@tony1 ~]# rm /var/run/ntpd.pid
rm: cannot lstat `/var/run/ntpd.pid': No such file or directory
5.配置 grid profile
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_SID=+ASM1 在节点 2 上修改成 ASM2
export ORACLE_BASE=/g01/app/grid
export ORACLE_HOME=/g01/app/11.2.0/grid
export ORACLE_TERM=xterm
export NLS_DATE_FORMAT='yyyy/mm/dd hh24:mi:ss'
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JER:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export EDITOR=vi
45. [root@tony1 media]# mount /dev/cdrom /media/disk
mount: block device /dev/cdrom is write-protected, mounting read-only
2) 检查是否以安装 yum 并设置
# rpm -q yum
# touch /etc/yum.repos.d/public-yum-el5u7.repo
# vi /etc/yum.repos.d/public-yum-oel5u7.repo
[root@tony1 media]# rpm -q yum
yum-3.2.22-37.0.1.el5
[root@tony1 media]# touch /etc/yum.repos.d/public-yum-el5u7.repo
[root@tony1 media]# vi /etc/yum.repos.d/public-yum-el5u7.repo
[oel5u7]
name = Oracle Enterprise Linux 5.7-64bit DVD
baseurl=file:///media/disk/Server/
gpgcheck=0
enable=1
3) 安装 oracle-validated 包并检查其安装配置
# yum install oracle-validated
46. [root@tony1 media]# yum install oracle-validated
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
oel5u7 | 1.1 kB 00:00
oel5u7/primary | 1.4 MB 00:00
oel5u7 3275/3275
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package oracle-validated.x86_64 0:1.1.0-14.el5 set to be updated
oel5u7/filelists | 3.1 MB 00:01
--> Processing Dependency: sysstat for package: oracle-validated
--> Processing Dependency: /usr/lib/libaio.so for package: oracle-validated
--> Processing Dependency: unixODBC-devel for package: oracle-validated
--> Processing Dependency: /usr/lib64/libodbccr.so for package: oracle-validated
--> Processing Dependency: libaio-devel for package: oracle-validated
--> Processing Dependency: /usr/lib/libodbc.so.1 for package: oracle-validated
--> Processing Dependency: /usr/lib64/libaio.so for package: oracle-validated
--> Processing Dependency: /usr/lib/libodbccr.so for package: oracle-validated
--> Processing Dependency: libXp.so.6 for package: oracle-validated
--> Processing Dependency: libdb-4.2.so()(64bit) for package: oracle-validated
--> Processing Dependency: libodbc.so.1()(64bit) for package: oracle-validated
--> Running transaction check
---> Package compat-db.x86_64 0:4.2.52-5.1 set to be updated
---> Package libXp.i386 0:1.0.0-8.1.el5 set to be updated
---> Package libaio-devel.i386 0:0.3.106-5 set to be updated
---> Package libaio-devel.x86_64 0:0.3.106-5 set to be updated
---> Package sysstat.x86_64 0:7.0.2-11.el5 set to be updated
---> Package unixODBC.i386 0:2.2.11-7.1 set to be updated
---> Package unixODBC.x86_64 0:2.2.11-7.1 set to be updated
---> Package unixODBC-devel.i386 0:2.2.11-7.1 set to be updated
---> Package unixODBC-devel.x86_64 0:2.2.11-7.1 set to be updated
--> Finished Dependency Resolution
47. Dependencies Resolved
================================================================================================
====================================================
Package Arch Version Repository Size
================================================================================================
====================================================
Installing:
oracle-validated x86_64 1.1.0-14.el5 oel5u7 24 k
Installing for dependencies:
compat-db x86_64 4.2.52-5.1 oel5u7 1.6 M
libXp i386 1.0.0-8.1.el5 oel5u7 22 k
libaio-devel i386 0.3.106-5 oel5u7 12 k
libaio-devel x86_64 0.3.106-5 oel5u7 11 k
sysstat x86_64 7.0.2-11.el5 oel5u7 187 k
unixODBC i386 2.2.11-7.1 oel5u7 830 k
unixODBC x86_64 2.2.11-7.1 oel5u7 835 k
unixODBC-devel i386 2.2.11-7.1 oel5u7 743 k
unixODBC-devel x86_64 2.2.11-7.1 oel5u7 799 k
Transaction Summary
================================================================================================
====================================================
Install 10 Package(s)
Upgrade 0 Package(s)
Total download size: 5.0 M
Is this ok [y/N]: y
Downloading Packages:
------------------------------------------------------------------------------------------------
----------------------------------------------------
Total 250 MB/s | 5.0 MB 00:00
Running rpm_check_debug
Running Transaction Test
91. Tony1
[root@tony1 g01]# /g01/app/oraInventory/orainstRoot.sh
Changing permissions of /g01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /g01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@tony1 g01]#
[root@tony1 g01]# /g01/app/11.2.0/grid/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /g01/app/11.2.0/grid
Enter the full pathname of the local bin directory: [/usr/local/bin]:
92. Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
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.
Using configuration parameter file: /g01/app/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
OLR initialization - successful
root wallet
root wallet cert
root cert export
peer wallet
profile reader wallet
pa wallet
peer wallet keys
pa wallet keys
peer cert request
pa cert request
peer cert
pa cert
peer root cert TP
profile reader root cert TP
pa root cert TP
peer pa cert TP
pa peer cert TP
profile reader pa cert TP
profile reader peer cert TP
93. peer user cert
pa user cert
Adding Clusterware entries to inittab
CRS-2672: Attempting to start 'ora.mdnsd' on 'tony1'
CRS-2676: Start of 'ora.mdnsd' on 'tony1' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'tony1'
CRS-2676: Start of 'ora.gpnpd' on 'tony1' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'tony1'
CRS-2672: Attempting to start 'ora.gipcd' on 'tony1'
CRS-2676: Start of 'ora.gipcd' on 'tony1' succeeded
CRS-2676: Start of 'ora.cssdmonitor' on 'tony1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'tony1'
CRS-2672: Attempting to start 'ora.diskmon' on 'tony1'
CRS-2676: Start of 'ora.diskmon' on 'tony1' succeeded
CRS-2676: Start of 'ora.cssd' on 'tony1' succeeded
ASM created and started successfully.
Disk Group GRIDDG created successfully.
clscfg: -install mode specified
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4256: Updating the profile
Successful addition of voting disk 77e0b000bb3c4ff5bf19fd8344c5719e.
Successful addition of voting disk 368ed4194dd94f22bf24a89769045fd1.
Successful addition of voting disk 90731ae3a8a34fd0bf7d4ccf694742b7.
Successfully replaced voting disk group with +GRIDDG.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
94. 1. ONLINE 77e0b000bb3c4ff5bf19fd8344c5719e (/dev/asm-diskb) [GRIDDG]
2. ONLINE 368ed4194dd94f22bf24a89769045fd1 (/dev/asm-diskc) [GRIDDG]
3. ONLINE 90731ae3a8a34fd0bf7d4ccf694742b7 (/dev/asm-diskd) [GRIDDG]
Located 3 voting disk(s).
CRS-2672: Attempting to start 'ora.asm' on 'tony1'
CRS-2676: Start of 'ora.asm' on 'tony1' succeeded
CRS-2672: Attempting to start 'ora.GRIDDG.dg' on 'tony1'
CRS-2676: Start of 'ora.GRIDDG.dg' on 'tony1' succeeded
Configure Oracle Grid Infrastructure for a Cluster ... succeeded
Tony2
[root@tony2 g01]# /g01/app/oraInventory/orainstRoot.sh
Changing permissions of /g01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /g01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@tony2 g01]#
[root@tony2 g01]# /g01/app/11.2.0/grid/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /g01/app/11.2.0/grid
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
95. 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.
Using configuration parameter file: /g01/app/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
OLR initialization - successful
Adding Clusterware entries to inittab
CRS-4402: The CSS daemon was started in exclusive mode but found an active CSS daemon on node
tony1, number 1, and is terminating
An active cluster was found during exclusive startup, restarting to join the cluster
Configure Oracle Grid Infrastructure for a Cluster ... succeeded
安装时可以查看一下文件:
#/g01/app/11.2.0/grid/log/tony1/cssd
# tail -f ocssd.log
每个节点都执行完后,就可以回到 1 节点,点 OK 继续之后的安装。
97. crsctl stat res -t
crsctl query crs activeversion
crsctl check crs
crsctl check cluster
[grid@tony1 ~]$ asmcmd
ASMCMD> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks
Voting_files Name
MOUNTED NORMAL N 512 4096 1048576 15360 14434 5120 4657 0 Y GRIDDG/
ASMCMD> exit
[grid@tony1 ~]$
[grid@tony1 ~]$
[grid@tony1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.GRIDDG.dg
113. 节点 1:
[root@tony1 db_1]# /u01/app/oracle/product/11.2.0/db_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/db_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.
114. 节点 2
[root@tony2 g01]# /u01/app/oracle/product/11.2.0/db_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/db_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.