redhat AS5 下安裝oracle的三種儲存方式

lingsam發表於2013-06-20
Normal 0 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE1.  檔案系統

   #fdisk /dev/sda  劃分割槽sda2

   #mkdir /backup

   #mount /dev/sda2 /backup

2.  ASM

(1)     根據核心版本(uname -r)安裝asm

oracleasm-support-2.1.7-1.el5.ia64.rpm

oracleasmlib-2.0.4-1.el5.ia64.rpm

oracleasm-2.6.18-8.el5-2.0.4-1.el5.i686.rpm  (與核心版本有關)

(2)     確認selinux關閉

#vi  /etc/sysconfig/selinux  修改 selinux=disable

否則配置ASM會失敗

(3)     配置ASM使用者及版本資訊

#/etc/init.d/oracleasm configure

輸入使用者和組名  (oracle ,oinstall)

(4)     建立ASM磁碟組

方法1

1>建立檔案

#dd if=/dev/zero f=/backup/oradata/asm/sdd1 bs=1M count=300

#dd if=/dev/zero f=/backup/oradata/asm/sdd2 bs=1M count=300

2>將檔案虛擬成迴圈裝置

#/sbin/losetup /dev/loop1 /backup/oradata/asm/sdd1

#/sbin/losetup /dev/loop2 /backup/oradata/asm/sdd2

3>建立asm磁碟組

#/etc/init.d/oracleasm createdisk  VOL1  /dev/loop1

#/etc/init.d/oracleasm createdisk  VOL2  /dev/loop2

方法2

#fdisk /dev/sdb   新建立裝置檔案/dev/sdb1

#/etc/init.d/oracleasm createdisk  vol_sdb1  /dev/sdb1

方法3

#fdisk  /dev/sdb 建立分割槽sdb2,sdb3,型別為8e(lvm);sdb5為正常型別

#vi /etc/sysconfig/rawdevices  新增:(其中sdb2已加入vgdata中)

/dev/raw/raw2  /dev/sdb2

/dev/raw/raw3  /dev/sdb3

/dev/raw/raw5  /dev/sdb5

#chkconfig rawdevices on

#partprobe

       #service rawdevices restart   重起raw服務,識別raw

       #raw –qa

       #raw /dev/raw/raw2 0 0 刪除raw2

 

#vi /etc/rc.d/init.d/rawdevices  start處的assign_raw下新增:

Sleep 3

Chown –R oracle:oinstall /dev/raw/

 

 

建立的磁碟組會在/dev/oracleasm/disks下生成。

(5)     設定ASM自啟動

#vi /etc/rc.local  新增如下內容:

/sbin/losetup /dev/loop1 /backup/oradata/asm/sdd1

/sbin/losetup /dev/loop2 /backup/oradata/asm/sdd2

oracleasm scandisks

(6)     配置css服務

#/u01/db/bin/localconfig add

檢查css服務

#more /etc/inittab

h1:35:respawn:/etc/init.d/init.cssd run >/dev/null 2>&1

#ps –ef|grep css

(7)     D

3.  裸裝置(raw)

以下方法使用於redhat 5之後:

(1)     分割槽

#fdisk  /dev/sdc   分割槽sdc5-sdc15,sdc2sdc5 200M,其餘50M

(2)     修改檔案vi /etc/udev/rules.d/60-raw.rules

#新增對映關係及許可權

ACTION=="add", KERNEL=="sdc5", RUN+="/bin/raw /dev/raw/raw6 %N"

ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="37",RUN+="/bin/raw /dev/raw/raw6 %M %m"

ACTION=="add", KERNEL=="sdc6", RUN+="/bin/raw /dev/raw/raw7 %N"

ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="38",RUN+="/bin/raw /dev/raw/raw7 %M %m"

ACTION=="add", KERNEL=="sdc7", RUN+="/bin/raw /dev/raw/raw8 %N"

ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="39",RUN+="/bin/raw /dev/raw/raw8 %M %m"

ACTION=="add", KERNEL=="sdc8", RUN+="/bin/raw /dev/raw/raw9 %N"

ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="40",RUN+="/bin/raw /dev/raw/raw9 %M %m"

ACTION=="add", KERNEL=="sdc9", RUN+="/bin/raw /dev/raw/raw10 %N"

ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="41",RUN+="/bin/raw /dev/raw/raw10 %M %m"

ACTION=="add", KERNEL=="sdc10", RUN+="/bin/raw /dev/raw/raw11 %N"

ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="42",RUN+="/bin/raw /dev/raw/raw11 %M %m"

ACTION=="add", KERNEL=="sdc11", RUN+="/bin/raw /dev/raw/raw12 %N"

ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="43",RUN+="/bin/raw /dev/raw/raw12 %M %m"

ACTION=="add", KERNEL=="sdc12", RUN+="/bin/raw /dev/raw/raw13 %N"

ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="44",RUN+="/bin/raw /dev/raw/raw13 %M %m"

ACTION=="add", KERNEL=="sdc13", RUN+="/bin/raw /dev/raw/raw14 %N"

ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="45",RUN+="/bin/raw /dev/raw/raw14 %M %m"

ACTION=="add", KERNEL=="sdc14", RUN+="/bin/raw /dev/raw/raw15 %N"

ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="46",RUN+="/bin/raw /dev/raw/raw15 %M %m"

ACTION=="add", KERNEL=="sdc15", RUN+="/bin/raw /dev/raw/raw16 %N"

ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="47",RUN+="/bin/raw /dev/raw/raw16 %M %m"

ACTION=="add", KERNEL=="sdc2", RUN+="/bin/raw /dev/raw/raw17 %N"

ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="34",RUN+="/bin/raw /dev/raw/raw17 %M %m"

KERNEL=="raw*", WNER="oracle", GROUP="dba", MODE="660"

(3)     新建立檔案 dbca_raw.conf

system = /u01/oradata/raw/system

sysaux = /u01/oradata/raw/sysaux

undotbs1= /u01/oradata/raw/undotbs1

temp = /u01/oradata/raw/temp

users = /u01/oradata/raw/users

spfile = /u01/oradata/raw/spfile

control1 = /u01/oradata/raw/control01

control2 = /u01/oradata/raw/control02

control3 = /u01/oradata/raw/control03

redo1_1 = /u01/oradata/raw/redo01

redo1_2 = /u01/oradata/raw/redo02

redo1_2 = /u01/oradata/raw/redo03

(4)     建立連結

   #ln -s /dev/raw/raw6 /u01/oradata/raw/system

#ln -s /dev/raw/raw7 /u01/oradata/raw/sysaux

#ln -s /dev/raw/raw8 /u01/oradata/raw/undotbs1

#ln -s /dev/raw/raw9 /u01/oradata/raw/temp

#ln -s /dev/raw/raw10 /u01/oradata/raw/users

#ln -s /dev/raw/raw11 /u01/oradata/raw/spfile

#ln -s /dev/raw/raw12 /u01/oradata/raw/control01

#ln -s /dev/raw/raw13 /u01/oradata/raw/control02

#ln -s /dev/raw/raw14 /u01/oradata/raw/control03

#ln -s /dev/raw/raw15 /u01/oradata/raw/redo01

#ln -s /dev/raw/raw16 /u01/oradata/raw/redo02

#ln -s /dev/raw/raw17 /u01/oradata/raw/redo03

(5)     重啟服務

#start_udev

相關文章