install 11G ASM on RedHat step by step

viadeazhu發表於2010-03-10

此文step by step配置一個單機11G ASM instance on RedHat 虛擬機器。

首先假設你已經加上了4個500MB的硬碟,並且安裝完畢RedHat作業系統和11GR2的oracle binary。

1.根據機器型號、作業系統版本和核心號,選擇合適的ASMLIB下載:

: /export/home/oracle/asmlib > uname -r
2.6.18-8.el5

所以下載如下:

oracleasm-2.6.18-8.el5-2.0.4-1.el5.i686.rpm

oracleasm-support-2.1.3-1.el5.i386.rpm

oracleasmlib-2.0.4-1.el5.i386.rpm

然後安裝packages:

: /export/home/oracle/asmlib > rpm -Uvh *.rpm
warning: oracleasmlib-2.0.4-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:oracleasm-support      ########################################### [ 33%]
   2:oracleasm-2.6.18-8.el5 ########################################### [ 67%]
   3:oracleasmlib           ########################################### [100%]

2.配置ASMlib核心模組

: /export/home/oracle/asmlib > /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets ('[]').  Hitting without typing an
answer will keep that current value.  Ctrl-C will abort.

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
Scan for Oracle ASM disks on boot (y/n) [y]:
y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [  OK  ]
Scanning the system for Oracle ASMLib disks: [  OK  ]

此時模組已經啟動:
: /export/home/oracle/asmlib > lsmod | grep oracleasm
oracleasm              44436  1

3.對新加磁碟分割槽

首先在/dev目錄下找到我所新增的4塊新硬碟裝置:

: /dev > ls -altr sd*
brw-r----- 1 root disk 8,  0 Mar 11 05:11 sda
brw-r----- 1 root disk 8, 32 Mar 11 05:11 sdc
brw-r----- 1 root disk 8, 16 Mar 11 05:11 sdb
brw-r----- 1 root disk 8, 48 Mar 11 05:11 sdd

依次對此4硬碟分割槽,這裡以一個為例:

: /dev > fdisk /dev/sda
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. 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)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4):
1
First cylinder (1-63, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-63, default 63):
Using default value 63

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

最後我們會看到:

: /dev > ls -altr sd*1
brw-r----- 1 root disk 8,  1 Mar 11 06:12 sda1
brw-r----- 1 root disk 8, 17 Mar 11 06:19 sdb1
brw-r----- 1 root disk 8, 33 Mar 11 06:20 sdc1
brw-r----- 1 root disk 8, 49 Mar 11 06:20 sdd1

4.Create ASM Disks

: /dev > /etc/init.d/oracleasm createdisk VOL1 /dev/sda1
Marking disk "VOL1" as an ASM disk: [  OK  ]
: /dev > /etc/init.d/oracleasm createdisk VOL2 /dev/sdb1
Marking disk "VOL2" as an ASM disk: [  OK  ]
: /dev > /etc/init.d/oracleasm createdisk VOL3 /dev/sdc1
Marking disk "VOL3" as an ASM disk: [  OK  ]
: /dev > /etc/init.d/oracleasm createdisk VOL4 /dev/sdd1
Marking disk "VOL4" as an ASM disk: [  OK  ]

: /dev > /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
VOL4

5.啟動 +ASM instance

首先設定環境變數:

: ~ > env|grep ORA
ORA_NLS10=/disk2/oracle/products/11r2/nls/data
ORACLE_SID=+ASM
ORACLE_BASE=/disk2/oracle/products
ORACLE_HOME=/disk2/oracle/products/11r2

初始化檔案:

這裡我們使用的是ASMlib,所以asm_diskstring應該這樣寫。

: ~/products/11r2/dbs > cat init+ASM.ora
background_dump_dest='/export/home/oracle/asminstance/bdump'
user_dump_dest='/export/home/oracle/asminstance/udump'
core_dump_dest='/export/home/oracle/asminstance/cdump'
instance_type=asm
large_pool_size=12M
#asm_diskstring='/dev/rdsk/c3t19d*s4'
asm_diskstring='ORCL:VOL*'
remote_login_passwordfile='SHARED'

password file:

: ~/products/11r2/dbs > orapwd file=orapw+ASM password=oracle

啟動ASM instance:

: ~ > env|grep ORA
ORA_NLS10=/disk2/oracle/products/11r2/nls/data
ORACLE_SID=+ASM
ORACLE_BASE=/disk2/oracle/products
ORACLE_HOME=/disk2/oracle/products/11r2
: ~ > sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Thu Mar 11 17:52:11 2010

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORA-01078: failure in processing system parameters
ORA-29701: unable to connect to Cluster Synchronization Service

 

 

 

 

 

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15415488/viewspace-629180/,如需轉載,請註明出處,否則將追究法律責任。

相關文章