Oracle 10g R2 RAC 安装配置说明书

Oracle 10g R2 RAC 安装配置说明书

1 软硬件说明

1.1 硬件环境描述

l        数据库服务器:两台IBM X460服务器

序号

技术指标描述

1

型号规格: IBM X460服务器

2

处理器类型: Intel P4 Xeon MP处理器2830 

3

支持是8 机箱分区技术,最大能够支持32颗英特尔至强 MP处理器

4

CPU二级缓存:4096KB 

5

标配处理器个数:2

6

扩充处理器个数:2

7

标配内存大小: 2GB

8

扩充内存大小: 6GB

9

最大内存容量: 64GB 

10

硬盘容量 IBM 73.4GB 10K 2.5 SAS 热插拔HDD×2

11

64PCI-X 2.0 6 

12

电源标配21300W(最大2个),冗余风扇

13

网络控制器 10/100/ 1000M 自适应以太网卡×2 

14

5m LC-LC Fibre Channel Cable光纤接口

15

3U机架式

16

ServeRAID 8i SA-SCSI RAID 适配器

17

FC2-133 Host Bus Adapter

 

l        存储系统1套,包括:IBM TotalStorage DS4300 Storage Server SAN存储设备一台和IBM B16光纤交换机两台。

序号

技术指标描述

1

型号规格:IBM TotalStorage DS4300 Storage Server SAN存储和

     IBM B16 光纤交换机

2

采用SAN技术;

3

支持IBMHPDELLFujitsuNEC等主流服务器平台;

4

存储容量(GB2000-32000

5

高速缓存容量(MB256

6

磁盘转速(RPM1000015000

7

RAID支持013510

8

主机通道 Fibre Channel

9

认证  CE,FCC

10

电源电压双冗余,热交换

11

DS4300 MIDRANGE DISK (60U)

12

FAStT600 turbo Feature – IPO

13

Short Wave SFP GBIC×2

14

2GB FC, 146.8GB/15K DRIVE×14

15

5M LC-LC Fibre Optic Cable×4

16

Field Integrate FastT600

17

Power Cord Peopl.Rep.Chin

18

IBM TotalStorage SAN16B-2 - 16 Port

19

4 Gbps SW SFP Transceiver - 4 Pack

20

Fibre Cable LC/LC 5m multimode

用途

海量存储设备,用来存储各个应用系统数据。

 

1.2 软件产品准备

·         CentOS4.4安装光盘(共4CD

·         OCFS2相关安装包

·         ASM相关安装包

·         Oracle 10g R2 Clusterware

·         Oracle 10g R2

1.3 配置规划清单

Oracle数据库文件

RAC节点名称

实例名

数据库名称

$ORACLE_BASE

文件系统

Rac1

Racas1

Racas

/u01/app/oracle

Automatic Storage Management (ASM)

Rac2

Racas2

Racas

/u01/app/oracle

Automatic Storage Management (ASM)

CRS共享文件

文件类型

文件名

分区

加载点

文件系统

Oracle Cluster Registry (OCR)

/oracle/ocfs /OCRFile

/dev/sda1

/oracle/ocfs

Oracle's Cluster File System (OCFS)

CRS Voting Disk

/oracle/ocfs /CSSFile

/dev/sda1

/oracle/ocfs

Oracle's Cluster File System (OCFS)

 

2 集群环境准备

2.1 配置文件修改

2.1.1 修改/etc/hosts文件

127.0.0.1       localhost.localdomain   localhost
# Public
192.168.2.101   rac1.localdomain        rac1
192.168.2.102   rac2.localdomain        rac2
#Private
192.168.0.101   rac1-priv.localdomain   rac1-priv
192.168.0.102   rac2-priv.localdomain   rac2-priv
#Virtual
192.168.2.111   rac1-vip.localdomain    rac1-vip
192.168.2.112   rac2-vip.localdomain    rac2-vip

 

2.1.2 修改/etc/sysctl.conf文件

kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=262144

修改完后允许下面命令使其生效:

/sbin/sysctl -p

 

2.1.3 修改/etc/security/limits.conf文件

*               soft    nproc   2047
*               hard    nproc   16384
*               soft    nofile  1024
*               hard    nofile  65536

 

2.1.4 修改/etc/pam.d/login文件

session    required     /lib/security/pam_limits.so

 

2.1.5 修改/etc/selinux/config文件

SELINUX=disabled

2.1.6 修改/etc/modprobe.conf文件

options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180

 

2.2 创建用户/用户组

groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle

 

2.3 创建安装目录

mkdir -p /u01/app/oracle/product/
     
      10.2.0
     /crs
mkdir -p /u01/app/oracle/product/
     
      10.2.0
     /db_1
mkdir -p /oracle/ocfs
chown -R oracle.oinstall /u01

 

2.4 配置SSH

# su – oracle
$ mkdir -p ~/.ssh
$ chmod 700 ~/.ssh
$ /usr/bin/ssh-keygen -t rsa
$ /usr/bin/ssh-keygen -t dsa

$ touch ~/.ssh/authorized_keys

$ ssh rac1 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ ssh rac1 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
$ ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

$ scp ~/.ssh/authorized_keys rac2:.ssh/authorized_keys

$ chmod 600 ~/.ssh/authorized_keys
$ ssh rac1 hostname
$ ssh rac2 hostname

$ exec /usr/bin/ssh-agent $SHELL
$ /usr/bin/ssh-add

 

2.5 修改oracle用户配置文件

Oracle Settings

TMP=/tmp; export TMP

TMPDIR=$TMP; export TMPDIR

 

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/ 10.2.0 /db_1; export ORACLE_HOME

ORACLE_SID=RACAS; export ORACLE_SID

ORACLE_TERM=xterm; export ORACLE_TERM

PATH=/usr/sbin:$PATH; export PATH

PATH=$ORACLE_HOME/bin:$PATH; export PATH

 

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH

CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

 

if [ $USER = "oracle" ]; then

  if [ $SHELL = "/bin/ksh" ]; then

    ulimit -p 16384

    ulimit -n 65536

  else

    ulimit -u 16384 -n 65536

  fi

fi

2.6 为共享磁盘分区

文件系统类型

设备分区

大小

加载点

文件类型

OCFS

/dev/sda1

300 MB

/oracle/ocfs

Oracle Cluster Registry (OCR) File - (~100 MB)
CRS Voting Disk - (~20MB)

ASM

/dev/sda2

100 GB

ORCL:VOL1

Oracle Database Files

ASM

/dev/sda3

100 GB

ORCL:VOL2

Oracle Database Files

ASM

/dev/sda4

100 GB

ORCL:VOL3

Oracle Database Files

Total

 

300 GB

 

 

 

# fdisk /dev/sda
Command (m for help): p
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-24792, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-24792, default 24792): + 300M
Command (m for help): w
The partition table has been altered!

# fdisk -l /dev/sda

 

 

2.7 安装配置OCFS2

$ su -
# rpm -Uvh ocfs2*.rpm
Preparing... ########################################### [100%]
1:ocfs2-tools ########################################### [ 33%]
2:ocfs2- 2.6.9 -42.EL ########################################### [ 67%]
3:ocfs2console ########################################### [100%]
# ocfs2console &
配置两个节点信息

 

配置完成后,检查/etc/ocfs2/cluster.conf文件中是否是如下配置:
node:
 ip_port = 7777
 ip_address = 192.168.2.101
 number = 0
 name = rac1
 cluster = ocfs2

node:
 ip_port = 7777
 ip_address = 192.168.2.102
 number = 1
 name = rac2
 cluster = ocfs2

cluster:
 node_count = 2
 name = ocfs2

 

 

$/etc/init.d/o2cb status
$/etc/init.d/o2cb load
$/etc/init.d/o2cb online ocfs2
$ su
# mkfs.ocfs2 -b 4K -C 32K -N 4 -L oradatafiles /dev/sda1
# mount -t ocfs2 -o datavolume,nointr /dev/sda1 /oracle/ocfs

 

2.8 安装配置ASM

$ su -
# rpm -Uvh oracleasm*.rpm
Preparing...########################################### [100%]
1:oracleasm-support ################################### [ 33%]
2:oracleasm- 2.4.21 -EL ################################# [ 67%]
Linking module oracleasm.o into the module path [  OK  ]
3:oracleasmlib    ######################################[100%]

$ su -
# /etc/init.d/oracleasm configure
Default user to own the driver interface []: oracle
Default group to own the driver interface []: dba
Start Oracle ASM library driver on boot (y/n) [n]: y
Fix permissions of Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration [ 
OK  ]
Creating /dev/oracleasm mount point [ 
OK  ]
Loading module "oracleasm" [ 
OK  ]
Mounting ASMlib driver filesystem [ 
OK  ]
Scanning system for ASM disks [ 
OK  ]

$ su -
# /etc/init.d/oracleasm createdisk VOL1 /dev/sda2
# /etc/init.d/oracleasm createdisk VOL2 /dev/sda3
# /etc/init.d/oracleasm createdisk VOL3 /dev/sda4
# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks [ 
OK  ]
# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3

 

 

3 安装集群软件

3.1 安装图解

./runInstaller

 

 

 

 

 

 

 

 

 

 

 

 

# cd /u01/app/oracle/oraInventory
# ./orainstRoot.sh

 

# cd ../product/
     
      10.2.0
     /crs
# ./root.sh

 

# cd /u01/app/oracle/product/
     
      10.2.0
     /crs/bin
# ./vipca

 

 

 

 

 

 

 

 

 

 

 

4 安装数据库软件

4.1 安装图解

./runInstaller

 

 

 

 

 

 

 

 

 

 

 

 

5 创建数据库

5.1 创建图解

$ dbca

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

5.2 配置图解

l        配置网络

 

$ netca

 

 

 

 

 

 

 

 

 

 

 

 

 

l        $ORACLE_HOME/network/admin/listener.ora

 

LISTENER_RAC1 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      (ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip.localdomain)(PORT = 1521)(IP = FIRST))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.101)(PORT = 1521)(IP = FIRST))
    )
  )

    
      
    
SID_LIST_LISTENER_RAC1 =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u01/app/oracle/product/
      
       10.2.0
      /db_1)
      (PROGRAM = extproc)
    )
  )

 

l        $ORACLE_HOME/network/admin/tnsnames.ora

 

racas =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip.localdomain)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip.localdomain)(PORT = 1521))
    (LOAD_BALANCE = yes)
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = racas)
    )
  )

    
      
    
LISTENERS_racas =
  (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip.localdomain)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip.localdomain)(PORT = 1521))
  )

    
      
    
racas2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip.localdomain)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = racas)
      (INSTANCE_NAME = racas2)
    )
  )

    
      
    
racas1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip.localdomain)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = racas)
      (INSTANCE_NAME = racas1)
    )
  )

 

6 集群启动/停止

6.1 集群状态查看

$ srvctl config database -d racas

$ srvctl status database -d racas

 

6.2 集群启动

$ export ORACLE_SID=racas

$ srvctl start nodeapps -n rac1

$ srvctl start nodeapps -n rac2

$ srvctl start asm -n rac1

$ srvctl start asm -n rac2

$ srvctl start instance -d racas -i racas1

$ srvctl start instance -d racas -i racas2

$ emctl start dbconsole

 

6.3 集群停止

$ export ORACLE_SID=racas

$ emctl stop dbconsole

$ srvctl stop instance -d racas -i racas1

$ srvctl stop instance -d racas -i racas2

$ srvctl stop asm -n rac1

$ srvctl stop asm -n rac2

$ srvctl stop nodeapps -n rac1

$ srvctl stop nodeapps -n rac2

 

6.4 启动/停止实例

$ srvctl start database -d racas

$ srvctl stop database -d racas

 

 

 

Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1595675

 

你可能感兴趣的:(Oracle 10g R2 RAC 安装配置说明书)