单机搭建ASM环境

准备:

1.centos系统

2.Oracle database10G+instance

3.与系统匹配的ASMlib包

4.  3块磁盘

 

一、安装ASMlib,初始化ASMlib

创建asm能识别的disk。

/dev/sdb1 > VOL1

/dev/sdc1 > VOL2

/dev/sdd1 > VOL3

 

二、需要创建一份pfile(init+ASM.ora)如下

 

*.background_dump_dest='/u01/app/admin/+ASM/bdump'

*.core_dump_dest='/u01/app/admin/+ASM/cdump'

*.user_dump_dest='/u01/app/admin/+ASM/udump'

*.asm_diskstring='ORCL:VOL*'

*.instance_type='asm'

*.large_pool_size=12M

*.remote_login_passwordfile='exclusive'

 

三、启动ORALCE_HOME下面的css

$ORACLE_HOME/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.

        asmdemo

CSS is active on all nodes.

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

 

四、启动asm

export ORACLE_SID=+ASM

sqlplus / as sysdba

SQL> startup 

ASM instance started

 

Total System Global Area  130023424 bytes

Fixed Size                  2019032 bytes

Variable Size             102838568 bytes

ASM Cache                  25165824 bytes

ORA-15110: no diskgroups mounted

 

五、创建磁盘组 DATA、RECOVERY

create diskgroup DATA external redundancy disk 'ORCL:VOL1','ORCL:VOL2';

create diskgroup RECOVERY external redundancy disk 'ORCL:VOL3';

六、创建spfile

create spfile from pfile;

Shutdown à startup

七、mount asm磁盘组

alter diskgroup DATA mount;

alter diskgroup RECOVERY mount;

 

SQL> select name,state from v$asm_diskgroup;

 

NAME                           STATE

------------------------------ -----------

DATA                           MOUNTED

RECOVERY                       MOUNTED

八、测试ASM。有可能需要 alter system register 在rdbms 中注册asm

Export ORACLE_SID=asmdemo

Sqlplus / as sysdba

Create tablespace test datafile ‘+DATA/test.dbf’ size 50m;

进入asm查看文件

Export ORACLE_SID=ASM

Asmcmd

Cd  data

Ls

有test.dbf文件就代表成功搭建。

drop tablespace test including contents and datafiles;

posted @ 2011-12-08 17:20  【小洲】  阅读(1488)  评论(0编辑  收藏  举报