2014,换个角度,希望接下来的事情值得期待。
分类: Oracle
2014-01-11 20:08:39
准备:
一、安装VBOX(过程略)
二、新建虚拟机rac1,目录指定F:\rac1,安装ORACLE LINUX 6.2,hostname为rac1 (过程略)
设置网卡时注意:
第一个使用桥接,第二个使用Host-only
配置rac1
一、配置网络(本台机器,主机网段为192.168.1.*)
vi /etc/sysconfig/network-scripts/ifcfg-eth0
设置桥接eth0 网络地址为:
IP:192.168.1.203
子网掩码:255.255.255.0
默认网关:192.168.1.1
vi /etc/sysconfig/network-scripts/ifcfg-eth1
设置hostonly网络 eth1 网络地址为:
IP:192.168.56.203
子网掩码:255.255.255.0
默认网关:192.168.1.1
二、配置HOSTS文件
vi /etc/hosts
编辑host文件
#public ip
192.168.1.203 rac1
192.168.1.204 rac2
#private ip
192.168.56.203 rac1priv
192.168.56.204 rac2priv
#vip
192.168.1.213 rac1vip
192.168.1.214 rac2vip
#scan
192.168.1.200 racscan
三、安装以下几个包
gcc-c++-4.4.6-3.el6.i686.rpm
libcap-ng-0.6.4-3.el6_0.1.i686.rpm
oracleasm-support-2.1.5-1.el6.i686.rpm
cloog-ppl-0.15.7-1.2.el6.i686.rpm
glibc-devel-2.12-1.47.el6.i686.rpm
libcap-ng-devel-0.6.4-3.el6_0.1.i686.rpm
pdksh-5.2.14-1.i386.rpm
compat-libstdc++-33-3.2.3-69.el6.i686.rpm
glibc-headers-2.12-1.47.el6.i686.rpm
libmtp-1.0.1-2.el6.i686.rpm
ppl-0.10.2-11.el6.i686.rpm
cpp-4.4.6-3.el6.i686.rpm
kernel-headers-2.6.32-220.el6.i686.rpm
libstdc++-devel-4.4.6-3.el6.i686.rpm
unixODBC-2.2.14-11.el6.i686.rpm
libaio-devel-0.3.107-10.el6.i686.rpm
libtool-ltdl-2.2.6-15.5.el6.i686.rpm
unixODBC-devel-2.2.14-11.el6.i686.rpm
elfutils-libelf-devel-0.152-1.el6.i686.rpm
libcap-2.16-5.5.el6.i686.rpm
mpfr-2.4.1-6.el6.i686.rpm
gcc-4.4.6-3.el6.i686.rpm
libcap-devel-2.16-5.5.el6.i686.rpm
oracleasmlib-2.0.4-1.el6.i686.rpm
四、创建组和用户
[root@rac1 download]# groupadd oinstall
[root@rac1 download]# groupadd dba
[root@rac1 download]# groupadd oper
[root@rac1 download]# groupadd asmadmin
[root@rac1 download]# groupadd asmdba
[root@rac1 download]# groupadd asmoper
[root@rac1 ~]# useradd -g oinstall -G dba,asmadmin,asmdba,asmoper grid
[root@rac1 ~]# useradd -g oinstall -G dba,oper,asmdba oracle
设置密码都是ORACLE
[root@rac1 ~]# passwd grid
[root@rac1 ~]# passwd oracle
五、创建目录,授予权限给grid
[root@rac1 /]# cd /
[root@rac1 /]# mkdir u01
[root@rac1 /]# cd u01
[root@rac1 u01]# mkdir gridbase
[root@rac1 u01]# mkdir grid
[root@rac1 u01]# mkdir oracle
[root@rac1 u01]# ll
total 12
drwxr-xr-x 2 root root 4096 Jul 5 12:11 grid
drwxr-xr-x 2 root root 4096 Jul 5 12:11 gridbase
drwxr-xr-x 2 root root 4096 Jul 5 12:11 oracle
[root@rac1 u01]# cd /
[root@rac1 /]# chown -R grid:oinstall /u01
六、把oracle 目录的权限授予用户oracle
[root@rac1 /]# cd /u01
[root@rac1 u01]# ll
total 12
drwxr-xr-x 2 grid oinstall 4096 Jul 5 12:11 grid
drwxr-xr-x 2 grid oinstall 4096 Jul 5 12:11 gridbase
drwxr-xr-x 2 grid oinstall 4096 Jul 5 12:11 oracle
[root@rac1 u01]# chown -R oracle:oinstall oracle
[root@rac1 u01]# ll
total 12
drwxr-xr-x 2 grid oinstall 4096 Jul 5 12:11 grid
drwxr-xr-x 2 grid oinstall 4096 Jul 5 12:11 gridbase
drwxr-xr-x 2 oracle oinstall 4096 Jul 5 12:11 oracle
[root@rac1 u01]#
七、把u01的用户权限给grid和oracle
[root@rac1 u01]# cd /
[root@rac1 /]# chmod 775 u01
[root@rac1 /]# ll
八、设置环境变量
[root@rac1 /]# su - grid
[grid@rac1 ~]$ pwd
/home/grid
[grid@rac1 ~]$ vi .bash_profile
ORACLE_BASE=/u01/gridbase
ORACLE_HOME=/u01/grid
PATH=$ORACLE_HOME/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
DISPLAY=192.168.1.1:0.0
export ORACLE_BASE ORACLE_HOME PATH LD_LIBRARY_PATH DISPLAY
[grid@rac1 ~]$ su - oracle
Password:
[oracle@rac1 ~]$ pwd
/home/oracle
[oracle@rac1 ~]$ cd /u01/oracle
[oracle@rac1 oracle]$ mkdir db
退回到~下面
[oracle@rac1 ~]$ vi .bash_profile
RACLE_BASE=/u01/oracle
ORACLE_HOME=/u01/oracle/db
ORACLE_SID=racdb1
PATH=$ORACLE_HOME/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
DISPLAY=192.168.1.1:0.0
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH LD_LIBRARY_PATH DISPLAY
九、禁止掉SELinux (切换到root)
[root@rac1 u01]# vi /etc/selinux/config
SELINUX=disabled
十、禁止防火墙
[root@rac1 u01]# export LANG=C
[root@rac1 u01]# setup
先把system services,把ip6tables, iptables前面的*号去掉。
rm -f (加上查出来的ntpd.pid)