ITPub博客

首页 > 数据库 > Oracle > Windows下使用已格式化分区创建ASM单实例

Windows下使用已格式化分区创建ASM单实例

原创 Oracle 作者:libingquan008 时间:2015-09-08 19:22:03 0 删除 编辑

实验目的:学习在windows下手工创建ASM实例的步骤
实验环境:windows7-64bit; oracle 11gR2;

第零步:创建CSS服务-10g在DBHOME的bin目录下,11g已经没有了localconfig命令而是集成到OHASD服务中。所以如果是11g DB需要安装grid standalone,启动cssd服务

出处:

Till 11gR1 the CSS process was created using the $ORACLE_HOME/bin/localconfig script in Linux / UNIX or%ORACLE_HOME%\bin\localconfig.bat batch file in Windows.

From 11gR2, you won’t see localconfig file anymore in Oracle Home.Oracle 11gR2 introduced OHASD (Oracle High Availability Service Daemon) which gets created,at the end of the installation by running root.sh.This OHASD has ora.cssd service which is the CSS service used for synchronization between ASM instance and DB.

So, you need to download the Oracle Database 11g Release 2 Grid Infrastructure (11.2.0.1.0) for your environment.The Grid Infrastructure is not available for windows 32bit, and so i installed Oracle VM with Linux x86 and the installed Grid.




点击(此处)折叠或打开

  1. grid: crs_start ora.cssd

第一步:使用自带的asmtool在分区中创建4个100M的asm磁盘文件


点击(此处)折叠或打开

  1. C:\Users\Administrator>asmtool -create F:\virtualbox\ASM-shared\asm01 100
  2. C:\Users\Administrator>asmtool -create F:\virtualbox\ASM-shared\asm02 100
  3. C:\Users\Administrator>asmtool -create F:\virtualbox\ASM-shared\asm03 100
  4. C:\Users\Administrator>asmtool -create F:\virtualbox\ASM-shared\asm04 100


第二步:建立初始化参数

注意ASM实例参数文件默认访问的路径是:$ORACLE_HOME/database

点击(此处)折叠或打开

  1. vi E:\app\oracle\product\11.2.0\dbhome_1\database\init+asm.ora

  2. *._asm_allow_only_raw_disks=FALSE --此处隐参打开表示让ASM可以使用非裸设备的文件,不然无法在图形界面显示出磁盘
  3. *.instance_type='ASM'
  4. *.asm_diskstring='F:\virtualbox\ASM-shared\*'
  5. *.large_pool_size=48M
  6. *.db_unique_name='+asm'
  7. *.asm_power_limit=1
  8. *.remote_login_passwordfile='SHARED'
  9. *.background_dump_dest='E:\app\oracle\admin\asm\bdump'
  10. *.core_dump_dest='E:\app\oracle\admin\asm\cdump'
  11. *.user_dump_dest='E:\app\oracle\admin\asm\udump'

第三步:创建密码文件


点击(此处)折叠或打开


  1. E:\app\oracle\product\11.2.0\dbhome_1\dbs>orapwd file=orapw+asm password=oracle

第四步:创建ASM实例

创建ASM实例可以通过asmca(11g),dbca(10g) 或者oradim手工方式,这次我采用手工的方式创建实例:

点击(此处)折叠或打开

  1. oradim -new -asmsid +asm -startmode auto
  2. set ORACLE_SID=+asm
  3. sqlplus "/ as sysdba"
  4. startup;
  5. select instance_name from v$instance;
  6. select path,mount_status from v$asm_disk order by disk_number;
  7. select group_number,name,sector_size,block_size,allocation_unit_size,state,type,total_mb,free_mb from v$asm_diskgroup

第五步:创建ASM GROUP

点击(此处)折叠或打开

  1. SQL> select path,mount_status from v$asm_disk;
  2.  
  3. PATH MOUNT_S
  4. ------------------------------ -------
  5. F:\virtualbox\ASM-shared\asm01  CLOSED
  6. F:\virtualbox\ASM-shared\asm02 CLOSED
  7. F:\virtualbox\ASM-shared\asm03 CLOSED
  8. F:\virtualbox\ASM-shared\asm04 CLOSED
  9. --状态都是closed 说明还未被ASM磁盘组划分

SQL> create diskgroup data01
  2  external redundancy
  3  disk 'F:\virtualbox\ASM-shared\asm01','F:\virtualbox\ASM-shared\asm02';
 
Diskgroup created.
 
SQL> create diskgroup data02
  2  normal redundancy
  3  failgroup fg_data02_01 disk 'F:\virtualbox\ASM-shared\asm03'
  4  failgroup fg_data02_02 disk 'F:\virtualbox\ASM-shared\asm04';


SQL> select path,mount_status from v$asm_disk order by disk_number;
 
PATH                                       MOUNT_S
------------------------------            -------
F:\virtualbox\ASM-shared\asm01           CACHED
F:\virtualbox\ASM-shared\asm02           CACHED
F:\virtualbox\ASM-shared\asm03           CACHED
F:\virtualbox\ASM-shared\asm04           CACHED

SQLselect group_number,name,sector_size,block_size,allocation_unit_size,state,type,total_mb,free_mb from v$asm_diskgroup;

第六步:修改初始化参数


点击(此处)折叠或打开

  1. *.asm_diskgroups='DATA_01', 'DATA_02'
重启实例,创建spfile.步骤完成。  

注意:在实验过程中一定保证集群服务ora.cssd是启动状态,crsctl stat res -t观察。



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

请登录后发表评论 登录
全部评论

注册时间:2011-02-10

  • 博文量
    46
  • 访问量
    119551