redhalt6.5+11gTWOnoderac

在E盘新建vm文件夹,vm下新建rac1,rac2,sharedstorage子文件夹。分别用于存放1,2两节点和共享存储磁盘

为了节省空间可以不立即分配磁盘,本次安装用立即分配方式,用了丫100G空间。

Image(27)[18]

Image(28)[5]

Image(29)[5]

Image(30)[4]

Image(31)[4]

Image(32)[4]

Image(33)[4]

很多用桥接的 ,我用的是仅主机模式 即是 host-only 模式 ,

(用crt连接虚拟机几个步骤:1,让Image(34)[4]网卡的ip和rac1在同一网段。

2.做一个操作,点击本地网络属性,共享然后选这个网卡确定。)不出意外,本机crt 可以联通。

Image(35)[4]

Image(36)[4]

Image(37)[4]

Image(38)[4]

Image(39)[4]

Image(40)[4]

更改虚拟机文件,将disk.locking 值改为FALSE  防止一个节点访问共享磁盘时,将共享磁盘锁定 。其他节点访问不了

scsi1:0.deviceType = "disk"
scsi1:0.present = "TRUE"
scsi1:0.fileName = "E:\vm\sharestorage\sharestorage.vmdk"
scsi1:0.mode = "independent-persistent"
ethernet1.present = "TRUE"
ethernet1.connectionType = "hostonly"
ethernet1.virtualDev = "e1000"
ethernet1.wakeOnPcktRcv = "FALSE"
ethernet1.addressType = "generated"
floppy0.present = "FALSE"
disk.locking = "FALSE"
diskLib.dataCacheMaxSize = "0"
scsi1.sharedBus = "virtual"

************************

一大堆图  最后手动分区

11Grac安装

************************

安装rac1  linux

Image(41)[4]

继续

Image(42)[4]

Image(43)[4]

继续。。。。

Image(44)[4]

Image(45)[4]

Image(46)[4]

选定安装磁盘

Image(47)[4]

Image(48)[4]

Image(49)[4]

选手动配置,注意:Image(50)[4]这里一定要配  本次做的时候没有配 是后改的 , 地址和ip在同网段

Image(51)[4]

Image(52)[4]

Image(53)[4]

手动添加一个交换分区  ,大小为物理内存2倍大小。剩下的 分给 / 目录

Image(54)[4]

Image(55)[4]

Image(56)[4]

这中间是自定义包的步骤,忘了配图,如果是高手请自便,如果看不懂 ,那就把出了最后语言的那项包以外的项全都选上吧。

Image(57)[4]

Image(58)[4]

Image(59)[4]

Image(60)[4]

Image(61)[4]

Image(62)[4]

Image(63)[4]

Image(64)[4]

安装vm tools   增强功能  在虚拟机上右键 就能看见

Image(65)[4]

安装tools时 一路回车,一路yes 就行  安装后重启 ,即可自动同步与主机的时间

Image(66)[4]

配置环境 按编辑2 中做  稍后整理

ip 规划
#public IP
136.142.2.100  rac1
136.142.2.101  rac2
#VIP
136.142.2.102  rac1-vip
136.142.2.103  rac2-vip
#privIP
10.10.0.31      rac1-priv
10.10.0.32      rac2-priv
#rac-scan
136.142.2.105   rac-scan
1.创建oracle用户和组
/usr/sbin/groupadd -g 502 oinstall
/usr/sbin/groupadd -g 503 dba
/usr/sbin/groupadd -g 504 oper
/usr/sbin/groupadd -g 505 asmadmin
/usr/sbin/groupadd -g 506 asmoper
/usr/sbin/groupadd -g 507 asmdba
/usr/sbin/useradd -g oinstall -G dba,asmdba,oper oracle
/usr/sbin/useradd -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid
passwd grid
passwd oracle

2.创建安装grid软件和oracle软件的目录,并授予相应的权限
mkdir -p /u01/app/oracle/product/11.2.0/db
mkdir -p /u01/app/grid

mkdir -p /u01/app/11.2.0/grid
chown -R oracle:oinstall /u01/app/
chown -R grid:oinstall /u01/app/grid

chown -R grid:oinstall /u01/app/11.2.0/grid

chmod -R 775 /u01/
3.配置系统文件和进程限制,配置内核参数
cat >> /etc/security/limits.conf <<eof
#ORACLE SETTING
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
EOF
cat >>/etc/pam.d/login<<eof
#ORACLE SETTING
session    required     pam_limits.so
EOF
cat >>/etc/sysctl.conf<<eof
#ORACLE SETTING
fs.aio-max-nr = 1048576
fs.file-max = 6815744
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
EOF
使配置的内核参数生效,使用sysctl -p命令
sysctl -p
4.用户grid的环境变量的设置
grid 用户配置文件 ORACLE_HOSTNAME请自行设置,这个配置使用grid用户
#su - grid
$vi .bash_profile
export PATH
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/11.2.0/grid
export ORACLE_SID=+ASM1</eof
</eof
</eof

export PATH=$PATH:$ORACLE_HOME/bin:./:$ORACLE_HOME/OPatch

stty erase ^h

使用source命令是环境变量生效
source  .bash_profile
6.用户oracle的环境变量的设置
oracle用户配置文件 ORACLE_HOSTNAME请自行设置,这个配置使用oacle用户
#su - oracle
$vi .bash_profile
export PATH
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db
export ORACLE_SID=rac1
export PATH=$PATH:$ORACLE_HOME/bin:./:$ORACLE_HOME/OPatch
stty erase ^h
使用source使环境变量立即生效
source  .bash_profile

检查包:

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 \
unixODBC-devel

运行上面的语句 出来的结果 看看缺那个打那个 

*****************************

用fdisk 命令  将sda 划为两个分区 一个sda1 和sda2 

如果这步前面已做完这步可忽略。检查一下  

*********************************

下面是克隆2节点过程,克隆后会配置共享磁盘

,克隆之前关闭rac1节点。点击右键rac1 点击管理  可以看到克隆 

*********************************

Image(67)[4]

Image(68)[4]

Image(69)[4]

Image(70)[4]

Image(71)[4]

修改克隆后的2节点 hostname为  rac2  :   需要修改 etc/sysconfig/network 文件     

然后更改2节点oracle和grid用户的相应环境变量   “现实1的改成2 ”记得 使其生效     

/etc/udev/rules.d/70-persistent-net.rules

(网卡配置图---借鉴) 

12b46735-9c27-4b07-b351-68400202b1e7[4]

接下来配置共享磁盘

(这里有个小插曲 ,建议一定要在克隆后再在一节点创建20g的共享磁盘,否则克隆时会把你20g的共享磁盘一并克隆  ,看着硬盘空间告警 你会很痛苦)

步骤:

首先在1节点添加20G磁盘,前面做过可参考,不做描述,注意指定到共享存储的文件夹

*************************************************

然后在2节点添加硬盘,选择使用现有磁盘(找到共享文件夹下一节点添加的共享磁盘)配置好后。即完成配置

配置共享磁盘

Image(72)[4]

Image(73)[4]

配置共享存储

ASM共享存储配置过程(Red Hat Linux6.5,oracle11gR2):请仔细执行 星线中间的部分
*****************************************************************************************************************
以root用户执行红字部分的脚本
-------------------------------------------------------------
for i in b c d e f g h i ;
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$i`\", NAME=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\""
done

  1. for i in b c d e   
  2. do  
  3. echo "KERNEL==\"sd*\", SUBSYSTEM==\"block\", PROGRAM==\"/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\", RESULT==\"`/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\", NAME=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\""  
  4. done
执行后有输出
-------------------------------------------------------------
cd /etc/udev/rules.d
vi 99-oracle-asmdevices.rules(将上面的输出添加进去,注意是有返回值的那一行)
start_udev(用于加载规则,启设备)
重启reboot
cd /dev
ls -l asm-disk*  查看是否创建成功
以上过程两个RAC节点分别执行

*****************************************************************************************************************

配好共享存储后我们把软件分别传到虚拟机系统上,分别放在/home/oracle下和/home/grid下  也可以自定义

然后

配置等效性

注意:这里采取手动配置,我们用的是sshUserSetup.sh脚本,位置在grid软件包解压后下的sshsetup文件夹下,找到后同时自己想办法拷贝到2节点

然后用oracle和grid用户分别执行脚本,注意cp到2节点或者cp到oracle 用户下后可能要更改下权限)请仔细

配置ssh等效性:(红字部分是交互部分 ,需要手动输入)

这里我们用的是grid

rac1节点:

[grid@rac1 sshsetup]$ ls
sshUserSetup.sh
[grid@rac1 sshsetup]$ ./sshUserSetup.sh -users grid -hosts rac2 rac1 -noPromptPassphrase
The output of this script is also logged into /tmp/sshUserSetup_2014-07-27-13-05-20.log
Hosts are rac2
user is grid
Platform:- Linux
Checking if the remote hosts are reachable
PING rac2 (136.142.2.101) 56(84) bytes of data.
64 bytes from rac2 (136.142.2.101): icmp_seq=1 ttl=64 time=1.26 ms
64 bytes from rac2 (136.142.2.101): icmp_seq=2 ttl=64 time=0.954 ms
64 bytes from rac2 (136.142.2.101): icmp_seq=3 ttl=64 time=0.859 ms
64 bytes from rac2 (136.142.2.101): icmp_seq=4 ttl=64 time=0.798 ms
64 bytes from rac2 (136.142.2.101): icmp_seq=5 ttl=64 time=0.298 ms
--- rac2 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 0.298/0.833/1.260/0.313 ms
Remote host reachability check succeeded.
The following hosts are reachable: rac2.
The following hosts are not reachable: .
All hosts are reachable. Proceeding further...
firsthost rac2
numhosts 1
The script will setup SSH connectivity from the host rac1 to all
the remote hosts. After the script is executed, the user can use SSH to run
commands on the remote hosts or copy files between this host rac1
and the remote hosts without being prompted for passwords or confirmations.
NOTE 1:
As part of the setup procedure, this script will use ssh and scp to copy
files between the local host and the remote hosts. Since the script does not
store passwords, you may be prompted for the passwords during the execution of
the script whenever ssh or scp is invoked.
NOTE 2:
AS PER SSH REQUIREMENTS, THIS SCRIPT WILL SECURE THE USER HOME DIRECTORY
AND THE .ssh DIRECTORY BY REVOKING GROUP AND WORLD WRITE PRIVILEDGES TO THESE
directories.
Do you want to continue and let the script make the above mentioned changes (yes/no)?
yes
The user chose yes
User chose to skip passphrase related questions.
Creating .ssh directory on local host, if not present already
Creating authorized_keys file on local host
Changing permissions on authorized_keys to 644 on local host
Creating known_hosts file on local host
Changing permissions on known_hosts to 644 on local host
Creating config file on local host
If a config file exists already at /home/grid/.ssh/config, it would be backed up to /home/grid/.ssh/config.backup.
Removing old private/public keys on local host
Running SSH keygen on local host with empty passphrase
Generating public/private rsa key pair.
Your identification has been saved in /home/grid/.ssh/id_rsa.
Your public key has been saved in /home/grid/.ssh/id_rsa.pub.
The key fingerprint is:
8c:5c:5c:34:c0:30:33:ed:6b:91:f7:ae:ab:a4:6b:f6 grid@rac1
The key's randomart image is:
+--[ RSA 1024]----+
|      =+.o+      |
|       =o. .     |
|       .o.       |
|     . ++ .      |
|      o S+ .     |
|        o   .    |
|       ..  .     |
|      oo    .    |
|     oooE.oo     |
+-----------------+
Creating .ssh directory and setting permissions on remote host rac2
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR grid. THIS IS AN SSH REQUIREMENT.
The script would create ~grid/.ssh/config file on remote host rac2. If a config file exists already at ~grid/.ssh/config, it would be backed up to ~grid/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host rac2.
Warning: Permanently added 'rac2,136.142.2.101' (RSA) to the list of known hosts.
grid@rac2's password:
Done with creating .ssh directory and setting permissions on remote host rac2.
Copying local host public key to the remote host rac2
The user may be prompted for a password or passphrase here since the script would be using SCP for host rac2.
grid@rac2's password:
Done copying local host public key to the remote host rac2
SSH setup is complete.
------------------------------------------------------------------------
Verifying SSH setup
===================
The script will now run the date command on the remote nodes using ssh
to verify if ssh is setup correctly. IF THE SETUP IS CORRECTLY SETUP,
THERE SHOULD BE NO OUTPUT OTHER THAN THE DATE AND SSH SHOULD NOT ASK FOR
PASSWORDS. If you see any output other than date or are prompted for the
password, ssh is not setup correctly and you will need to resolve the
issue and set up ssh again.
The possible causes for failure could be:
1. The server settings in /etc/ssh/sshd_config file do not allow ssh
for user grid.
2. The server may have disabled public key based authentication.
3. The client public key on the server may be outdated.
4. ~grid or ~grid/.ssh on the remote host may not be owned by grid.
5. User may not have passed -shared option for shared remote users or
may be passing the -shared option for non-shared remote users.
6. If there is output in addition to the date, but no password is asked,
it may be a security alert shown as part of company policy. Append the
additional text to the /sysman/prov/resources/ignoreMessages.txt file.
------------------------------------------------------------------------
--rac2:--
Running /usr/bin/ssh -x -l grid rac2 date to verify SSH connectivity has been setup from local host to rac2.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
Sun Jul 27 13:05:56 EDT 2014
------------------------------------------------------------------------
SSH verification complete.

rac2节点:

[grid@rac2 ~]$ ls -lrt
total 32
-rw-r--r--. 1 grid oinstall 32343 Jul 27 13:03 sshUserSetup.sh
[grid@rac2 ~]$ chmod 777 sshUserSetup.sh
[grid@rac2 ~]$ ls
sshUserSetup.sh
[grid@rac2 ~]$ ls -lrt
total 32
-rwxrwxrwx. 1 grid oinstall 32343 Jul 27 13:03 sshUserSetup.sh
[grid@rac2 ~]$ ls
sshUserSetup.sh
[grid@rac2 ~]$ ./sshUserSetup.sh -users grid -hosts rac1 rac2 -noPromptPassphrase
The output of this script is also logged into /tmp/sshUserSetup_2014-07-27-13-08-11.log
Hosts are rac1
user is grid
Platform:- Linux
Checking if the remote hosts are reachable
PING rac1 (136.142.2.100) 56(84) bytes of data.
64 bytes from rac1 (136.142.2.100): icmp_seq=1 ttl=64 time=0.724 ms
64 bytes from rac1 (136.142.2.100): icmp_seq=2 ttl=64 time=0.499 ms
64 bytes from rac1 (136.142.2.100): icmp_seq=3 ttl=64 time=0.483 ms
64 bytes from rac1 (136.142.2.100): icmp_seq=4 ttl=64 time=0.528 ms
64 bytes from rac1 (136.142.2.100): icmp_seq=5 ttl=64 time=2.12 ms
--- rac1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 0.483/0.872/2.127/0.633 ms
Remote host reachability check succeeded.
The following hosts are reachable: rac1.
The following hosts are not reachable: .
All hosts are reachable. Proceeding further...
firsthost rac1
numhosts 1
The script will setup SSH connectivity from the host rac2 to all
the remote hosts. After the script is executed, the user can use SSH to run
commands on the remote hosts or copy files between this host rac2
and the remote hosts without being prompted for passwords or confirmations.
NOTE 1:
As part of the setup procedure, this script will use ssh and scp to copy
files between the local host and the remote hosts. Since the script does not
store passwords, you may be prompted for the passwords during the execution of
the script whenever ssh or scp is invoked.
NOTE 2:
AS PER SSH REQUIREMENTS, THIS SCRIPT WILL SECURE THE USER HOME DIRECTORY
AND THE .ssh DIRECTORY BY REVOKING GROUP AND WORLD WRITE PRIVILEDGES TO THESE
directories.
Do you want to continue and let the script make the above mentioned changes (yes/no)?
yes
The user chose yes
User chose to skip passphrase related questions.
Creating .ssh directory on local host, if not present already
Creating authorized_keys file on local host
Changing permissions on authorized_keys to 644 on local host
Creating known_hosts file on local host
Changing permissions on known_hosts to 644 on local host
Creating config file on local host
If a config file exists already at /home/grid/.ssh/config, it would be backed up to /home/grid/.ssh/config.backup.
Removing old private/public keys on local host
Running SSH keygen on local host with empty passphrase
Generating public/private rsa key pair.
Your identification has been saved in /home/grid/.ssh/id_rsa.
Your public key has been saved in /home/grid/.ssh/id_rsa.pub.
The key fingerprint is:
e4:89:ea:a9:8f:0b:5d:9e:24:42:c3:83:c1:84:a8:23 grid@rac2
The key's randomart image is:
+--[ RSA 1024]----+
|*.               |
|=o               |
|o=      .        |
|E o    + .       |
|o.. o . S        |
| o = o           |
|. . +            |
| . o .           |
|  +++            |
+-----------------+
Creating .ssh directory and setting permissions on remote host rac1
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR grid. THIS IS AN SSH REQUIREMENT.
The script would create ~grid/.ssh/config file on remote host rac1. If a config file exists already at ~grid/.ssh/config, it would be backed up to ~grid/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host rac1.
Warning: Permanently added 'rac1,136.142.2.100' (RSA) to the list of known hosts.
grid@rac1's password:
Done with creating .ssh directory and setting permissions on remote host rac1.
Copying local host public key to the remote host rac1
The user may be prompted for a password or passphrase here since the script would be using SCP for host rac1.
grid@rac1's password:
Done copying local host public key to the remote host rac1
SSH setup is complete.
------------------------------------------------------------------------
Verifying SSH setup
===================
The script will now run the date command on the remote nodes using ssh
to verify if ssh is setup correctly. IF THE SETUP IS CORRECTLY SETUP,
THERE SHOULD BE NO OUTPUT OTHER THAN THE DATE AND SSH SHOULD NOT ASK FOR
PASSWORDS. If you see any output other than date or are prompted for the
password, ssh is not setup correctly and you will need to resolve the
issue and set up ssh again.
The possible causes for failure could be:
1. The server settings in /etc/ssh/sshd_config file do not allow ssh
for user grid.
2. The server may have disabled public key based authentication.
3. The client public key on the server may be outdated.
4. ~grid or ~grid/.ssh on the remote host may not be owned by grid.
5. User may not have passed -shared option for shared remote users or
may be passing the -shared option for non-shared remote users.
6. If there is output in addition to the date, but no password is asked,
it may be a security alert shown as part of company policy. Append the
additional text to the /sysman/prov/resources/ignoreMessages.txt file.
------------------------------------------------------------------------
--rac1:--
Running /usr/bin/ssh -x -l grid rac1 date to verify SSH connectivity has been setup from local host to rac1.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
Sun Jul 27 13:08:29 EDT 2014
------------------------------------------------------------------------
SSH verification complete.

配置oracle等效性:

rac1节点:

[oracle@rac1 ~]$ ./sshUserSetup.sh -users oracle -hosts rac2 rac1 -noPromptPassphrase
The output of this script is also logged into /tmp/sshUserSetup_2014-07-27-13-13-40.log
Hosts are rac2
user is oracle
Platform:- Linux
Checking if the remote hosts are reachable
PING rac2 (136.142.2.101) 56(84) bytes of data.
64 bytes from rac2 (136.142.2.101): icmp_seq=1 ttl=64 time=0.403 ms
64 bytes from rac2 (136.142.2.101): icmp_seq=2 ttl=64 time=0.420 ms
64 bytes from rac2 (136.142.2.101): icmp_seq=3 ttl=64 time=0.448 ms
64 bytes from rac2 (136.142.2.101): icmp_seq=4 ttl=64 time=0.377 ms
64 bytes from rac2 (136.142.2.101): icmp_seq=5 ttl=64 time=0.400 ms
--- rac2 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4003ms
rtt min/avg/max/mdev = 0.377/0.409/0.448/0.032 ms
Remote host reachability check succeeded.
The following hosts are reachable: rac2.
The following hosts are not reachable: .
All hosts are reachable. Proceeding further...
firsthost rac2
numhosts 1
The script will setup SSH connectivity from the host rac1 to all
the remote hosts. After the script is executed, the user can use SSH to run
commands on the remote hosts or copy files between this host rac1
and the remote hosts without being prompted for passwords or confirmations.
NOTE 1:
As part of the setup procedure, this script will use ssh and scp to copy
files between the local host and the remote hosts. Since the script does not
store passwords, you may be prompted for the passwords during the execution of
the script whenever ssh or scp is invoked.
NOTE 2:
AS PER SSH REQUIREMENTS, THIS SCRIPT WILL SECURE THE USER HOME DIRECTORY
AND THE .ssh DIRECTORY BY REVOKING GROUP AND WORLD WRITE PRIVILEDGES TO THESE
directories.
Do you want to continue and let the script make the above mentioned changes (yes/no)?
yes
The user chose yes
User chose to skip passphrase related questions.
Creating .ssh directory on local host, if not present already
Creating authorized_keys file on local host
Changing permissions on authorized_keys to 644 on local host
Creating known_hosts file on local host
Changing permissions on known_hosts to 644 on local host
Creating config file on local host
If a config file exists already at /home/oracle/.ssh/config, it would be backed up to /home/oracle/.ssh/config.backup.
Removing old private/public keys on local host
Running SSH keygen on local host with empty passphrase
Generating public/private rsa key pair.
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:
3d:88:0a:78:29:91:f5:43:75:36:3c:b9:6f:5a:5b:61 oracle@rac1
The key's randomart image is:
+--[ RSA 1024]----+
|  . ....+.       |
| o o   o+.       |
|o   o    o       |
| o . . ..o  E    |
|o +   . S.o. .   |
| o . .    +..    |
|    .    + o     |
|        . .      |
|                 |
+-----------------+
Creating .ssh directory and setting permissions on remote host rac2
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR oracle. THIS IS AN SSH REQUIREMENT.
The script would create ~oracle/.ssh/config file on remote host rac2. If a config file exists already at ~oracle/.ssh/config, it would be backed up to ~oracle/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host rac2.
Warning: Permanently added 'rac2,136.142.2.101' (RSA) to the list of known hosts.
oracle@rac2's password:
Done with creating .ssh directory and setting permissions on remote host rac2.
Copying local host public key to the remote host rac2
The user may be prompted for a password or passphrase here since the script would be using SCP for host rac2.
oracle@rac2's password:
Done copying local host public key to the remote host rac2
SSH setup is complete.
------------------------------------------------------------------------
Verifying SSH setup
===================
The script will now run the date command on the remote nodes using ssh
to verify if ssh is setup correctly. IF THE SETUP IS CORRECTLY SETUP,
THERE SHOULD BE NO OUTPUT OTHER THAN THE DATE AND SSH SHOULD NOT ASK FOR
PASSWORDS. If you see any output other than date or are prompted for the
password, ssh is not setup correctly and you will need to resolve the
issue and set up ssh again.
The possible causes for failure could be:
1. The server settings in /etc/ssh/sshd_config file do not allow ssh
for user oracle.
2. The server may have disabled public key based authentication.
3. The client public key on the server may be outdated.
4. ~oracle or ~oracle/.ssh on the remote host may not be owned by oracle.
5. User may not have passed -shared option for shared remote users or
may be passing the -shared option for non-shared remote users.
6. If there is output in addition to the date, but no password is asked,
it may be a security alert shown as part of company policy. Append the
additional text to the /sysman/prov/resources/ignoreMessages.txt file.
------------------------------------------------------------------------
--rac2:--
Running /usr/bin/ssh -x -l oracle rac2 date to verify SSH connectivity has been setup from local host to rac2.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
Sun Jul 27 13:13:53 EDT 2014
------------------------------------------------------------------------
SSH verification complete.

rac2节点:

[oracle@rac2 ~]$ ./sshUserSetup.sh -users oracle -hosts rac1 rac2 -noPromptPassphrase
The output of this script is also logged into /tmp/sshUserSetup_2014-07-27-13-14-40.log
Hosts are rac1
user is oracle
Platform:- Linux
Checking if the remote hosts are reachable
PING rac1 (136.142.2.100) 56(84) bytes of data.
64 bytes from rac1 (136.142.2.100): icmp_seq=1 ttl=64 time=0.569 ms
64 bytes from rac1 (136.142.2.100): icmp_seq=2 ttl=64 time=0.452 ms
64 bytes from rac1 (136.142.2.100): icmp_seq=3 ttl=64 time=0.429 ms
64 bytes from rac1 (136.142.2.100): icmp_seq=4 ttl=64 time=0.470 ms
64 bytes from rac1 (136.142.2.100): icmp_seq=5 ttl=64 time=0.366 ms
--- rac1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4001ms
rtt min/avg/max/mdev = 0.366/0.457/0.569/0.067 ms
Remote host reachability check succeeded.
The following hosts are reachable: rac1.
The following hosts are not reachable: .
All hosts are reachable. Proceeding further...
firsthost rac1
numhosts 1
The script will setup SSH connectivity from the host rac2 to all
the remote hosts. After the script is executed, the user can use SSH to run
commands on the remote hosts or copy files between this host rac2
and the remote hosts without being prompted for passwords or confirmations.
NOTE 1:
As part of the setup procedure, this script will use ssh and scp to copy
files between the local host and the remote hosts. Since the script does not
store passwords, you may be prompted for the passwords during the execution of
the script whenever ssh or scp is invoked.
NOTE 2:
AS PER SSH REQUIREMENTS, THIS SCRIPT WILL SECURE THE USER HOME DIRECTORY
AND THE .ssh DIRECTORY BY REVOKING GROUP AND WORLD WRITE PRIVILEDGES TO THESE
directories.
Do you want to continue and let the script make the above mentioned changes (yes/no)?
yes
The user chose yes
User chose to skip passphrase related questions.
Creating .ssh directory on local host, if not present already
Creating authorized_keys file on local host
Changing permissions on authorized_keys to 644 on local host
Creating known_hosts file on local host
Changing permissions on known_hosts to 644 on local host
Creating config file on local host
If a config file exists already at /home/oracle/.ssh/config, it would be backed up to /home/oracle/.ssh/config.backup.
Removing old private/public keys on local host
Running SSH keygen on local host with empty passphrase
Generating public/private rsa key pair.
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:
a8:13:09:b0:df:31:f5:7c:eb:4e:4e:3a:35:0d:60:87 oracle@rac2
The key's randomart image is:
+--[ RSA 1024]----+
|.     .  .       |
| o   . oE .      |
|. . o  .oo.      |
| . o + . ...     |
|  . + . S .o     |
|     o   .o .    |
|    o    .+.     |
|     .  .*       |
|        ..o      |
+-----------------+
Creating .ssh directory and setting permissions on remote host rac1
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR oracle. THIS IS AN SSH REQUIREMENT.
The script would create ~oracle/.ssh/config file on remote host rac1. If a config file exists already at ~oracle/.ssh/config, it would be backed up to ~oracle/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host rac1.
Warning: Permanently added 'rac1,136.142.2.100' (RSA) to the list of known hosts.
oracle@rac1's password:
Done with creating .ssh directory and setting permissions on remote host rac1.
Copying local host public key to the remote host rac1
The user may be prompted for a password or passphrase here since the script would be using SCP for host rac1.
oracle@rac1's password:
Done copying local host public key to the remote host rac1
SSH setup is complete.
------------------------------------------------------------------------
Verifying SSH setup
===================
The script will now run the date command on the remote nodes using ssh
to verify if ssh is setup correctly. IF THE SETUP IS CORRECTLY SETUP,
THERE SHOULD BE NO OUTPUT OTHER THAN THE DATE AND SSH SHOULD NOT ASK FOR
PASSWORDS. If you see any output other than date or are prompted for the
password, ssh is not setup correctly and you will need to resolve the
issue and set up ssh again.
The possible causes for failure could be:
1. The server settings in /etc/ssh/sshd_config file do not allow ssh
for user oracle.
2. The server may have disabled public key based authentication.
3. The client public key on the server may be outdated.
4. ~oracle or ~oracle/.ssh on the remote host may not be owned by oracle.
5. User may not have passed -shared option for shared remote users or
may be passing the -shared option for non-shared remote users.
6. If there is output in addition to the date, but no password is asked,
it may be a security alert shown as part of company policy. Append the
additional text to the /sysman/prov/resources/ignoreMessages.txt file.
------------------------------------------------------------------------
--rac1:--
Running /usr/bin/ssh -x -l oracle rac1 date to verify SSH connectivity has been setup from local host to rac1.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
Sun Jul 27 13:14:57 EDT 2014
------------------------------------------------------------------------
SSH verification complete.

一定要仔细反复用ssh date rac1 ,ssh date rac2 验证 直到不用输入密码 为止

检测安装环境:

./runcluvfy.sh stage -pre crsinst -n rac1,rac2 -r 11gR2 -verbose    检测后如果看不懂就装吧。

边装边解决问题

Image(74)[4]

Image(75)[4]

选高级安装

Image(76)[4]

Image(77)[4]

注意dns 解析方式 要在配置网卡信息的是有加入路由getway  参数   (在此遇见了错误)没有在文件中配置getway

如果你非要研究研究 GNS解析 也可以搞一下 添入你已经设定好的scan 名字

Image(78)[4]

1,注意vip私有ip 名字  要有  -     在此遇见了错误。       

2,在grid 后面的密码 写入设定好的grid 密码

3,先后test测试等效性是否可行,如果通过择下一步进行 ,如果报错则用setup 自动配置如果steup 反复几次不通,则返回之前步骤 进行手动配置ssh等效性。注意返回手动配置时 图形界面不用关闭 ,配好可回来继续。 指导test通过  (看人品)

先用test测试

Image(79)[4]

注意有没有网卡掉电     此处出现了虚拟机网卡掉电(如果这步出现问题 ,返回看看虚拟机网卡是不是丢失了,如果没了 相办法恢复 多半ifup 一下就行)

Image(80)[4]

Image(81)[4]

注意选择筛选条件    默认是/dev/raw*

根据自己构建情况更改

Image(82)[4]

Image(83)[4]

Image(84)[4]

Image(85)[4]

注意grid安装目录不要是BASE的子目录否则11G安装会报错

Image(86)[4]

Image(87)[4]

Image(88)[4]

Image(89)[4]

安装至此 希望 一切好运

Image(90)[4]

终于到了。。。。。。。。

两个节点依次用root 执行脚本。一个节点执行完两个之后再到另一个节点执行

1节点执行两个脚本状态,留作对比:

[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
Performing root user operation for Oracle 11g
The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/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...
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: /u01/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
  peer user cert
  pa user cert
Adding Clusterware entries to upstart
CRS-2672: Attempting to start 'ora.mdnsd' on 'rac1'
CRS-2676: Start of 'ora.mdnsd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'rac1'
CRS-2676: Start of 'ora.gpnpd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac1'
CRS-2672: Attempting to start 'ora.gipcd' on 'rac1'
CRS-2676: Start of 'ora.gipcd' on 'rac1' succeeded
CRS-2676: Start of 'ora.cssdmonitor' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'rac1'
CRS-2672: Attempting to start 'ora.diskmon' on 'rac1'
CRS-2676: Start of 'ora.diskmon' on 'rac1' succeeded
CRS-2676: Start of 'ora.cssd' on 'rac1' succeeded
ASM created and started successfully.
Disk Group DATA 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 a5b4d76091394f72bfbb723d09e2d142.
Successfully replaced voting disk group with +DATA.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
1. ONLINE   a5b4d76091394f72bfbb723d09e2d142 (/dev/asm-diskb) [DATA]
Located 1 voting disk(s).
CRS-2672: Attempting to start 'ora.asm' on 'rac1'
CRS-2676: Start of 'ora.asm' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.DATA.dg' on 'rac1'
CRS-2676: Start of 'ora.DATA.dg' on 'rac1' succeeded
Preparing packages for installation...
cvuqdisk-1.0.9-1
Configure Oracle Grid Infrastructure for a Cluster ... succeeded

rac2节点执行两个脚本状态,留备对比查看。

[root@rac2 ~]# /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@rac2 ~]# /u01/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=  /u01/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...
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: /u01/app/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
OLR initialization - successful
Adding Clusterware entries to upstart
CRS-4402: The CSS daemon was started in exclusive mode but found an active CSS daemon on node rac1, number 1, and is terminating
An active cluster was found during exclusive startup, restarting to join the cluster
Preparing packages for installation...
cvuqdisk-1.0.9-1
Configure Oracle Grid Infrastructure for a Cluster ... succeeded

****************************************************************************

****************************************************************************

如果运行完脚本没有问题那回去继续点图形界面吧,这时候已经98%可以收获胜利果实了。NICE 

****************************************************************************

****************************************************************************

至此。grid 成功安装完毕。2014/7/28/ 4:33   分。

****************************

检查

[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    rac1      
ora.asm        ora.asm.type   ONLINE    ONLINE    rac1      
ora.cvu        ora.cvu.type   ONLINE    ONLINE    rac1      
ora.gsd        ora.gsd.type   OFFLINE   OFFLINE             
ora....network ora....rk.type ONLINE    ONLINE    rac1      
ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    rac1      
ora.ons        ora.ons.type   ONLINE    ONLINE    rac1      
ora....SM1.asm application    ONLINE    ONLINE    rac1      
ora....C1.lsnr application    ONLINE    ONLINE    rac1      
ora.rac1.gsd   application    OFFLINE   OFFLINE             
ora.rac1.ons   application    ONLINE    ONLINE    rac1      
ora.rac1.vip   ora....t1.type ONLINE    ONLINE    rac1      
ora....SM2.asm application    ONLINE    ONLINE    rac2      
ora....C2.lsnr application    ONLINE    ONLINE    rac2      
ora.rac2.gsd   application    OFFLINE   OFFLINE             
ora.rac2.ons   application    ONLINE    ONLINE    rac2      
ora.rac2.vip   ora....t1.type ONLINE    ONLINE    rac2      
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    rac1

******************************************************

接下来继续努力安装database oracle数据库软件

******************************************************

解压缩oracle软件包在/home/oracle下安装database

Image(91)[4]

Image(92)[4]

验证ssh等效性oracle用户

Image(93)[4]ok

Image(94)[4]ok

Image(95)[4]

Image(96)[4]

Image(97)[4]

Image(98)[4]

Image(99)[4]

选企业版

Image(100)[4]

Image(101)[4]

上面这个是错的  。fuck11G   database 的安装目录 又必须得让ORACLE_HOME在ORACLE_BASE子目录下面  注意注意

额  少了一张图

选好路径下一步是确定dba组  前期用户组配置正确默认可以选好 下一步就行。

Image(102)[4]

事实证明 少pdksh-5.2.14 这个包 是可以安装成功的 在此忽略

Image(103)[4]

Image(104)[4]

rac1:

[root@rac1 ~]# /u01/app/oracle/product/11.2.0/db/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
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.

rac2:

[root@rac2 ~]# /u01/app/oracle/product/11.2.0/db/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
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.

脚本成功运行后,回到图形界面继续  操作直至成功现实

******************************************

成功安装database软件。good   很是顺利

******************************************


dbca建库

cd $ORACLE_HOME/dbca 下 通过xmanager调用图形界面    oracle用户下 执行export DISPLAY=本机ip (虚拟机搭建此处为虚拟机1网卡ip):0.0(根据xmanager版本确定)  export DISPLAY=136.142.2.59:0.0     例子

Image(105)[4]

Image(106)[4]

选择通用模式建库

Image(107)[4]

选择全部节点

Image(108)[4]

Image(109)[4]

选择统一密码:

Image(110)[4]

选择OMF文件管理:

Image(111)[4]

输入asmsnmp 用户密码,在前面安装grid时设置为oracle

Image(112)[4]

是否采用 flash recover area

Image(113)[4]

Image(114)[4]

内存,数据块,字符集,连接模式配置

Image(115)[4]

Image(116)[4]

用ZH16 中文字符集

Image(117)[4]

Image(118)[4]

看好继续********************************

生成建库脚本,指定路径

Image(119)[4]

Image(120)[4]

等待安装结束

Image(121)[4]

*************************************************************************************

等待100% 至此  整个rac 搭建成功

*************************************************************************

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29540871/viewspace-1850597/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29540871/viewspace-1850597/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值