ASM是自动管理数据磁盘的工具
连接管理 数据库实例与存储交互的工具
ASM可以管理多个实例的存储(例如:RAC就是用一个ASM管理存储)
下面在windows换件下创建ASM实例和ASM磁盘组。
首选安装数据库软件,不安装实例,这个过程略过。
C:Documents and SettingsAdministrator>cd
C:oracleproduct10.2.0db_1BIN
查看asmtool用法:
C:oracleproduct10.2.0db_1BIN>asmtool.exe
ASM-00200: Invalid command option
ASM-00208: asmtool -add [-force] DeviceHarddisk1Partition1
ORCLDISKasm0 ...
ASM-00209: asmtool -addprefix asm [-force]
DeviceHarddisk1Partition1 ...
ASM-00210: asmtool -create \serversharefile
ASM-00211: asmtool -delete ORCLDISKasm0 [ORCLDISKasm1 ...]
ASM-00212: asmtool -list [ORCLDISKasm0 ORCLDISKasm1 ...]
创建5个asm文件:
C:oracleproduct10.2.0db_1BIN>asmtool.exe
-create C:oracleproduct10.2.0o
radataorclASMasmfile1 500m
C:oracleproduct10.2.0db_1BIN>asmtool.exe
-create C:oracleproduct10.2.0o
radataorclASMasmfile2 500m
C:oracleproduct10.2.0db_1BIN>asmtool.exe
-create C:oracleproduct10.2.0o
radataorclASMasmfile3 500m
C:oracleproduct10.2.0db_1BIN>asmtool.exe
-create C:oracleproduct10.2.0o
radataorclASMasmfile4 500m
C:oracleproduct10.2.0db_1BIN>asmtool.exe
-create C:oracleproduct10.2.0o
radataorclASMasmfile5 500m
查看列表
C:oracleproduct10.2.0db_1BIN>asmtool
-list
NTFS DeviceHarddisk0Partition1
15346M
配置同步工具css
C:oracleproduct10.2.0db_1BIN>localconfig
add
Step 1: creating new OCR repository
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'admin', privgrp ''..
Operation successful.
Step 2: creating new CSS service
successfully created local CSS service
successfully added CSS to home
检查cssd后台进程是否启动:
C:oracleproduct10.2.0db_1BIN>crsctl check
cssd
CSS appears healthy
创建asm实例:
oradim -new -asmsid +asm -startmode auto
设置 oracle_sid=+asm
用sqlplus 启动:
C:oracleproduct10.2.0db_1BIN>sqlplus / as
sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 11月 13 15:31:02
2013
Copyright (c) 1982, 2005, Oracle. All rights
reserved.
已连接到空闲例程。
SQL> startup nomount;
ASM 实例已启动
Total System Global Area 83886080 bytes
Fixed Size 1247420
bytes
Variable Size 57472836 bytes
ASM Cache 25165824
bytes
创建pfile文件并编辑如下:
*._asm_allow_only_raw_disks=FALSE
*.asm_diskgroups='DATA'
*.asm_diskstring='C:oracleproduct10.2.0oradataorclASM*'
*.asm_power_limit=1
*.background_dump_dest='C:oracleproduct10.2.0admin+ASMdump'
*.core_dump_dest='C:oracleproduct10.2.0admin+ASMcdump'
*.db_unique_name='+ASM'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='SHARED'
*.user_dump_dest='C:oracleproduct10.2.0admin+ASMudump'
创建spfile文件:
SQL> create spfile from pfile;
文件已创建。
这时候启动报错:
ORA-15032: not all alterations performed
ORA-15063: ASM discovered an insufficient number of disks for
diskgroup "DATA"
使用dbca工具将磁盘文件和磁盘组进行关联,这个时候就可以启动了。如图所示:
C:oracleproduct10.2.0db_1BIN>sqlplus / as
sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 11月 13
15:31:02 2013
Copyright (c) 1982, 2005, Oracle. All rights
reserved.
已连接到空闲例程。
SQL> startup nomount;
ASM 实例已启动
Total System Global Area 83886080
bytes
Fixed Size 1247420 bytes
Variable Size 57472836 bytes
ASM Cache 25165824 bytes
SQL> alter diskgroup data
mount;
磁盘组已变更。