Windows XP环境配置ASM环境
转自:http://www.365testing.com/bbs/thread-15868-1-1.html
以前一直想在本机(Windows XP)环境配置ASM环境,可是总是在磁盘组配置时无法选择磁盘。由于ASM需要磁盘组或者多块磁盘,而我们一般的机器都只有一块硬盘,所以一直无法测试。今天老师讲了Windows环境下ASM磁盘虚拟工具ASMTOOL,现在决定测试一下:
1.创建虚拟磁盘:
asmtool 是ORACLE for 10g windows的一个自带工具,位于ORACLE_HOME\bin目录下。
C:\Documents and Settings\Kugooo>asmtool -create D:\oracle\product\10.2.0\+ASM\asmdisk1 500
C:\Documents and Settings\Kugooo>asmtool -create D:\oracle\product\10.2.0\+ASM\asmdisk2 500
C:\Documents and Settings\Kugooo>asmtool -create D:\oracle\product\10.2.0\+ASM\asmdisk3 500
C:\Documents and Settings\Kugooo>asmtool -create D:\oracle\product\10.2.0\+ASM\asmdisk4 500
2. 配置CSS(Cluster Synchronization Services)
CSS主要用来同步ASM instance和它的client,也即database instance。可以由Oracle自带的localconfig命令来完成。Localconfig命令也位于ORACLE_HOME\bin目录下。
D:\oracle\product\10.2.0\db_1\BIN>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 service
successfully added CSS to home
检查CSS daemon状态:
D:\oracle\product\10.2.0\db_1\BIN>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:\oracle\product\10.2.0\+ASM\*'
*.background_dump_dest='d:\oracle\product\10.2.0\admin\+ASM\bdump'
*.core_dump_dest='d:\oracle\product\10.2.0\admin\+ASM\cdump'
*.instance_type='ASM'
*.large_pool_size=12M
*.remote_login_passwordfile='SHARED'
*.user_dump_dest='d:\oracle\product\10.2.0\admin\+ASM\udump'
此处"_asm_allow_only_raw_disks"为隐含参数,设为FALSE是为了允许ASM使用非裸设备,为必设项!
4. 用oradim创建Oracle ASM实例
D:\oracle\product\10.2.0\db_1\BIN>oradim -new -asmsid +ASM -STARTMODE auto
实例已创建。
5.连接到ASM Instance
D:\oracle\product\10.2.0\db_1\BIN>set ORACLE_SID=+ASM
D:\oracle\product\10.2.0\db_1\BIN>sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 11月 27 21:27:46 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining 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
-------------------------------------------------- ---------------------------