博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Oracle ASM安装和配置
阅读量:4653 次
发布时间:2019-06-09

本文共 7561 字,大约阅读时间需要 25 分钟。

一、安装ASM之前,首先要检查一下linux操作系统的版本

[root@yft ~]# lsb_release -aLSB Version:    :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarchDistributor ID:    RedHatEnterpriseServerDescription:    Red Hat Enterprise Linux Server release 5.4 (Tikanga)Release:    5.4Codename:    Tikanga
[root@yft ~]# uname -rm2.6.18-164.el5 i686 此时可以到oracle官网去下载相应的rpm包,链接地址:

根据本机的配置,需要下载并安装如下3个rpm包:

[root@yft 1234]# lsoracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpmoracleasmlib-2.0.4-1.el5.i386.rpmoracleasm-support-2.1.7-1.el5.i386.rpm[root@yft 1234]# rpm -ivh oracleasm*warning: oracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159Preparing...                ########################################### [100%]   1:oracleasm-support      ########################################### [ 33%]   2:oracleasm-2.6.18-164.el########################################### [ 67%]   3:oracleasmlib           ########################################### [100%]

二、配置ASMlib,再使用ASMlib之前,必须运行配置脚本准备驱动程序:

使用root执行:/etc/init.d/oracleasm configure

[root@yft 1234]# /etc/init.d/oracleasm configureConfiguring the Oracle ASM library driver.This will configure the on-boot properties of the Oracle ASM librarydriver.  The following questions will determine whether the driver isloaded on boot and what permissions it will have.  The current valueswill be shown in brackets ('[]').  Hitting 
without typing ananswer will keep that current value. Ctrl-C will abort.Default user to own the driver interface []: oracleDefault group to own the driver interface []: dbaStart Oracle ASM library driver on boot (y/n) [n]: yScan for Oracle ASM disks on boot (y/n) [y]: yWriting Oracle ASM library driver configuration: doneInitializing the Oracle ASMLib driver: [ OK ]Scanning the system for Oracle ASMLib disks: [ OK ][root@yft 1234]# /etc/init.d/oracleasm enableWriting Oracle ASM library driver configuration: doneInitializing the Oracle ASMLib driver: [ OK ]Scanning the system for Oracle ASMLib disks: [ OK ]

三、配置ASM磁盘:

[root@yft 1234]# fdisk /dev/sdfDevice contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel. Changes will remain 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  ]

四、创建需要的用户和用户组:

使用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 /u01/app/oracle/product/11.2.0/dbhome_1

mkdir -p /u01/app/oracle/grid/product/11.2.0/grid

chown -R oracle:oinstall /u01/app/

chown -R grid:oinstall /u01/app/grid

chomod -R 775 /u01

1 [oracle@yft ~]$ vi .bash_profile  2  3 if [ -f ~/.bashrc ]; then 4         . ~/.bashrc 5 fi 6  7 # User specific environment and startup programs 8  9 PATH=$PATH:$HOME/bin10 11 export PATH12 #13 #ORACLE_11G 14 ORACLE_BASE=/u01/app/oracle15 ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_116 ORACLE_SID=yft17 PATH=$PATH:$ORACLE_HOME/bin18 export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH19 #end20 21 [grid@yft ~]$ view .bash_profile 22 23 # .bash_profile24 25 # Get the aliases and functions26 if [ -f ~/.bashrc ]; then27         . ~/.bashrc28 fi29 # .bash_profile30 31 # Get the aliases and functions32 if [ -f ~/.bashrc ]; then33         . ~/.bashrc34 fi35 36 # User specific environment and startup programs37 38 PATH=$PATH:$HOME/bin39 40 export PATH41 42 #ORACLE_11G43 ORACLE_BASE=/u01/app/grid44 ORACLE_HOME=$ORACLE_BASE/product/11.2.0/grid45 ORACLE_SID=+ASM46 PATH=$PATH:$ORACLE_HOME/bin47 export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH48 #end

五、配置grid infrastructure:

[grid@yft u01]$ cd grid/[grid@yft grid]$ lsdoc      response  runcluvfy.sh  sshsetup  welcome.htmlinstall  rpm       runInstaller  stage[grid@yft grid]$ ./runInstaller Starting Oracle Universal Installer...Checking Temp space: must be greater than 80 MB.   Actual 1031 MB    PassedChecking swap space: must be greater than 150 MB.   Actual 2047 MB    PassedChecking monitor: must be configured to display at least 256 colors.    Actual 16777216    PassedPreparing to launch Oracle Universal Installer from /tmp/OraInstall2013-03-20_10-36-24PM. Please wait ...

安装顺带配置ASM,当然也可以选最后一个只安装软件,随后手工配置(具体请自行查看文档):

 ASM磁盘配置正常的话会直接显示下面的内容:

 Oracle会要求密码强度,当然可以忽略过去,这里使用Oracle1234:

 下面选择组的话可以保持默认:

 需要配置1.5G以上物理内存:

 最后确认安装:

在76%处会卡住属于正常,随机会跳出下面的画面,使用root用户运行一下就可以了:

 

 

[root@yft 1234]# /u01/app/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=  /u01/app/grid/product/11.2.0/gridEnter 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]: nThe file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n) [n]: nThe file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n) [n]: nEntries will be added to the /etc/oratab file as needed byDatabase Configuration Assistant when a database is createdFinished running generic part of root.sh script.Now product-specific root actions will be performed.2013-03-20 23:11:13: Checking for super user privileges2013-03-20 23:11:13: User has super user privileges2013-03-20 23:11:13: Parsing the host nameUsing configuration parameter file: /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_paramsCreating trace directoryLOCAL ADD MODE Creating OCR keys for user 'grid', privgrp 'oinstall'..Operation successful.CRS-4664: Node yft successfully pinned.Adding daemon to inittabCRS-4123: Oracle High Availability Services has been started.ohasd is startingyft     2013/03/20 23:12:30     /u01/app/grid/product/11.2.0/grid/cdata/yft/backup_20130320_231230.olrSuccessfully configured Oracle Grid Infrastructure for a Standalone ServerUpdating inventory properties for clusterwareStarting Oracle Universal Installer...Checking swap space: must be greater than 500 MB.   Actual 1816 MB    PassedThe inventory pointer is located at /etc/oraInst.locThe inventory is located at /u01/app/oraInventory'UpdateNodeList' was successful.

 

[grid@yft ~]$ sqlplus /nologSQL*Plus: Release 11.2.0.1.0 Production on Thu Mar 21 16:00:41 2013Copyright (c) 1982, 2009, Oracle.  All rights reserved.SQL> conn /as sysdbaConnected.SQL> select name,state from v$asm_diskgroup;NAME                   STATE------------------------------ -----------DATA                   MOUNTED

 

转载于:https://www.cnblogs.com/Richardzhu/articles/2972256.html

你可能感兴趣的文章
web渗透测试基本步骤
查看>>
使用Struts2标签遍历集合
查看>>
angular.isUndefined()
查看>>
第一次软件工程作业(改进版)
查看>>
网络流24题-飞行员配对方案问题
查看>>
Jenkins 2.16.3默认没有Launch agent via Java Web Start,如何配置使用
查看>>
引入css的四种方式
查看>>
iOS开发UI篇—transframe属性(形变)
查看>>
3月7日 ArrayList集合
查看>>
jsp 环境配置记录
查看>>
Python03
查看>>
LOJ 2537 「PKUWC2018」Minimax
查看>>
使用java中replaceAll方法替换字符串中的反斜杠
查看>>
Some configure
查看>>
流量调整和限流技术 【转载】
查看>>
1 线性空间
查看>>
VS不显示最近打开的项目
查看>>
DP(动态规划)
查看>>
chkconfig
查看>>
2.抽取代码(BaseActivity)
查看>>