1,创建asm逻辑卷
/etc/init.d/oracleasm createdisk VOL1 /dev/sdc1
/etc/init.d/oracleasm createdisk VOL2 /dev/sdd1
/etc/init.d/oracleasm createdisk VOL3 /dev/sde1
/etc/init.d/oracleasm createdisk VOL4 /dev/sdf1
2,编辑asm实例的参数文件
vim initasm+.ora
INSTANCE_TYPE=ASM
ASM_POWER_LIMIT=3
ASM_DISKSTRING='ORCL:VOL*'
ASM_DISKGROUP='DATA','RECOVERY'
3,启动ASM私利
export ORACLE_SID=+ASM
SQL>sqlplus /nolog
SQL>conn /as sysdba
SQL>startup pfile=initasm.ora
此处由于没有创建ASM磁盘组,会报没有磁盘组错误。
4,创建ASM磁盘组
SQL>create diskgroup DATA external redundancy disk 'ORCL:VOL1';
SQL>create diskgroup RECOVERY external redundancy disk 'ORCL:VOL2';
查看ls -lh /dev/oracleasm/disks 用户为oracle,用户组oinstall
否则用/etc/init.d/oracleasm configure配置用户名和用户组
SQL>select name,state,type from v$asm_diskgroup; //查看asm磁盘组是否mount;
否则用:
SQL>alter diskgroup DATA mount;
SQL>alter diskgroup RECOVERY mount;
5,关闭ASM实例
SQL>shutdown immediate;
6,启动ASM实例
SQL>startup pfile=initasm+.ora
7,创建SPFILE参数文件
SQL>host cp /home/oracle/initasm+.ora /oracle/product/database/dbs/init+ASM.ora
SQL>create spfile from pfile;
--------
启动ASM实例
export ORACLE_SID=+ASM
sqlplus /nolog
SQL>conn /as sysdba
SQL>startup
启动数据库实例
export ORACLE_SID=wxxrdb1
sqlplus /nolog
SQL>conn /as sysdba
SQL>startup
ASM命令行管理工具
启动ASM实例
export ORACLE_SID=+ASM
sqlplus /nolog
SQL>conn /as sysdba
SQL>startup
asmcmd
ASMCMD>pwd
切换命令cd
查看当前路径ls