ASM的安裝配置

we6100發表於2015-12-03
一、首先建立需要的使用者和使用者組,以及配置環境變數

使用root使用者執行:
/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
mkdir -p /opt/app/oracle/product/11.2.0/dbhome_1/
mkdir -p /opt/app/oracle/grid/product/11.2.0/grid
chown -R oracle:oinstall /opt/app
chown -R grid.oinstall /opt/app/oracle/grid
chomod -R 775 /opt
[grid@oracle ~]$ vi .bash_profile 新增以下內容
#ORACLE_11G
ORACLE_BASE=/opt/app/grid
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/grid
ORACLE_SID=+ASM
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
#end

二、檢查一下linux作業系統的版本
[root@oracle ~]# lsb_release -a
LSB Version:    :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: RedHatEnterpriseServer
Description:    Red Hat Enterprise Linux Server release 5.4 (Tikanga)
Release:        5.4
Codename:       Tikanga
[root@oracle ~]# uname -rm
2.6.18-194.el5 x86_64
然後到oracle官網去下載相應的asm rpm包,連結地址:http://www.oracle.com/technetwork/server-storage/linux/downloads/rhel5-084877.html 
根據本機的配置,需要下載並安裝如下3個rpm包:
[root@oracle tmp]# ls -l *.rpm
-rwxrw-rw- 1 root root 137637 Dec  1 01:19 oracleasm-2.6.18-194.11.4.el5-2.0.5-1.el5.x86_64.rpm
-rwxrw-rw- 1 root root  14176 Dec  1 01:17 oracleasmlib-2.0.4-1.el5.x86_64.rpm
-rwxrw-rw- 1 root root  90225 Dec  1 01:17 oracleasm-support-2.1.8-1.el5.x86_64.rpm


[root@oracle tmp]#rpm -ivh oracleasm* 
warning: oracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%] 
1:oracleasm-support ########################################### [ 33%] 
2:oracleasm-2.6.18-194.el####################################### [ 67%] 
3:oracleasmlib ###############################################[100%]


三、配置ASMlib,再使用ASMlib之前,必須執行配置指令碼準備驅動程式:
[root@oracle tmp]# /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 <ENTER> 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  ]


[root@oracle tmp]# /etc/init.d/oracleasm enable
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver:                     [  OK  ]
Scanning the system for Oracle ASMLib disks:               [  OK  ]
root@oracle tmp]#/fdisk /dev/sdb


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): p


Disk /dev/sdb: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes


   Device Boot      Start         End      Blocks   Id  System


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


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


Calling ioctl() to re-read partition table.
Syncing disks.
然後再對sdc分割槽
[root@oracle tmp]# partprobe
[root@oracle tmp]# /etc/init.d/oracleasm createdisk vol1 /dev/sdb
Marking disk "vol1" as an ASM disk:                        [  OK  ]
[root@oracle tmp]# /etc/init.d/oracleasm createdisk vol2 /dev/sdc
五、安裝grid

grid地址http://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-linx8664soft-100572.html








 
檢查依賴關係,有些可以通過grid自帶指令碼修復,點下面的fix&Check Again,他會提示你跑某個指令碼去修復。
例如 CVU_11.2.0.1.0_grid/runfixup.sh這個指令碼修復
[root@oracle CVU_11.2.0.1.0_grid]# ./CVU_11.2.0.1.0_grid/runfixup.sh
 

安裝
 
安裝到76%時 ,需要root跑指令碼,成功後,基本上過一會就安裝完成了
 

[root@oracle CVU_11.2.0.1.0_grid]# sh /opt/app/oracle/grid/product/11.2.0/grid/root.sh
Running Oracle 11g root.sh script...


The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /opt/app/oracle/grid/product/11.2.0/grid


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]:
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]:
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]:


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.
2015-12-01 22:32:13: Checking for super user privileges
2015-12-01 22:32:13: User has super user privileges
2015-12-01 22:32:13: Parsing the host name
Using configuration parameter file: /opt/app/oracle/grid/product/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
CRS-4664: Node oracle successfully pinned.
Adding daemon to inittab
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting


oracle     2015/12/01 22:32:54     /opt/app/oracle/grid/product/11.2.0/grid/cdata/oracle/backup_20151201_223254.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
Updating inventory properties for clusterware
Starting Oracle Universal Installer...


Checking swap space: must be greater than 500 MB.   Actual 3039 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /opt/app/oracle/oraInventory
'UpdateNodeList' was successful.


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

相關文章