ITPub博客

首页 > Linux操作系统 > Linux操作系统 > oracle redhat 下cluster 配置管理

oracle redhat 下cluster 配置管理

原创 Linux操作系统 作者:yobyin 时间:2009-06-05 14:44:11 0 删除 编辑

1.1   redhat linux AS 4.0 安装

 

1) 安装Redhat AS4

关闭MSA1000, 分别在两台服务器下安装Redhat EL AS4,安装完之后,看dmesg,发现AS4已经能够把服务器上的HBA FCA2214驱动起来

2)安装驱动

分别在两台服务器上安装SmartStart CD中的PSP包,在/compaq/csp/linux

3)下载Linux AS4.0 对应update2 ,并安装

4) 升级linux,安装以下升级包

rpm -ivh freetype-devel-2.1.9-1.i386.rpm

rpm -ivh fontconfig-devel-2.2.3-7.i386.rpm

rpm -ivh xorg-x11-devel-6.8.2-1.EL.13.20.i386.rpm

rpm -ivh libjpeg-devel-6b-33.i386.rpm

rpm -ivh libtiff-devel-3.6.1-8.i386.rpm

rpm -ivh libungif-devel-4.1.3-1.i386.rpm

rpm -ivh alsa-lib-devel-1.0.6-5.RHEL4.i386.rpm

rpm -ivh audiofile-devel-0.2.6-1.i386.rpm

rpm -ivh esound-devel-0.2.35-2.i386.rpm

rpm-ivhg-x11-deprecated-libs-devel-6.8.2-1.EL.13.20.i38

rpm -ivh libaio-devel-0.3.103-3.i386.rpm

rpm -ivh nss_db-compat-2.2-29.i386.rpm

rpm -ivh glib-devel-1.2.10-15.i386.rpm

rpm -ivh gtk+-devel-1.2.10-33.i386.rpm

rpm -ivh imlib-devel-1.9.13-23.i386.rpm

rpm -ivh ORBit-devel-0.5.17-14.i386.rpm

rpm -ivh gnome-libs-devel-1.4.1.2.90-44.1.i386.rpm

5) Oracle兼容(p4198954_40_LINUX.zip

rpm -ivh compat-libcwait-2.1-1.i386.rpm

rpm -ivh compat-oracle-rhel4-1.0-5.i386.rpm

6) 创建用户及帐号

groupadd oinstall

groupadd dba

useradd -m -g oinstall -G dba oracle

passwd oracle

7) 配置Linux的内核参数

[root@srv /]# vi etc/sysctl.conf

# Created by Stone

kernel.shmmax = 1073741824

kernel.shmmni = 4096

kernel.shmall = 2097152

kernel.sem = 250 32000 100 128

fs.file-max = 65536

net.ipv4.ip_local_port_range = 1024 6500

[root@srv /]# sysctl -p

8) 设置Oracle对文件的要求

[root@srv /]# vi /etc/security/limits.conf

# Created by Stone

oracle soft memlock 3145728

oracle hard memlock 3145728

 

9) 准备Oracle安装目录

[root@srv /]# mkdir -p /home/oracle/product/9.2.0

[root@srv /]# chown -R oracle:dba /home/oracle

# 安装时orainstRoot.sh生成及运行处

[root@srv /]# mkdir /var/opt/oracle

[root@srv /]# chown -R oracle.dba /var/opt/oracle

Creating Oracle Inventory pointer file (/etc/oraInst.loc)

Changing groupname of /home/oracle/oraInventory to oinstall.

10)设置Oracle用户的环境变量

[root@srv /]# vi /home/oracle/.bash_profile

# export PATH

# unset USERNAME

 

# Created by Stone

# export LD_ASSUME_KERNEL=2.4.1

export LD_ASSUME_KERNEL=2.4.19

# export DISPLAY=192.168.1.251:0.0

 

# export JAVA_HOME=/usr/local/java

 

export ORACLE_BASE=/home/oracle

export ORACLE_HOME=$ORACLE_BASE/product/9.2.0

export ORACLE_SID=codora

export ORACLE_TERM=xterm

export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data

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

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

 

CLASSPATH=$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib

export CLASSPATH

export LANG=en_US

export DBCA_RAW_CONFIG=$ORACLE_BASE/DBCA_RAW_CONFIG

 

unset USERNAME

 

 

 

1.2   oracle 数据库的安装及配置

1) oracle 安装

root@srv /]# su - oracle

[root@srv /]# /xxx/Disk1/runInstaller

 

/home/oracle/product/9.2.0/root.sh

Running Oracle9 root.sh script...

\nThe following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /home/oracle/product/9.2.0

 

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 ...

 

\nCreating /etc/oratab file...

Adding entry to /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.sh script.

Now product-specific root actions will be performed.

2) Oracle补丁安装

[root@srv /]# unzip p4188455_10103_linux.zip

[root@srv /]# unzip p4163445_92070_LINUX.zip

[oracle@srv /unzip]# 4163445/Disk1/runInstaller -paramfile 4188455/oraparam.ini

[root@coddb1 ~]# /home/oracle/product/9.2.0/root.sh

Running Oracle9 root.sh script...

\nThe following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /home/oracle/product/9.2.0

 

Enter the full pathname of the local bin directory: [/usr/local/bin]:

The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]: y

   Copying dbhome to /usr/local/bin ...

The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]: y

   Copying oraenv to /usr/local/bin ...

The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]: y

   Copying coraenv to /usr/local/bin ...

 

Adding entry to /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.sh script.

Now product-specific root actions will be performed.

 

1.3   磁盘阵列柜MSA1000的配置

1)创建物理卷

[root@srv /]# fdisk /dev/sdc

[root@srv /]# pvcreate /dev/sdc

创建逻辑卷组

[root@srv /]# vgcreate -s 32M oradata /dev/sdc1

 

2)分配逻辑卷

# Data Files

lvcreate -L256M -ncwmlite oradata      sda1

lvcreate -L256M -ndrsys oradata          sda2

lvcreate -L256M -nexample oradata      sda3

# /dev/sda4:Used for creating the Extended Partition which starts as /dev/sda5

lvcreate -L256M -nindx oradata           sda5

lvcreate -L256M -nodm oradata           sda6

lvcreate -L2G -nsystem oradata            sda7

lvcreate -L256M -ntools oradata           sda8

lvcreate -L1.25G -nundotbs01 oradata  sda9

lvcreate -L2G -nusers oradata              sda10

lvcreate -L1G -nxbd01 oradata             sda11

lvcreate -L2G -ntemp oradata              sda12

# udump  256M      sda13

# bdump  256M      sda14

# cdump  256M      sda15

# Control Files

lvcreate -L1G -ncontrol01 oradata sdb1

lvcreate -L1G -ncontrol02 oradata sdb2

lvcreate -L1G -ncontrol03 oradata sdb3

# Redo Log Groups

# /dev/sdb4:Used for creating the Extended Partition which starts as /dev/sdb5

lvcreate -L256M -nredo01_1 oradata    sdb5

lvcreate -L256M -nredo02_1 oradata    sdb6

lvcreate -L256M -nredo03_1 oradata    sdb7

# redo01_2     256M      sdb8

# redo02_2     256M      sdb9

# redo03_2     256M      sdb10

 

3)建立裸设备

[root@srv /]# vi /etc/sysconfig/rawdevices

# Data Files

/dev/raw/raw1 /dev/sda1 #mapper/oradata-cwmlite

/dev/raw/raw2 /dev/sda2 #mapper/oradata-drsys

/dev/raw/raw3 /dev/sda3 #mapper/oradata-example

/dev/raw/raw4 /dev/sda5 #mapper/oradata-indx

/dev/raw/raw5 /dev/sda6 #mapper/oradata-odm

/dev/raw/raw6 /dev/sda7 #mapper/oradata-system

/dev/raw/raw7 /dev/sda8 #mapper/oradata-tools

/dev/raw/raw8 /dev/sda9 #mapper/oradata-undotbs01

/dev/raw/raw9 /dev/sda10      #mapper/oradata-users

/dev/raw/raw10      /dev/sda11      #mapper/oradata-xbd01

/dev/raw/raw11      /dev/sda12      #mapper/oradata-temp

/dev/raw/raw12      /dev/sda13      #udump

/dev/raw/raw13      /dev/sda14      #bdump

/dev/raw/raw14      /dev/sda15      #cdump

# Control Files

/dev/raw/raw15      /dev/sdb1 #mapper/oradata-control01

/dev/raw/raw16      /dev/sdb2 #mapper/oradata-control02

/dev/raw/raw17      /dev/sdb3 #mapper/oradata-control03

# Redo Log Groups

/dev/raw/raw18      /dev/sdb5 #mapper/oradata-redo01_1

/dev/raw/raw19      /dev/sdb6 #mapper/oradata-redo02_1

/dev/raw/raw20      /dev/sdb7 #mapper/oradata-redo03_1

/dev/raw/raw21      /dev/sdb8 #redo01_2

/dev/raw/raw22      /dev/sdb9 #redo02_2

/dev/raw/raw23      /dev/sdb10      #redo03_2

 

4)修改裸设备属主

[root@srv /]# service rawdevices restart

 

5)修改裸设备属主

[root@srv /]# vi /etc/rc.local

# Created by Stone

chown oracle:oinstall /dev/raw/raw1

chown oracle:oinstall /dev/raw/raw2

chown oracle:oinstall /dev/raw/raw3

chown oracle:oinstall /dev/raw/raw4

chown oracle:oinstall /dev/raw/raw5

chown oracle:oinstall /dev/raw/raw6

chown oracle:oinstall /dev/raw/raw7

chown oracle:oinstall /dev/raw/raw8

chown oracle:oinstall /dev/raw/raw9

chown oracle:oinstall /dev/raw/raw10

chown oracle:oinstall /dev/raw/raw11

chown oracle:oinstall /dev/raw/raw12

chown oracle:oinstall /dev/raw/raw13

chown oracle:oinstall /dev/raw/raw14

chown oracle:oinstall /dev/raw/raw15

chown oracle:oinstall /dev/raw/raw16

chown oracle:oinstall /dev/raw/raw17

chown oracle:oinstall /dev/raw/raw18

chown oracle:oinstall /dev/raw/raw19

chown oracle:oinstall /dev/raw/raw20  

chown oracle:oinstall /dev/raw/raw21

chown oracle:oinstall /dev/raw/raw22

chown oracle:oinstall /dev/raw/raw23

 

6)建立Oracle裸设备定义文件

[oracle@srv /]# vi $ORACLE_BASE/DBCA_RAW_CONFIG

# Data Files

cwmlite=/dev/raw/raw1

drsys=/dev/raw/raw2

example=/dev/raw/raw3

indx=/dev/raw/raw4

odm=/dev/raw/raw5

system=/dev/raw/raw6

tools=/dev/raw/raw7

undotbs01=/dev/raw/raw8

users=/dev/raw/raw9

xbd01=/dev/raw/raw10

temp=/dev/raw/raw11

udump=/dev/raw/raw12

bdump=/dev/raw/raw13

cdump=/dev/raw/raw14

# Control Files

control01=/dev/raw/raw15

control02=/dev/raw/raw16

control03=/dev/raw/raw17

# Redo Log Groups

redo01_1=/dev/raw/raw18

redo02_1=/dev/raw/raw19

redo03_1=/dev/raw/raw20

redo01_2=/dev/raw/raw21

redo02_2=/dev/raw/raw22

redo03_2=/dev/raw/raw23

 

 

 

 

 

 

 

 

 

 

 

 

 

1.4   redhat linux cluster 配置

1)redhat 官方网站下cluster 2.1

 

2)cluster 启动oralce

编写orad.ora

#!/bin/bash

# description: start or stop oracle

oracle_user=oracle

 

status() {

     local base=${1##*/}

     local pid

 

     # Test syntax.

     if [ "$#" = 0 ] ; then

            echo $"Usage: status {program}"

            return 1

     fi

 

     # First try "pidof"

     pid=`pidof -o $$ -o $PPID -o %PPID -x $1 || \

          pidof -o $$ -o $PPID -o %PPID -x ${base}`

     if [ -n "$pid" ]; then

             echo $"${base} (pid $pid) is running..."

             return 0

     fi

 

     # Next try "/var/run/*.pid" files

     if [ -f /var/run/${base}.pid ] ; then

             read pid < /var/run/${base}.pid

             if [ -n "$pid" ]; then

                     echo $"${base} dead but pid file exists"

                     return 1

             fi

     fi

     # See if /var/lock/subsys/${base} exists

     if [ -f /var/lock/subsys/${base} ]; then

            echo $"${base} dead but subsys locked"

            return 2

     fi

     echo $"${base} is stopped"

     return 3

}

 

start(){

# echo -n "starting oracle: "

su - "$oracle_user"<

lsnrctl start

sqlplus /nolog <

connect /as sysdba

startup

EOS

EOO

}

 

stop(){

# echo -n "stoping oracle: "

su - "$oracle_user"<

lsnrctl stop

sqlplus /nolog <

connect /as sysdba

shutdown immediate

EOS

EOO

}

 

case "$1" in

start)

start

touch /var/lock/subsys/orad

;;

 

stop)

stop

rm -f /var/lock/subsys/orad

;;

 

status)

status oracle

;;

 

restart)

stop

sleep 3

start

;;

 

*)

echo "$0 {start|stop|status|restart}"

;;

esac

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

上一篇: 人民大写转换
下一篇: rose ha 配置
请登录后发表评论 登录
全部评论

注册时间:2009-03-31

  • 博文量
    45
  • 访问量
    106092