ITPub博客

首页 > 数据库 > Oracle > ASM配置——Windows XP平台

ASM配置——Windows XP平台

Oracle 作者:wangzhichao666 时间:2011-06-13 16:39:54 0 删除 编辑

1.创建虚拟磁盘
asmtool 是ORACLEfor10gwindows的一个自带工具,位于ORACLE_HOMEin目录下。
C:Documents and SettingsKugooo>asmtool -create D:oracleproduct10.2.0+ASMasmdisk1 500
C:Documents and SettingsKugooo>asmtool -create D:oracleproduct10.2.0+ASMasmdisk2 500
C:Documents and SettingsKugooo>asmtool -create D:oracleproduct10.2.0+ASMasmdisk3 500
C:Documents and SettingsKugooo>asmtool -create D:oracleproduct10.2.0+ASMasmdisk4 500

2. 配置CSS(Cluster Synchronization Services)
CSS主要用来同步ASM instance和它的client,也即database instance。
可以由Oracle自带的localconfig命令来完成。Localconfig命令也位于ORACLE_HOMEin目录下。
D:oracleproduct10.2.0db_1BIN>localconfig add

Step 1:  creating new OCR repository
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'kugooo', privgrp'
Operation successful.

Step 2:  creating new CSS service
successfully created local CSS
successfully added CSS to home

检查CSS daemon状态:
D:oracleproduct10.2.0db_1BIN>crsctl check cssd
CSS appears healthy
“CSS appears healthy”表明该进程正在运行

3. 创建ASM Instance的initial文件
ASM Instance有自己的初始参数文件,可以为spfile或者文本文件。通过在文件名中嵌入SID,来区分ASM Instance和Database Instance。
*._asm_allow_only_raw_disks=FALSE
*.asm_diskstring='D:oracleproduct10.2.0+ASM*'
*.background_dump_dest='d:oracleproduct10.2.0admin+ASMdump'
*.core_dump_dest='d:oracleproduct10.2.0admin+ASMcdump'
*.instance_type='ASM'
*.large_pool_size=12M
*.remote_login_passwordfile='SHARED'
*.user_dump_dest='d:oracleproduct10.2.0admin+ASMudump'
此处"_asm_allow_only_raw_disks"为隐含参数,设为FALSE是为了允许ASM使用非裸设备,为必设项!

4. 用oradim创建Oracle ASM实例
D:oracleproduct10.2.0db_1BIN>oradim -new -asmsid +ASM -STARTMODE auto
实例已创建。


5.连接到ASM Instance
D:oracleproduct10.2.0db_1BIN>set ORACLE_SID=+ASM
D:oracleproduct10.2.0db_1BIN>sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 11月 27 21:27:462008
Copyright (c) 1982,2005, Oracle.  All rights reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP andDataMining options
SQL> set linesize 1000
SQL> show parameter instance_type
NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
instance_type                        string                 ASM
SQL> select status from v$instance;
STATUS
-----------
STARTED


6. 创建磁盘组
SQL> col path for a50
SQL> col mount_status for a30
SQL> select path,mount_status from v$asm_disk;
PATH                                               MOUNT_STATUS
-------------------------------------------------- ------------------------------
D:ORACLEPRODUCT10.2.0+ASMASMDISK1             CLOSED
D:ORACLEPRODUCT10.2.0+ASMASMDISK4             CLOSED
D:ORACLEPRODUCT10.2.0+ASMASMDISK3             CLOSED
D:ORACLEPRODUCT10.2.0+ASMASMDISK2             CLOSED

 

MOUNT_STATUS为"CLOSED",因为磁盘组还没创建。下面创建磁盘组:


SQL> create diskgroup dggroup1 normal redundancy disk
  'D:ORACLEPRODUCT10.2.0+ASMasmdisk1',
  'D:ORACLEPRODUCT10.2.0+ASMasmdisk2',
  'D:ORACLEPRODUCT10.2.0+ASMasmdisk3',
  'D:ORACLEPRODUCT10.2.0+ASMasmdisk4';

磁盘组已创建。


SQL> select path,mount_status from v$asm_disk;
PATH                                               MOUNT_STATUS
-------------------------------------------------- ------------------------------
D:ORACLEPRODUCT10.2.0+ASMASMDISK1             CACHED
D:ORACLEPRODUCT10.2.0+ASMASMDISK2             CACHED
D:ORACLEPRODUCT10.2.0+ASMASMDISK3             CACHED
D:ORACLEPRODUCT10.2.0+ASMASMDISK4             CACHED


再检查磁盘状态,MOUNT_STATUS变成"CACHED",表示磁盘已经成为磁盘组的一部分,并且正在被ASM Instance访问。

关闭ASM Instance,在init+ASM.ora中加入参数 ASM_DISKGROUPS='dggroup1',并创建spfile。
SQL> shutdown immediate
ASM 磁盘组已卸装
ASM 实例已关闭
SQL> create spfile from pfile='D:oracleproduct10.2.0db_1databaseINIT+asm.ORA';
文件已创建。
SQL> startup
ASM 实例已启动
Total System Global Area   83886080 bytes
Fixed Size                  1247420 bytes
Variable Size              57472836 bytes
ASM Cache                  25165824 bytes
ASM 磁盘组已装载
SQL> show parameter spfile
NAME              TYPE                   VALUE
---------------- ---------------------- ------------------------------
spfile              string                 D:ORACLEPRODUCT10.2.0DB_1DATABASESPFILE+ASM.ORA


这样我们就建成了ASM Instance和Disk Group,并将ASM的initial文件转成spfile。

 

 

<!-- 正文结束 -->

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

上一篇: 没有了~
下一篇: 没有了~
请登录后发表评论 登录
全部评论