单机环境安装配置ASM实例

ASM是oracle针对rac发布的存储产品,虽然是针对集群环境设置的,在单机环境上我们也可以采用ASM实例来管理磁盘。

(一)安装配置

一、确认linux内核版本

[root@sigleNode ~]# uname -r

2.6.18-53.el5xen

需要根据上面内核版本去oracle官网上下载指定的ASMLib包,链接地址

下载的具体包如下:

kernel-debug-2.6.18-53.el5.i686.rpm

kernel-PAE-2.6.18-53.el5.i686.rpm

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

oracleasm-2.6.18-53.el5debug-2.0.4-1.el5.i686.rpm

oracleasm-2.6.18-53.el5PAE-2.0.4-1.el5.i686.rpm

oracleasm-2.6.18-53.el5xen-2.0.4-1.el5.i686.rpm

oracleasmlib-2.0.4-1.el5.i386.rpm

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

其中前两个包在oracle官网上是下载不到的,需要在csdn上下载,也可以联系我

QQ16325095  邮箱 alei_1304@163.com

二、安装asmlib

[root@ sigleNode asm]# rpm -ivh *.rpm

三、添加两块硬盘,然后分区,不需要格式化

[root@ sigleNode dev]# fdisk /dev/hda

Command (m for help):n

Command action

  e  extended

  p  primary partition (1-4)

p

Partition number (1-4):1           

First cylinder (1-261, default 1):1 

Last cylinder or +size or +sizeM or +sizeK (1-261, default 261):261

 

Command (m for help):w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

Syncing disks.

执行同样命令对/dev/hdb进行分区即可

分区之后的结果如下:

[root@sigleNode ~]# fdisk -l

 

Disk /dev/hda: 2147 MB, 2147483648 bytes

16 heads, 63 sectors/track, 4161 cylinders

Units = cylinders of 1008 * 512 = 516096 bytes

 

   Device Boot      Start         End      Blocks   Id  System

/dev/hda1               1        4161     2097112+  83  Linux

 

Disk /dev/hdb: 2147 MB, 2147483648 bytes

16 heads, 63 sectors/track, 4161 cylinders

Units = cylinders of 1008 * 512 = 516096 bytes

 

   Device Boot      Start         End      Blocks   Id  System

/dev/hdb1               1        4161     2097112+  83  Linux

四、配置ASM环境

[root@ sigleNode~]# /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) [y]:

Scan for Oracle ASM disks on boot (y/n) [y]:

Writing Oracle ASM library driver configuration: done

Initializing the Oracle ASMLib driver:                    [ OK ]

Scanning the system for Oracle ASMLib disks:              [ OK ]

五、添加磁盘

[root@ sigleNode asm]# /etc/init.d/oracleasm createdisk VOL1 /dev/ hda1

Marking disk "VOL1" as an ASM disk:                       [ OK ]

[root@ sigleNode asm]# /etc/init.d/oracleasm createdisk VOL2 /dev/ hdb1

Marking disk "VOL2" as an ASM disk:                       [ OK ]

可以通过以下命令查询已经添加的ASM磁盘

[root@sigleNode ~]# /etc/init.d/oracleasm listdisks;

VOL1

VOL2

(二)创建ASM实例

oracle10g中创建ASM实例和数据库都可以采用DBCA,这在一定程度上隐藏了相关细节,下面采用手工创建ASM实例,其实和手工创建数据库大体类似创建参数文件,密码文件,dump路径

1、创建参数文件

[oracle@singleNode  db_1]$ vi $ORACLE_HOME/dbs/init+ASM.ora

*.asm_diskstring='ORCL:VOL*'

*.background_dump_dest='/opt/ora10g/admin/+ASM/bdump'

*.core_dump_dest='/opt/ora10g/admin/+ASM/cdump'

*.instance_type='asm'

*.large_pool_size=24M

*.remote_login_passwordfile='SHARED'

*.user_dump_dest='/opt/ora10g/admin/+ASM/udump'

保存修改

2、创建dump目录

[oracle@ singleNode ~]$ mkdir -p $ORACLE_BASE/admin/+ASM/udump

[oracle@ singleNode ~]$ mkdir -p $ORACLE_BASE /admin/+ASM/bdump

[oracle@ singleNode ~]$ mkdir -p $ORACLE_BASE g/admin/+ASM/cdump

3、创建密码文件

[oracle@localhost ~]$ orapwd file=orapw+ASM password=asm

4、启动ASM实例

[oracle@sigleNode ~]$ export ORACLE_SID=+ASM

[oracle@sigleNode ~]$ sqlplus / as sysdba

 

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Feb 18 06:38:08 2013

 

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

 

Connected to an idle instance.

 

SQL> startup

ORA-29701: unable to connect to Cluster Manager

由于单实例环境下默认不启动CSS,所以启动失败

需要添加CSS配置之后启动ASM实例

[oracle@sigleNode ~]$ localconfig add

You must be logged in as root to run /u01/app/oracle/product/10.2.0.1/bin/localconfig.

Log in as root and restart /u01/app/oracle/product/10.2.0.1/bin/localconfig execution.

系统提示必须以root用户执行localconfig命令

[oracle@sigleNode ~]$ su -

Password:

[root@sigleNode ~]# /u01/app/oracle/product/10.2.0.1/bin/localconfig add

/etc/oracle does not exist. Creating it now.

Successfully accumulated necessary OCR keys.

Creating OCR keys for user 'root', privgrp 'root'..

Operation successful.

Configuration for local CSS has been initialized

 

Adding to inittab

Startup will be queued to init within 90 seconds.

Checking the status of new Oracle init process...

Expecting the CRS daemons to be up within 600 seconds.

CSS is active on these nodes.

        siglenode

CSS is active on all nodes.

Oracle CSS service is installed and running under init(1M)

CSS配置完毕,再次启动ASM实例

[oracle@sigleNode ~]$ su -

Password:

[root@sigleNode ~]# su - oracle

[oracle@sigleNode ~]$ export ORACLE_SID=+ASM

[oracle@sigleNode ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Feb 18 06:42:03 2013

 

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

 

Connected to an idle instance.

 

SQL> startup

ASM instance started

 

Total System Global Area   96468992 bytes

Fixed Size                  1217908 bytes

Variable Size              70085260 bytes

ASM Cache                  25165824 bytes

ORA-15110: no diskgroups mounted

提示没有磁盘组需要加载

首先我们创建一下磁盘组

SQL> create diskgroup oradg1 external redundancy disk ‘ORCL:VOL1’;

SQL>diskGroup created

可以向现有磁盘组中增加磁盘

SQL> alter diskgroup oradg1 add  disk ‘ORCL:VOL2’;

SQL>diskGroup altered

设置磁盘组oradg1ASM实例默认加载的磁盘组

我们一开始没有创建spfile,所以需要创建一下

SQL>create spfile from pfile;

SQL> alter system set asm_diskgroups=oradg1 scope=spfile;

System altered.

SQL> shutdown

关闭ASM实例之后重新启动

SQL> startup

ASM instance started

 

Total System Global Area   96468992 bytes

Fixed Size                  1217908 bytes

Variable Size              70085260 bytes

ASM Cache                  25165824 bytes

ASM diskgroups mounted

 

发现磁盘组已经加载成功,ASM实例成功创建并启动成功

 

 

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7483882/viewspace-755700/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/7483882/viewspace-755700/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值