oracle asm安装配置
[color=rgb(57, 57, 57)][font=verdana,]一、安装ASM之前,首先要检查一下linux操作系统的版本[root@yft ~# lsb_release [color=#808080]-aLSB Version: :core[color=#808080]-[color=#8000]3.1[color=#808080]-ia32:core[color=#808080]-[color=#8000]3.1[color=#808080]-noarch:graphics[color=#808080]-[color=#8000]3.1[color=#808080]-ia32:graphics[color=#808080]-[color=#8000]3.1[color=#808080]-noarchDistributor ID: RedHatEnterpriseServerDescription: Red Hat Enterprise Linux Server release [color=#8000]5.4 (Tikanga)Release: [color=#8000]5.4Codename: Tikanga
[root@yft ~# uname [color=#808080]-rm[color=#8000]2.6.[color=#8000]18[color=#808080]-[color=#8000]164.el5 i686
此时可以到oracle官网去下载相应的rpm包,链接地址:[color=#6466b3]http://www.oracle.com/technetwork/server-storage/linux/downloads/rhel5-084877.html
[color=rgb(57, 57, 57)][font=verdana,]根据本机的配置,需要下载并安装如下3个rpm包:[color=#6466b3]][img]http://common.cnblogs.com/images/copycode.gif[/img]
[root@yft 1234# lsoracleasm[color=#808080]-[color=#8000]2.6.[color=#8000]18[color=#808080]-[color=#8000]164.el5[color=#808080]-[color=#8000]2.0.[color=#8000]5[color=#808080]-[color=#8000]1.el5.i686.rpmoracleasmlib[color=#808080]-[color=#8000]2.0.[color=#8000]4[color=#808080]-[color=#8000]1.el5.i386.rpmoracleasm[color=#808080]-support[color=#808080]-[color=#8000]2.1.[color=#8000]7[color=#808080]-[color=#8000]1.el5.i386.rpm[root@yft 1234# rpm [color=#808080]-ivh oracleasm[color=#808080]*warning: oracleasm[color=#808080]-[color=#8000]2.6.[color=#8000]18[color=#808080]-[color=#8000]164.el5[color=#808080]-[color=#8000]2.0.[color=#8000]5[color=#808080]-[color=#8000]1.el5.i686.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159Preparing... ########################################### [100% [color=#8000]1:oracleasm[color=#808080]-support ########################################### [ 33% [color=#8000]2:oracleasm[color=#808080]-[color=#8000]2.6.[color=#8000]18[color=#808080]-[color=#8000]164.el########################################### [ 67% [color=#8000]3:oracleasmlib ########################################### [100%[color=#6466b3]][img]http://common.cnblogs.com/images/copycode.gif[/img]
[color=rgb(57, 57, 57)][font=verdana,]二、配置ASMlib,再使用ASMlib之前,必须运行配置脚本准备驱动程序:
使用root执行:/etc/init.d/oracleasm configure[color=#6466b3]][img]http://common.cnblogs.com/images/copycode.gif[/img]
[root@yft 1234# [color=#808080]/etc[color=#808080]/init.d[color=#808080]/oracleasm configureConfiguring the Oracle ASM library driver.This will configure the on[color=#808080]-boot properties of the Oracle ASM librarydriver. The following questions will determine whether the driver isloaded on boot [color=#808080]and what [color=#ff0ff]permissions it will have. The current valueswill be shown [color=#808080]in brackets ('[]'). Hitting [color=#808080]
[color=rgb(57, 57, 57)][font=verdana,]三、配置ASM磁盘:[color=#6466b3]][img]http://common.cnblogs.com/images/copycode.gif[/img]
[root@yft 1234# fdisk [color=#808080]/dev[color=#808080]/sdfDevice contains neither a valid DOS partition table, nor Sun, SGI [color=#808080]or OSF disklabelBuilding a new DOS disklabel. Changes will remain [color=#808080]in memory only,until you decide to write them. After that, of course, the previouscontent won't be recoverable.Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)Command (m for help): pDisk /dev/sdf: 4294 MB, 4294967296 bytes255 heads, 63 sectors/track, 522 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id SystemCommand (m for help): nCommand action e extended p primary partition (1-4)pPartition number (1-4): 1First cylinder (1-522, default 1): Using default value 1Last cylinder or +size or +sizeM or +sizeK (1-522, default 522): Using default value 522Command (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.[root@yft 1234]# partprobe[root@yft 1234]# /etc/init.d/oracleasm createdisk vol1 /dev/sdf1Marking disk "vol1" as an ASM disk: [ OK ][color=#6466b3]][img]http://common.cnblogs.com/images/copycode.gif[/img]
[color=rgb(57, 57, 57)][font=verdana,]四、创建需要的用户和用户组:[color=rgb(57, 57, 57)][font=verdana,]使用root用户执行:[color=rgb(57, 57, 57)][font=verdana,]/usr/sbin/groupadd -g 501 oinstall[color=rgb(57, 57, 57)][font=verdana,]/usr/sbin/groupadd -g 502 dba[color=rgb(57, 57, 57)][font=verdana,]/usr/sbin/groupadd -g 503 oper[color=rgb(57, 57, 57)][font=verdana,]/usr/sbin/groupadd -g 504 asmadmin[color=rgb(57, 57, 57)][font=verdana,]/usr/sbin/groupadd -g 505 asmoper[color=rgb(57, 57, 57)][font=verdana,]/usr/sbin/groupadd -g 506 asmdba[color=rgb(57, 57, 57)][font=verdana,]/usr/sbin/useradd -g oinstall -G dba,asmdba,oper oracle[color=rgb(57, 57, 57)][font=verdana,]/usr/sbin/useradd -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid
[color=rgb(57, 57, 57)][font=verdana,]mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1[color=rgb(57, 57, 57)][font=verdana,]mkdir -p /u01/app/oracle/grid/product/11.2.0/grid[color=rgb(57, 57, 57)][font=verdana,]chown -R oracle:oinstall /u01/app/[color=rgb(57, 57, 57)][font=verdana,]chown -R grid:oinstall /u01/app/grid[color=rgb(57, 57, 57)][font=verdana,]chomod -R 775 /u01[color=#6466b3]][img]http://common.cnblogs.com/images/copycode.gif[/img]
[color=#08080] 1 [oracle@yft ~$ vi .bash_profile [color=#08080] 2 [color=#08080] 3 if [ -f ~/.bashrc ; then[color=#08080] 4 . [color=#808080]~/.bashrc[color=#08080] 5 fi[color=#08080] 6 [color=#08080] 7 # [color=#ff0ff]User specific environment [color=#808080]and startup programs[color=#08080] 8 [color=#08080] 9 PATH[color=#808080]=$PATH:$HOME[color=#808080]/bin[color=#08080]10 [color=#08080]11 export PATH[color=#08080]12 #[color=#08080]13 #ORACLE_11G [color=#08080]14 ORACLE_BASE[color=#808080]=/u01[color=#808080]/app[color=#808080]/oracle[color=#08080]15 ORACLE_HOME[color=#808080]=$ORACLE_BASE[color=#808080]/product[color=#808080]/[color=#8000]11.2.[color=#8000]0[color=#808080]/db_1[color=#08080]16 ORACLE_SID[color=#808080]=yft[color=#08080]17 PATH[color=#808080]=$PATH:$ORACLE_HOME[color=#808080]/bin[color=#08080]18 export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH[color=#08080]19 #end[color=#08080]20 [color=#08080]21 [grid@yft ~$ view .bash_profile [color=#08080]22 [color=#08080]23 # .bash_profile[color=#08080]24 [color=#08080]25 # Get the aliases [color=#808080]and functions[color=#08080]26 if [ -f ~/.bashrc ; then[color=#08080]27 . [color=#808080]~/.bashrc[color=#08080]28 fi[color=#08080]29 # .bash_profile[color=#08080]30 [color=#08080]31 # Get the aliases [color=#808080]and functions[color=#08080]32 if [ -f ~/.bashrc ; then[color=#08080]33 . [color=#808080]~/.bashrc[color=#08080]34 fi[color=#08080]35 [color=#08080]36 # [color=#ff0ff]User specific environment [color=#808080]and startup programs[color=#08080]37 [color=#08080]38 PATH[color=#808080]=$PATH:$HOME[color=#808080]/bin[color=#08080]39 [color=#08080]40 export PATH[color=#08080]41 [color=#08080]42 #ORACLE_11G[color=#08080]43 ORACLE_BASE[color=#808080]=/u01[color=#808080]/app[color=#808080]/grid[color=#08080]44 ORACLE_HOME[color=#808080]=$ORACLE_BASE[color=#808080]/product[color=#808080]/[color=#8000]11.2.[color=#8000]0[color=#808080]/grid[color=#08080]45 ORACLE_SID[color=#808080]=+ASM[color=#08080]46 PATH[color=#808080]=$PATH:$ORACLE_HOME[color=#808080]/bin[color=#08080]47 export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH[color=#08080]48 #end[color=#6466b3]][img]http://common.cnblogs.com/images/copycode.gif[/img]
[color=rgb(57, 57, 57)][font=verdana,]五、配置grid infrastructure:[color=#6466b3]][img]http://common.cnblogs.com/images/copycode.gif[/img]
[grid@yft u01$ cd grid[color=#808080]/[grid@yft grid$ lsdoc response runcluvfy.sh sshsetup welcome.htmlinstall rpm runInstaller stage[grid@yft grid$ .[color=#808080]/runInstaller Starting Oracle Universal Installer...Checking Temp [color=#ff0ff]space: must be greater than [color=#8000]80 MB. Actual [color=#8000]1031 MB PassedChecking swap [color=#ff0ff]space: must be greater than [color=#8000]150 MB. Actual [color=#8000]2047 MB PassedChecking monitor: must be configured to display at least [color=#8000]256 colors. Actual [color=#8000]16777216 PassedPreparing to launch Oracle Universal Installer from [color=#808080]/tmp[color=#808080]/OraInstall2013[color=#808080]-[color=#8000]03[color=#808080]-20_[color=#8000]10[color=#808080]-[color=#8000]36[color=#808080]-24PM. Please wait ...[color=#6466b3]][img]http://common.cnblogs.com/images/copycode.gif[/img]
[color=rgb(57, 57, 57)][font=verdana,]安装顺带配置ASM,当然也可以选最后一个只安装软件,随后手工配置(具体请自行查看文档):[color=rgb(57, 57, 57)][font=verdana,][img]http://images.cnitblog.com/blog/437881/201303/20230542-c86bf0e6042545e0b27c621e9c5d1074.png[/img][color=rgb(57, 57, 57)][font=verdana,] ASM磁盘配置正常的话会直接显示下面的内容:[color=rgb(57, 57, 57)][font=verdana,][img]http://images.cnitblog.com/blog/437881/201303/20230622-b31438fa955e4fb69f1373f6e1718756.png[/img][color=rgb(57, 57, 57)][font=verdana,] Oracle会要求密码强度,当然可以忽略过去,这里使用Oracle1234:[color=rgb(57, 57, 57)][font=verdana,][img]http://images.cnitblog.com/blog/437881/201303/20230701-115e3018cfa64761820dbdb1e75df889.png[/img][color=rgb(57, 57, 57)][font=verdana,] 下面选择组的话可以保持默认:[color=rgb(57, 57, 57)][font=verdana,][img]http://images.cnitblog.com/blog/437881/201303/20230741-5587513e435642748b8cef2343c17aa2.png[/img][color=rgb(57, 57, 57)][font=verdana,] 需要配置1.5G以上物理内存:[color=rgb(57, 57, 57)][font=verdana,][img]http://images.cnitblog.com/blog/437881/201303/20230810-0439a3cd83fa4e608776130de5d0f66c.png[/img][color=rgb(57, 57, 57)][font=verdana,] 最后确认安装:[color=rgb(57, 57, 57)][font=verdana,][img]http://images.cnitblog.com/blog/437881/201303/20230842-4a772848bfe74edba325d5215b5b4d52.png[/img][color=rgb(57, 57, 57)][font=verdana,]在76%处会卡住属于正常,随机会跳出下面的画面,使用root用户运行一下就可以了:[color=rgb(57, 57, 57)][font=verdana,][img]http://images.cnitblog.com/blog/437881/201303/20231428-ecb5de0f719c486a8534e88c30fd808a.png[/img]
[color=#6466b3]][img]http://common.cnblogs.com/images/copycode.gif[/img]
[root@yft 1234# [color=#808080]/u01[color=#808080]/app[color=#808080]/grid[color=#808080]/product[color=#808080]/[color=#8000]11.2.[color=#8000]0[color=#808080]/grid[color=#808080]/root.sh Running Oracle 11g root.sh script...The following environment variables are set as: ORACLE_OWNER[color=#808080]= grid ORACLE_HOME[color=#808080]= [color=#808080]/u01[color=#808080]/app[color=#808080]/grid[color=#808080]/product[color=#808080]/[color=#8000]11.2.[color=#8000]0[color=#808080]/gridEnter the full pathname of the local bin directory: [/usr/local/bin: The file "dbhome" already [color=#808080]exists [color=#808080]in [color=#808080]/usr[color=#808080]/local[color=#808080]/bin. Overwrite it? (y[color=#808080]/n) [n: nThe file "oraenv" already [color=#808080]exists [color=#808080]in [color=#808080]/usr[color=#808080]/local[color=#808080]/bin. Overwrite it? (y[color=#808080]/n) [n: nThe file "coraenv" already [color=#808080]exists [color=#808080]in [color=#808080]/usr[color=#808080]/local[color=#808080]/bin. Overwrite it? (y[color=#808080]/n) [n: nEntries will be added to the [color=#808080]/etc[color=#808080]/oratab file as needed byDatabase Configuration Assistant when a database is createdFinished running generic part of root.sh script.Now product[color=#808080]-specific root actions will be performed.[color=#8000]2013[color=#808080]-[color=#8000]03[color=#808080]-[color=#8000]20 [color=#8000]23:[color=#8000]11:[color=#8000]13: Checking for super [color=#ff0ff]user privileges[color=#8000]2013[color=#808080]-[color=#8000]03[color=#808080]-[color=#8000]20 [color=#8000]23:[color=#8000]11:[color=#8000]13: [color=#ff0ff]User has super [color=#ff0ff]user privileges[color=#8000]2013[color=#808080]-[color=#8000]03[color=#808080]-[color=#8000]20 [color=#8000]23:[color=#8000]11:[color=#8000]13: Parsing the host nameUsing configuration parameter file: [color=#808080]/u01[color=#808080]/app[color=#808080]/grid[color=#808080]/product[color=#808080]/[color=#8000]11.2.[color=#8000]0[color=#808080]/grid[color=#808080]/crs[color=#808080]/install[color=#808080]/crsconfig_paramsCreating trace directoryLOCAL ADD MODE Creating OCR keys for [color=#ff0ff]user 'grid', privgrp 'oinstall'..Operation successful.CRS[color=#808080]-[color=#8000]4664: Node yft successfully pinned.Adding daemon to inittabCRS[color=#808080]-[color=#8000]4123: Oracle High Availability Services has been started.ohasd is startingyft [color=#8000]2013[color=#808080]/[color=#8000]03[color=#808080]/[color=#8000]20 [color=#8000]23:[color=#8000]12:[color=#8000]30 [color=#808080]/u01[color=#808080]/app[color=#808080]/grid[color=#808080]/product[color=#808080]/[color=#8000]11.2.[color=#8000]0[color=#808080]/grid[color=#808080]/cdata[color=#808080]/yft[color=#808080]/backup_20130320_231230.olrSuccessfully configured Oracle Grid Infrastructure for a Standalone ServerUpdating inventory properties for clusterwareStarting Oracle Universal Installer...Checking swap [color=#ff0ff]space: must be greater than [color=#8000]500 MB. Actual [color=#8000]1816 MB PassedThe inventory pointer is located at [color=#808080]/etc[color=#808080]/oraInst.locThe inventory is located at [color=#808080]/u01[color=#808080]/app[color=#808080]/oraInventory'UpdateNodeList' was successful.[color=#6466b3]][img]http://common.cnblogs.com/images/copycode.gif[/img]
[color=rgb(57, 57, 57)][font=verdana,][img]http://images.cnitblog.com/blog/437881/201303/20231520-240848087b6246e89613badc031f281a.png[/img][color=rgb(57, 57, 57)][font=verdana,][img]http://images.cnitblog.com/blog/437881/201303/20231559-c9cf84c305f342198144c652a2e4177a.png[/img] [color=#6466b3]][img]http://common.cnblogs.com/images/copycode.gif[/img]
[grid@yft ~$ sqlplus [color=#808080]/nologSQL[color=#808080]*Plus: Release [color=#8000]11.2.[color=#8000]0.1.[color=#8000]0 Production on Thu Mar [color=#8000]21 [color=#8000]16:[color=#8000]00:[color=#8000]41 [color=#8000]2013Copyright (c) [color=#8000]1982, [color=#8000]2009, Oracle. [color=#808080]All rights reserved.SQL[color=#808080]> conn [color=#808080]/as sysdbaConnected.SQL[color=#808080]> select name,state from v$asm_diskgroup;NAME STATE[color=#08080]--[color=#08080]---------------------------- -----------DATA MOUNTED