ITPub博客

首页 > 数据库 > Oracle > Oracle Database 11g RAC On Oracle Linux 6 Update 3 Using VirtualBox.docx(2/3)

Oracle Database 11g RAC On Oracle Linux 6 Update 3 Using VirtualBox.docx(2/3)

原创 Oracle 作者:diashad 时间:2014-08-19 14:28:38 0 删除 编辑

2.6.建立用户

/usr/sbin/groupadd -g 501 oinstall

/usr/sbin/groupadd -g 502 dba

/usr/sbin/groupadd -g 503 oper

/usr/sbin/groupadd -g 504 asmadmin

/usr/sbin/groupadd -g 505 asmoper

/usr/sbin/groupadd -g 506 asmdba

/usr/sbin/useradd -g oinstall -G dba,asmdba,oper oracle

/usr/sbin/useradd -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid

 

[root@rac01 ~]# passwd oracle

Changing password for user oracle.

New password:

BAD PASSWORD: it is based on a dictionary word

BAD PASSWORD: is too simple

Retype new password:

passwd: all authentication tokens updated successfully.

 

[root@rac01 ~]# passwd grid

Changing password for user grid.

New password:

BAD PASSWORD: it is too short

BAD PASSWORD: is too simple

Retype new password:

passwd: all authentication tokens updated successfully.

 

 

2.7.建立目录

mkdir -p /u01/app/grid
mkdir -p /u01/app/11.2.0/grid
chown -R grid.oinstall /u01

mkdir -p /u01/app/oraInventory
chown -R grid:oinstall /u01/app/oraInventory

mkdir -p /u01/app/oracle
chown -R oracle.oinstall /u01/app/oracle
chmod -R 775 /u01/

2.8.编辑profile 文件


[root@rac01 Disk]# vi /home/grid/.bash_profile

 

export ORACLE_SID=+ASM1                      

# .bash_profile

 

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

        . ~/.bashrc

fi

 

# User specific environment and startup programs

 

export ORACLE_BASE=/u01/app/grid

export ORACLE_HOME=/u01/app/11.2.0/grid

export ORACLE_SID=+ASM1

export LANG=en

export LD_LIBRARY_PATH=$ORACLE_HOME/lib

export PATH=$ORACLE_HOME/bin:$PATH

alias sqlplus = ‘lwrap sqlplus’

alias rman = ‘lwrap rman’

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


2.9.下载安装软件

[root@rac01 Disk]# mkdir -m 777 /Disk

 

上传安装GRID,ORACLE的软件,rlwrap,asm的包至/Disk

 

2.10.安装asm的package

[root@rac01 Disk]# rpm -Uvh 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@rac01 Disk]# rpm -Uvh oracleasm-support-2.1.8-1.el5.x86_64.rpm

warning: oracleasm-support-2.1.8-1.el5.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 1e5e0159: NOKEY

Preparing...                ########################################### [100%]

   1:oracleasm-support      ########################################### [100%]

 

2.11.安装 rlwrap

[root@rac01 Disk]# rpm -Uvh rlwrap-0.37-1.el6.x86_64.rpm

warning: rlwrap-0.37-1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY

Preparing...                ########################################### [100%]

   1:rlwrap                 ########################################### [100%]

 

 

[root@rac01 Disk]# unzip p13390677_112040_Linux-x86-64_3of7.zip

 

安装ASM的package

 

 

 

2.12. 關閉RAC1,克隆RAC2,并增加共享磁盘

 

 

 

 

 

 

 

2.13.修改rac02的相关文件。(/etc/sysconfig/network 和profile文件)

 

2.14.格式化磁盘

[root@rac01 u01]# fdisk -l

 

Disk /dev/sda: 32.2 GB, 32212254720 bytes

255 heads, 63 sectors/track, 3916 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00056ffa

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          26      204800   83  Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2              26         548     4194304   82  Linux swap / Solaris

Partition 2 does not end on cylinder boundary.

/dev/sda3             548        3917    27057152   8e  Linux LVM

 

Disk /dev/sdb: 32.2 GB, 32212254720 bytes

255 heads, 63 sectors/track, 3916 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

 

Disk /dev/sdc: 32.2 GB, 32212254720 bytes

255 heads, 63 sectors/track, 3916 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

 

Disk /dev/mapper/vg_rac01-LogVol00: 27.7 GB, 27703377920 bytes

255 heads, 63 sectors/track, 3368 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

[root@rac01 u01]# fdisk /dev/sdb

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel with disk identifier 0x46ed339a.

Changes will remain in memory only, until you decide to write them.

After that, of course, the previous content won't be recoverable.

 

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

 

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to

         switch off the mode (command 'c') and change display units to

         sectors (command 'u').

 

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-3916, default 1):

Using default value 1

Last cylinder, +cylinders or +size{K,M,G} (1-3916, default 3916):

Using default value 3916

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

Syncing disks.

 

 

2.15.增加ASM磁盘

[root@rac01 u01]# /etc/init.d/oracleasm createdisk DISK1  /dev/sdb1

shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

Marking disk "DISK1" as an ASM disk: [  OK  ]

[root@rac01 u01]# /etc/init.d/oracleasm createdisk DISK2  /dev/sdc1

shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

Marking disk "DISK2" as an ASM disk: [  OK  ]

 

[root@rac01 Disk]# /etc/init.d/oracleasm listdisks

DISK1

DISK2

2.16 安装GRID的包,在安装程式grid/rpm下

[root@rac01 rpm]# rpm -Uvh cvuqdisk-1.0.9-1.rpm

Preparing...                ########################################### [100%]

Using default group oinstall to install package

   1:cvuqdisk               ########################################### [100%]

 

3 安装grid

称在root用户下xhost +

再切换到grid用户 ,安装

[root@rac01 grid]#xhost +

[root@rac01 grid]# su - grid

[grid@rac01 ~]$ cd /Disk/grid/

[grid@rac01 grid]$ ./runInstaller

 

 

在这里,要点 SSHConnectivity ,输入 grid的密码,再setup.

 

 

 

 

 

选择Ignore all

 

 

 

在二个机器上分别执行,注意顺序。执行完成再点OK.

 

3.1 验证GRID

 

[grid@rac01 ~]$ srvctl status nodeapps

VIP rac01-vip is enabled

VIP rac01-vip is running on node: rac01

VIP rac02-vip is enabled

VIP rac02-vip is running on node: rac02

Network is enabled

Network is running on node: rac01

Network is running on node: rac02

GSD is disabled

GSD is not running on node: rac01

GSD is not running on node: rac02

ONS is enabled

ONS daemon is running on node: rac01

ONS daemon is running on node: rac02

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

请登录后发表评论 登录
全部评论

注册时间:2011-08-08

  • 博文量
    86
  • 访问量
    472948