Oracle安装部署之linux(redhat/centos)快速安装oracle 11g rac
安装oracle 11gR2 RAC
一、网络规划及安装虚拟主机
主机名 |
主机版本 |
Ip |
rac1.localdomain |
Redhat 6.5 RAC节点1 |
192.168.100.11 |
rac2.localdomain |
Redhat 6.5 RAC节点2 |
192.168.100.12 |
Loaclhost.localdomain |
Redhat 5.8 DNS服务器 |
192.168.100.9 |
Short hostname |
type |
Ip address |
interface |
rac1 |
Public ip |
192.168.100.11 |
Eth0 |
rac1-vip |
Virtul ip |
192.168.100.13 |
Eth0:1 |
rac1-priv |
Private ip |
192.168.10.11 |
Eth1 |
rac2 |
Public ip |
192.168.100.12 |
Eth0 |
rac2-vip |
Virtul ip |
192.168.100.14 |
Eth0:1 |
rac2-priv |
Private ip |
192.168.10.12 |
Eth1 |
Scancluster |
Scan ip |
192.168.100.10 |
Eth0 |
二、RAC 安装前期配置
1、配置/etc/host文件(rac1、rac2上执行)
127.0.0.1 localhost
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
#rac1
192.168.100.11 rac1
192.168.100.13 rac1-vip
192.168.10.11 rac1-priv
#rac2
192.168.100.12 rac2
192.168.100.14 rac2-vip
192.168.10.12 rac2-priv
#scan-ip
192.168.100.10 scan-cluster
2、配置DNS服务器,解析scan ip(rhel5.8上执行)
1)安装dns包
[root@localhost mnt]# ll
total 1112
-rw-r--r-- 1 root root 1012559 Jan 22 11:11 bind-9.3.6-20.P1.el5.x86_64.rpm
-rw-r--r-- 1 root root 47941 Jan 22 11:14 bind-chroot-9.3.6-20.P1.el5.x86_64.rpm
-rw-r--r-- 1 root root 64667 Jan 22 11:11 caching-nameserver-9.3.6-20.P1.el5.x86_64.rpm
[root@localhost mnt]# rpm -ivh bind-9.3.6-20.P1.el5.x86_64.rpm
[root@localhost mnt]# rpm -ivh bind-chroot-9.3.6-20.P1.el5.x86_64.rpm
[root@localhost mnt]# rpm -ivh caching-nameserver-9.3.6-20.P1.el5.x86_64.rpm
2)配置named.conf文件
生成named.conf文件:
[root@localhost mnt]# cd /var/named/chroot/etc/
[root@localhost etc]# ll
total 24
-rw-r--r-- 1 root root 3519 Feb 27 2006 localtime
-rw-r----- 1 root named 1230 Dec 2 2011 named.caching-nameserver.conf
-rw-r----- 1 root named 955 Dec 2 2011 named.rfc1912.zones
-rw-r----- 1 root named 113 Jan 22 10:51 rndc.key
[root@localhost etc]# cp -p named.caching-nameserver.conf named.conf
[root@localhost etc]# ll
total 28
-rw-r--r-- 1 root root 3519 Feb 27 2006 localtime
-rw-r----- 1 root named 1230 Dec 2 2011 named.caching-nameserver.conf
-rw-r----- 1 root named 1230 Dec 2 2011 named.conf
-rw-r----- 1 root named 955 Dec 2 2011 named.rfc1912.zones
-rw-r----- 1 root named 113 Jan 22 10:51 rndc.key
配置named.conf文件:
[root@localhost etc]# vim named.conf
将127.0.0.1和localhost全部改成any。
3)配置named.rfc1912.zones文件
[root@localhost etc]# vim named.rfc1912.zones --在最后添加下面内容
zone "100.168.192.in-addr.arpa" IN {
type master;
file "100.168.192.in-addr.arpa";
allow-update { none; };
};
4)生成正反向解析数据库文件
[root@localhost named]# pwd
/var/named/chroot/var/named
[root@localhost named]# ll
total 44
drwxrwx--- 2 named named 4096 Aug 26 2004 data
-rw-r----- 1 root named 198 Dec 2 2011 localdomain.zone
-rw-r----- 1 root named 195 Dec 2 2011 localhost.zone
-rw-r----- 1 root named 427 Dec 2 2011 named.broadcast
-rw-r----- 1 root named 1892 Dec 2 2011 named.ca
-rw-r----- 1 root named 424 Dec 2 2011 named.ip6.local
-rw-r----- 1 root named 426 Dec 2 2011 named.local
-rw-r----- 1 root named 427 Dec 2 2011 named.zero
drwxrwx--- 2 named named 4096 Jul 27 2004 slaves
[root@localhost named]# cp -p named.local 100.168.192.in-addr.arpa
[root@localhost named]# ll
total 48
-rw-r----- 1 root named 426 Dec 2 2011 100.168.192.in-addr.arpa
drwxrwx--- 2 named named 4096 Aug 26 2004 data
-rw-r----- 1 root named 198 Dec 2 2011 localdomain.zone
-rw-r----- 1 root named 195 Dec 2 2011 localhost.zone
-rw-r----- 1 root named 427 Dec 2 2011 named.broadcast
-rw-r----- 1 root named 1892 Dec 2 2011 named.ca
-rw-r----- 1 root named 424 Dec 2 2011 named.ip6.local
-rw-r----- 1 root named 426 Dec 2 2011 named.local
-rw-r----- 1 root named 427 Dec 2 2011 named.zero
drwxrwx--- 2 named named 4096 Jul 27 2004 slaves
5)配置正向解析数剧库文件
[root@localhost named]# vim localdomain.zone
[root@localhost named]# cat localdomain.zone
$TTL 86400
@ IN SOA localhost root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS localhost
localhost IN A 127.0.0.1
scan-cluster IN A 192.168.100.10
6)配置反向解析数据库文件
[root@localhost named]# vim 100.168.192.in-addr.arpa
[root@localhost named]# cat 100.168.192.in-addr.arpa
$TTL 86400
@ IN SOA localhost. root.localhost. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS localhost.
1 IN PTR localhost.
10 IN PTR scan-cluster.localdomain
7)服务器上启动DNS服务器
[root@localhost named]# /etc/init.d/named status
rndc: connect failed: 127.0.0.1#953: connection refused
named is stopped
[root@localhost named]# /etc/init.d/named start
Starting named: [ OK ]
8)配置/etc/resolv.conf文件(rac1、rac2上执行)
[root@rac1 ~]# vim /etc/resolv.conf
[root@rac1 ~]# cat /etc/resolv.conf
# Generated by NetworkManager
search localdomain
# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
nameserver 192.168.100.9
9)nslookup检查(rac1、rac2上检验)
[root@rac1 ~]# nslookup 192.168.100.10
Server: 192.168.100.9
Address: 192.168.100.9#53
10.100.168.192.in-addr.arpa name = scan-cluster.localdomain
[root@rac1 ~]# nslookup scan-cluster
Server: 192.168.100.9
Address: 192.168.100.9#53
Name: scan-cluster.localdomain
Address: 192.168.100.10
3、建组、用户、环境变量、内核参数等(rac1、rac2上执行)
节点1执行以下脚本:
#!/bin/bash
#Usage:Log on as the superuser('root'),and then execute the command:#./1preusers.sh
groupadd -g 1000 oinstall
groupadd -g 1200 asmadmin
groupadd -g 1201 asmdba
groupadd -g 1202 asmoper
groupadd -g 1300 dba
groupadd -g 1301 oper
useradd -u 1100 -g oinstall -G asmadmin,asmdba,asmoper,dba -d /home/grid -s /bin/bash -c "grid Infrastructure Owner" grid
echo "grid" | passwd --stdin grid
echo "export TMP=/tmp">> /home/grid/.bash_profile
echo 'export TMPDIR=$TMP'>>/home/grid/.bash_profile
echo "export ORACLE_SID=+ASM1">> /home/grid/.bash_profile
echo "export ORACLE_BASE=/u01/app/grid">> /home/grid/.bash_profile
echo "export ORACLE_HOME=/u01/app/11.2.0/grid">> /home/grid/.bash_profile
echo "export ORACLE_TERM=xterm">> /home/grid/.bash_profile
echo "export NLS_DATE_FORMAT='yyyy/mm/dd hh24:mi:ss'" >> /home/grid/.bash_profile
echo 'export TNS_ADMIN=$ORACLE_HOME/network/admin' >> /home/grid/.bash_profile
echo 'export PATH=/usr/sbin:$PATH'>> /home/grid/.bash_profile
echo 'export PATH=$ORACLE_HOME/bin:$PATH'>> /home/grid/.bash_profile
echo 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib'>> /home/grid/.bash_profile
echo 'export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib'>> /home/grid/.bash_profile
echo "export LANG=en_US" >> /home/grid/.bash_profile
echo "export NLS_LANG=american_america.AL32UTF8" >> /home/grid/.bash_profile
useradd -u 1101 -g oinstall -G dba,oper,asmdba -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle
echo "oracle" | passwd --stdin oracle
echo "export TMP=/tmp">> /home/oracle/.bash_profile
echo 'export TMPDIR=$TMP'>>/home/oracle/.bash_profile
echo "export ORACLE_HOSTNAME=rac1.localdomain">> /home/oracle/.bash_profile
echo "export ORACLE_SID=devdb1">> /home/oracle/.bash_profile
echo "export ORACLE_BASE=/u01/app/oracle">> /home/oracle/.bash_profile
echo 'export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1'>> /home/oracle/.bash_profile
echo "export ORACLE_UNQNAME=devdb">> /home/oracle/.bash_profile
echo 'export TNS_ADMIN=$ORACLE_HOME/network/admin' >> /home/oracle/.bash_profile
echo "export ORACLE_TERM=xterm">> /home/oracle/.bash_profile
echo 'export PATH=/usr/sbin:$PATH'>> /home/oracle/.bash_profile
echo 'export PATH=$ORACLE_HOME/bin:$PATH'>> /home/oracle/.bash_profile
echo 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib'>> /home/oracle/.bash_profile
echo 'export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib'>> /home/oracle/.bash_profile
echo "export LANG=en_US" >> /home/oracle/.bash_profile
echo "export NLS_LANG=american_america.AL32UTF8" >> /home/oracle/.bash_profile
echo "export NLS_DATE_FORMAT='yyyy/mm/dd hh24:mi:ss'" >> /home/oracle/.bash_profile
echo "The Groups and users has been created"
echo "The Environment for grid,oracle also has been set successfully"
mkdir -p /u01/app/grid
mkdir -p /u01/app/11.2.0/grid
mkdir -p /u01/app/oracle
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
cp /etc/security/limits.conf /etc/security/limits.conf.bak
echo "oracle soft nproc 2047" >>/etc/security/limits.conf
echo "oracle hard nproc 16384" >>/etc/security/limits.conf
echo "oracle soft nofile 1024" >>/etc/security/limits.conf
echo "oracle hard nofile 65536" >>/etc/security/limits.conf
echo "grid soft nproc 2047" >>/etc/security/limits.conf
echo "grid hard nproc 16384" >>/etc/security/limits.conf
echo "grid soft nofile 1024" >>/etc/security/limits.conf
echo "grid hard nofile 65536" >>/etc/security/limits.conf
cp /etc/pam.d/login /etc/pam.d/login.bak
echo "session required /lib/security/pam_limits.so" >>/etc/pam.d/login
echo "session required pam_limits.so" >>/etc/pam.d/login
cp /etc/profile /etc/profile.bak
echo 'if [ $USER = "oracle" ]||[ $USER = "grid" ]; then' >> /etc/profile
echo 'if [ $SHELL = "/bin/ksh" ]; then' >> /etc/profile
echo 'ulimit -p 16384' >> /etc/profile
echo 'ulimit -n 65536' >> /etc/profile
echo 'else' >> /etc/profile
echo 'ulimit -u 16384 -n 65536' >> /etc/profile
echo 'fi' >> /etc/profile
echo 'fi' >> /etc/profile
cp /etc/sysctl.conf /etc/sysctl.conf.bak
echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.conf
echo "fs.file-max = 6815744" >> /etc/sysctl.conf
echo "kernel.shmall = 2097152" >> /etc/sysctl.conf
echo "kernel.shmmax = 4294967295" >> /etc/sysctl.conf
echo "kernel.shmmni = 4096" >> /etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128" >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 9000 65500" >> /etc/sysctl.conf
echo "net.core.rmem_default = 262144" >> /etc/sysctl.conf
echo "net.core.rmem_max = 4194304" >> /etc/sysctl.conf
echo "net.core.wmem_default = 262144" >> /etc/sysctl.conf
echo "net.core.wmem_max = 1048586" >> /etc/sysctl.conf
echo "net.ipv4.tcp_wmem = 262144 262144 262144" >> /etc/sysctl.conf
echo "net.ipv4.tcp_rmem = 4194304 4194304 4194304" >> /etc/sysctl.conf
sysctl -p
节点2执行以下脚本:
#!/bin/bash
#Usage:Log on as the superuser('root'),and then execute the command:#./1preusers.sh
groupadd -g 1000 oinstall
groupadd -g 1200 asmadmin
groupadd -g 1201 asmdba
groupadd -g 1202 asmoper
groupadd -g 1300 dba
groupadd -g 1301 oper
useradd -u 1100 -g oinstall -G asmadmin,asmdba,asmoper,dba -d /home/grid -s /bin/bash -c "grid Infrastructure Owner" grid
echo "grid" | passwd --stdin grid
echo "export TMP=/tmp">> /home/grid/.bash_profile
echo 'export TMPDIR=$TMP'>>/home/grid/.bash_profile
echo "export ORACLE_SID=+ASM2">> /home/grid/.bash_profile
echo "export ORACLE_BASE=/u01/app/grid">> /home/grid/.bash_profile
echo "export ORACLE_HOME=/u01/app/11.2.0/grid">> /home/grid/.bash_profile
echo "export ORACLE_TERM=xterm">> /home/grid/.bash_profile
echo "export NLS_DATE_FORMAT='yyyy/mm/dd hh24:mi:ss'" >> /home/grid/.bash_profile
echo 'export TNS_ADMIN=$ORACLE_HOME/network/admin' >> /home/grid/.bash_profile
echo 'export PATH=/usr/sbin:$PATH'>> /home/grid/.bash_profile
echo 'export PATH=$ORACLE_HOME/bin:$PATH'>> /home/grid/.bash_profile
echo 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib'>> /home/grid/.bash_profile
echo 'export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib'>> /home/grid/.bash_profile
echo "export LANG=en_US" >> /home/grid/.bash_profile
echo "export NLS_LANG=american_america.AL32UTF8" >> /home/grid/.bash_profile
useradd -u 1101 -g oinstall -G dba,oper,asmdba -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle
echo "oracle" | passwd --stdin oracle
echo "export TMP=/tmp">> /home/oracle/.bash_profile
echo 'export TMPDIR=$TMP'>>/home/oracle/.bash_profile
echo "export ORACLE_HOSTNAME=rac2.localdomain">> /home/oracle/.bash_profile
echo "export ORACLE_SID=devdb2">> /home/oracle/.bash_profile
echo "export ORACLE_BASE=/u01/app/oracle">> /home/oracle/.bash_profile
echo 'export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1'>> /home/oracle/.bash_profile
echo "export ORACLE_UNQNAME=devdb">> /home/oracle/.bash_profile
echo 'export TNS_ADMIN=$ORACLE_HOME/network/admin' >> /home/oracle/.bash_profile
echo "export ORACLE_TERM=xterm">> /home/oracle/.bash_profile
echo 'export PATH=/usr/sbin:$PATH'>> /home/oracle/.bash_profile
echo 'export PATH=$ORACLE_HOME/bin:$PATH'>> /home/oracle/.bash_profile
echo 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib'>> /home/oracle/.bash_profile
echo 'export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib'>> /home/oracle/.bash_profile
echo "export LANG=en_US" >> /home/oracle/.bash_profile
echo "export NLS_LANG=american_america.AL32UTF8" >> /home/oracle/.bash_profile
echo "export NLS_DATE_FORMAT='yyyy/mm/dd hh24:mi:ss'" >> /home/oracle/.bash_profile
echo "The Groups and users has been created"
echo "The Environment for grid,oracle also has been set successfully"
mkdir -p /u01/app/grid
mkdir -p /u01/app/11.2.0/grid
mkdir -p /u01/app/oracle
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
cp /etc/security/limits.conf /etc/security/limits.conf.bak
echo "oracle soft nproc 2047" >>/etc/security/limits.conf
echo "oracle hard nproc 16384" >>/etc/security/limits.conf
echo "oracle soft nofile 1024" >>/etc/security/limits.conf
echo "oracle hard nofile 65536" >>/etc/security/limits.conf
echo "grid soft nproc 2047" >>/etc/security/limits.conf
echo "grid hard nproc 16384" >>/etc/security/limits.conf
echo "grid soft nofile 1024" >>/etc/security/limits.conf
echo "grid hard nofile 65536" >>/etc/security/limits.conf
cp /etc/pam.d/login /etc/pam.d/login.bak
echo "session required /lib/security/pam_limits.so" >>/etc/pam.d/login
echo "session required pam_limits.so" >>/etc/pam.d/login
cp /etc/profile /etc/profile.bak
echo 'if [ $USER = "oracle" ]||[ $USER = "grid" ]; then' >> /etc/profile
echo 'if [ $SHELL = "/bin/ksh" ]; then' >> /etc/profile
echo 'ulimit -p 16384' >> /etc/profile
echo 'ulimit -n 65536' >> /etc/profile
echo 'else' >> /etc/profile
echo 'ulimit -u 16384 -n 65536' >> /etc/profile
echo 'fi' >> /etc/profile
echo 'fi' >> /etc/profile
cp /etc/sysctl.conf /etc/sysctl.conf.bak
echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.conf
echo "fs.file-max = 6815744" >> /etc/sysctl.conf
echo "kernel.shmall = 2097152" >> /etc/sysctl.conf
echo "kernel.shmmax = 4294967295" >> /etc/sysctl.conf
echo "kernel.shmmni = 4096" >> /etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128" >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 9000 65500" >> /etc/sysctl.conf
echo "net.core.rmem_default = 262144" >> /etc/sysctl.conf
echo "net.core.rmem_max = 4194304" >> /etc/sysctl.conf
echo "net.core.wmem_default = 262144" >> /etc/sysctl.conf
echo "net.core.wmem_max = 1048586" >> /etc/sysctl.conf
echo "net.ipv4.tcp_wmem = 262144 262144 262144" >> /etc/sysctl.conf
echo "net.ipv4.tcp_rmem = 4194304 4194304 4194304" >> /etc/sysctl.conf
sysctl -p
4、停止NTP服务(rac1、rac2上执行)
[root@rac2 mnt]# service ntpd status
ntpd is stopped
[root@rac2 mnt]# chkconfig ntpd off
[root@rac2 mnt]# cp /etc/ntp.conf /etc/ntp.conf.bak
[root@rac2 mnt]# rm /etc/ntp.conf -rf
5、配置grid用户和oracle用户ssh对等性
[root@rac1 mnt]# su - grid
[grid@rac1 ~]$ pwd
/home/grid
[grid@rac1 ~]$ ls -al
total 44
drwx------. 4 grid oinstall 4096 Jan 22 12:55 .
drwxr-xr-x. 5 root root 4096 Jan 22 12:48 ..
-rw-------. 1 grid oinstall 19 Jan 22 12:55 .bash_history
-rw-r--r--. 1 grid oinstall 18 Jul 9 2013 .bash_logout
-rw-r--r--. 1 grid oinstall 677 Jan 22 12:48 .bash_profile
-rw-r--r--. 1 grid oinstall 124 Jul 9 2013 .bashrc
drwxr-xr-x. 2 grid oinstall 4096 Jul 14 2010 .gnome2
-rw-r--r--. 1 grid oinstall 171 Oct 16 2013 .kshrc
-rw-r--r--. 1 grid oinstall 124 Oct 24 2013 .mkshrc
drwxr-xr-x. 4 grid oinstall 4096 Jan 21 16:47 .mozilla
-rw-r--r--. 1 grid oinstall 658 Aug 6 2013 .zshrc
[grid@rac1 ~]$ mkdir .ssh
[grid@rac1 ~]$ ls -al
total 48
drwx------. 5 grid oinstall 4096 Jan 22 13:11 .
drwxr-xr-x. 5 root root 4096 Jan 22 12:48 ..
-rw-------. 1 grid oinstall 19 Jan 22 12:55 .bash_history
-rw-r--r--. 1 grid oinstall 18 Jul 9 2013 .bash_logout
-rw-r--r--. 1 grid oinstall 677 Jan 22 12:48 .bash_profile
-rw-r--r--. 1 grid oinstall 124 Jul 9 2013 .bashrc
drwxr-xr-x. 2 grid oinstall 4096 Jul 14 2010 .gnome2
-rw-r--r--. 1 grid oinstall 171 Oct 16 2013 .kshrc
-rw-r--r--. 1 grid oinstall 124 Oct 24 2013 .mkshrc
drwxr-xr-x. 4 grid oinstall 4096 Jan 21 16:47 .mozilla
drwxr-xr-x. 2 grid oinstall 4096 Jan 22 13:11 .ssh
-rw-r--r--. 1 grid oinstall 658 Aug 6 2013 .zshrc
[grid@rac1 ~]$ chmod 700 .ssh
[grid@rac1 ~]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/grid/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
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:
b8:28:a2:8a:cd:09:4e:54:e0:ba:9a:15:94:22:c0:4b grid@rac1.localdomain
The key's randomart image is:
+--[ RSA 2048]----+
|o. |
|oE.. |
|+.+. |
|o+. . |
|... . S |
|.. . . . |
|+.o . . |
|*B o |
|B.+ |
+-----------------+
[grid@rac1 ~]$ cd .ssh
[grid@rac1 .ssh]$ ls -al
total 16
drwx------. 2 grid oinstall 4096 Jan 22 13:13 .
drwx------. 5 grid oinstall 4096 Jan 22 13:11 ..
-rw-------. 1 grid oinstall 1675 Jan 22 13:13 id_rsa
-rw-r--r--. 1 grid oinstall 404 Jan 22 13:13 id_rsa.pub
[grid@rac1 .ssh]$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/grid/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/grid/.ssh/id_dsa.
Your public key has been saved in /home/grid/.ssh/id_dsa.pub.
The key fingerprint is:
83:35:09:9a:b2:f5:41:ec:44:d1:d8:9b:ba:a6:6e:8f grid@rac1.localdomain
The key's randomart image is:
+--[ DSA 1024]----+
| o== |
| ++.o. |
| . +o. +o |
| + ..+o. |
| . o.S |
| . . |
| . |
| ..o |
| oE+. |
+-----------------+
[grid@rac1 .ssh]$ ls -al
total 24
drwx------. 2 grid oinstall 4096 Jan 22 13:14 .
drwx------. 5 grid oinstall 4096 Jan 22 13:11 ..
-rw-------. 1 grid oinstall 668 Jan 22 13:14 id_dsa
-rw-r--r--. 1 grid oinstall 612 Jan 22 13:14 id_dsa.pub
-rw-------. 1 grid oinstall 1675 Jan 22 13:13 id_rsa
-rw-r--r--. 1 grid oinstall 404 Jan 22 13:13 id_rsa.pub
生成authorized_keys文件
[grid@rac1 ~]$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
[grid@rac1 ~]$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
[grid@rac1 .ssh]$ ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
[grid@rac1 .ssh]$ ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
[grid@rac1 .ssh]$ scp authorized_keys rac2:~/.ssh/authorized_keys
验证ssh对等性:
[grid@rac1 .ssh]$ ssh rac1 date
Fri Jan 22 13:38:04 CST 2016
[grid@rac1 .ssh]$ ssh rac2 date
Fri Jan 22 13:38:09 CST 2016
[grid@rac1 .ssh]$ ssh rac1-priv date
Fri Jan 22 13:38:15 CST 2016
[grid@rac1 .ssh]$ ssh rac2-priv date
Fri Jan 22 13:38:20 CST 2016
6、配置共享磁盘
1)创建6块共享磁盘并fdisk格式化。
2)安装asm rpm包:
[root@rac2 ~]# cd /mnt
[root@rac2 mnt]# ll
total 136
-rw-r--r--. 1 root root 33956 Jan 22 17:23 kmod-oracleasm-2.0.6.rh1-3.el6.x86_64.rpm
-rw-r--r--. 1 root root 13300 Jan 22 17:23 oracleasmlib-2.0.4-1.el6.x86_64.rpm
-rw-r--r--. 1 root root 74984 Jan 22 17:23 oracleasm-support-2.1.8-1.el6.x86_64.rpm
[root@rac2 mnt]# rpm -qa|grep oracleasm
[root@rac2 mnt]# rpm -ivh kmod-oracleasm-2.0.6.rh1-3.el6.x86_64.rpm
Preparing... ########################################### [100%]
1:kmod-oracleasm ########################################### [100%]
[root@rac2 mnt]# rpm -ivh oracleasm-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@rac2 mnt]# rpm -ivh oracleasmlib-2.0.4-1.el6.x86_64.rpm
warning: oracleasmlib-2.0.4-1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing... ########################################### [100%]
1:oracleasmlib ########################################### [100%]
[root@rac2 mnt]# rpm -qa|grep oracleasm
oracleasm-support-2.1.8-1.el6.x86_64
kmod-oracleasm-2.0.6.rh1-3.el6.x86_64
oracleasmlib-2.0.4-1.el6.x86_64
3)双节点配置asm driver服务
[root@rac1 mnt]# /usr/sbin/oracleasm -h
Usage: oracleasm [--exec-path=<exec_path>] <command> [ <args> ]
oracleasm --exec-path
oracleasm -h
oracleasm -V
The basic oracleasm commands are:
configure Configure the Oracle Linux ASMLib driver
init Load and initialize the ASMLib driver
exit Stop the ASMLib driver
scandisks Scan the system for Oracle ASMLib disks
status Display the status of the Oracle ASMLib driver
listdisks List known Oracle ASMLib disks
querydisk Determine if a disk belongs to Oracle ASMlib
createdisk Allocate a device for Oracle ASMLib use
deletedisk Return a device to the operating system
renamedisk Change the label of an Oracle ASMlib disk
update-driver Download the latest ASMLib driver
[root@rac1 mnt]# /usr/sbin/oracleasm status
Checking if ASM is loaded: no
Checking if /dev/oracleasm is mounted: no
[root@rac1 mnt]# /usr/sbin/oracleasm configure -i
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.
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 driver configuration: done
[root@rac1 mnt]# /usr/sbin/oracleasm status
Checking if ASM is loaded: no
Checking if /dev/oracleasm is mounted: no
[root@rac1 mnt]# /usr/sbin/oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Mounting ASMlib driver filesystem: /dev/oracleasm
[root@rac1 mnt]# /usr/sbin/oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yes
4)配置asm磁盘
节点1:
[root@rac1 mnt]# /usr/sbin/oracleasm -h
Usage: oracleasm [--exec-path=<exec_path>] <command> [ <args> ]
oracleasm --exec-path
oracleasm -h
oracleasm -V
The basic oracleasm commands are:
configure Configure the Oracle Linux ASMLib driver
init Load and initialize the ASMLib driver
exit Stop the ASMLib driver
scandisks Scan the system for Oracle ASMLib disks
status Display the status of the Oracle ASMLib driver
listdisks List known Oracle ASMLib disks
querydisk Determine if a disk belongs to Oracle ASMlib
createdisk Allocate a device for Oracle ASMLib use
deletedisk Return a device to the operating system
renamedisk Change the label of an Oracle ASMlib disk
update-driver Download the latest ASMLib driver
[root@rac1 mnt]# /usr/sbin/oracleasm listdisks
[root@rac1 mnt]# /usr/sbin/oracleasm createdisk VOL1 /dev/sdb1
Writing disk header: done
Instantiating disk: done
[root@rac1 mnt]# /usr/sbin/oracleasm createdisk VOL2 /dev/sdc1
Writing disk header: done
Instantiating disk: done
[root@rac1 mnt]# /usr/sbin/oracleasm createdisk VOL3 /dev/sdd1
Writing disk header: done
Instantiating disk: done
[root@rac1 mnt]# /usr/sbin/oracleasm createdisk VOL4 /dev/sde1
Writing disk header: done
Instantiating disk: done
[root@rac1 mnt]# /usr/sbin/oracleasm createdisk VOL5 /dev/sdf1
Writing disk header: done
Instantiating disk: done
[root@rac1 mnt]# /usr/sbin/oracleasm createdisk VOL6 /dev/sdg1
Writing disk header: done
Instantiating disk: done
[root@rac1 mnt]# /usr/sbin/oracleasm listdisks
VOL1
VOL2
VOL3
VOL4
VOL5
VOL6
6)节点2添加asm磁盘:
[root@rac2 mnt]# /usr/sbin/oracleasm -h
Usage: oracleasm [--exec-path=<exec_path>] <command> [ <args> ]
oracleasm --exec-path
oracleasm -h
oracleasm -V
The basic oracleasm commands are:
configure Configure the Oracle Linux ASMLib driver
init Load and initialize the ASMLib driver
exit Stop the ASMLib driver
scandisks Scan the system for Oracle ASMLib disks
status Display the status of the Oracle ASMLib driver
listdisks List known Oracle ASMLib disks
querydisk Determine if a disk belongs to Oracle ASMlib
createdisk Allocate a device for Oracle ASMLib use
deletedisk Return a device to the operating system
renamedisk Change the label of an Oracle ASMlib disk
update-driver Download the latest ASMLib driver
[root@rac2 mnt]# /usr/sbin/oracleasm listdisks
[root@rac2 mnt]# /usr/sbin/oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "VOL1"
Instantiating disk "VOL2"
Instantiating disk "VOL3"
Instantiating disk "VOL5"
Instantiating disk "VOL4"
Instantiating disk "VOL6"
[root@rac2 mnt]# /usr/sbin/oracleasm listdisks
VOL1
VOL2
VOL3
VOL4
VOL5
VOL6
[root@rac2 mnt]#
7、安装grid软件
1)上传安装介质,解压(一个节点即可)。
2)安装grid前预检查(一个节点即可)
[grid@rac1 grid]$ ./runcluvfy.sh stage -pre crsinst -n rac1,rac2 -fixup -verbose
3)图形界面安装grid软件
以下图形界面安装略。
Oracle安装部署之linux(redhat/centos)快速安装oracle 11g rac的更多相关文章
- Linux操作系统各版本ISO镜像下载(包括oracle linux\redhat\centos\u
Linux操作系统各版本ISO镜像下载(包括oracle linux\redhat\centos\ubuntu\debian等) 1.Oracle Linux(下载地址) (1)OracleLinux ...
- Asp.Net Core 程序部署到Linux(centos)生产环境(二):docker部署
运行环境 照例,先亮环境:软件的话我这里假设你已经批准好了.net core 运行环境,未配置可以看我的这篇[linux(centos)搭建.net core 运行环境] 腾讯云 centos:7.2 ...
- Asp.Net Core 程序部署到Linux(centos)生产环境(一):普通部署
运行环境 照例,先亮底 centos:7.2 cpu:1核 2G内存 1M带宽 辅助工具:xshell xftp 搭建.net core运行环境 .net core 的运行环境我单独写了一篇,请看我的 ...
- python2.7.14安装部署(Linux)
+++++++++++++++++++++++++++++++++++++++++++标题:python2.7.14安装部署(Linux)时间:2019年2月23日内容:Linux下python环境部 ...
- CentOS 6.8 安装TigerVNC 实现 Linux 远程桌面并安装火狐浏览器
CentOS 6.8 安装TigerVNC 实现 Linux 远程桌面并安装火狐浏览器 vnc客户端地址:https://files.cnblogs.com/files/MYSQLZOUQI/vnc- ...
- [转帖]VMware Vsphere 6.0安装部署 (三) vCenter Server安装
VMware Vsphere 6.0安装部署 (三) vCenter Server安装 2016年08月29日 14:59:14 dAng1r0Us 阅读数:72942 版权声明:本文为博主原创文 ...
- ArcGIS 10.1 for Server安装教程系列—— Linux下的单机安装
http://www.oschina.net/question/565065_81231 因为Linux具有稳定,功能强大等特性,因此常常被用来做为企业内部的服务器,我们的很多用户也是将Ar ...
- linux (centOS)安装 oracle 11g 以及卸载oracle
目录 首先.1. 一.参数以及环境配置 1.创建用户和组 2.创建数据库软件目录和数据文件存放目录 3.配置oracle用户的环境变量 4.修改linux内核,修改/etc/sysctl.conf文件 ...
- Oracle安装部署之linux OS install oracle database安装脚本
#!/bin/bash#Purpose:Create and config oracle install.#Usage:Log on as the superuser('root') #1.creat ...
随机推荐
- scala akka Future 顺序执行 sequential execution
对于 A => B => C 这种 future 之间的操作,akka 默认会自动的按照顺序执行,但对于数据库操作来说,我们希望几个操作顺序执行,就需要使用语法来声明 有两种声明 futu ...
- 【SVN】自动定时更新
程序或脚本:"C:\Program Files\TortoiseSVN\bin\svn.exe" 参数:update E:\XXXXProjects\Code 参考:https:/ ...
- Libjingle库 综述
国内现在很多语音聊天工具都是基于TURN方式实现的,包括YY.AK等等,这种方式对于服务器的性能要求很高,而且在用户量增大的时候,服务器压力也会越来越大,用户的语音质量也会受到很大影响.而基于P2P方 ...
- 国内CDN加速现状
什么是CDN CDN的全称是Content Delivery Network,即内容分发网络.是位于网络层与应用层之间的网络应用,其目的是通过在现有的Internet中增加一层新的网络架构,将网站的内 ...
- C语言结构体和指针
指针也可以指向一个结构体,定义的形式一般为: struct 结构体名 *变量名; 下面是一个定义结构体指针的实例: struct stu{ char *name; //姓名 int num; //学号 ...
- gitlab数据迁移
由于gitlab是默认安装的,随着公司代码越来越多,导致gitlab数据目录空间不足,出现无法访问gitlab了. 磁盘空间: /home有1.8T的空间一直没用上! 现在打算将原有代码目录迁移到新目 ...
- jQuery Easing 动画效果扩展--使用Easing插件,让你的动画更具美感。
jQuery Easing 是一款比较老的jQuery插件,在很多网站都有应用,尤其是在一些页面滚动.幻灯片切换等场景应用比较多.它非常小巧,且有多种动画方案供选择,使用简单,而且免费. 引入Eas ...
- 《MySQL》一次MySQL慢查询导致的故障
本文转载自 http://www.jb51.net/article/70955.htm 我们知道分析MySQL语句查询性能的方法除了使用EXPLAIN 输出执行计划,还可以让MySQL记录下查询超过指 ...
- 使用kendynet构建异步redis访问服务
使用kendynet构建异步redis访问服务 最近开始在kendynet上开发手游服务端,游戏类型是生存挑战类的,要存储的数据结构和类型都比较简单,于是选择了用redis做存储,数据类型使用stri ...
- 电子邮件 -- 图解TCP_IP_第5版
图解TCP_IP_第5版 作者: [日]竹下隆史 / [日]村山公保 / [日]荒井透 / [日]苅田幸雄 出版社: 人民邮电出版社原作名: マスタリングTCP/IP 入門編 第5版译者: 乌尼日其其 ...