环境:
OS:Red Hat Linux As5
DB:10.2.0.4
RAC:两个节点
一、磁盘组相关
1.手工启动ASM实例(节点1)
$export ORACLE_SID=+ASM1
$sqlplus /nolog
SQL>conncet / as sysdba -- 注意11GR2是connect / as sysasm
SQL>startup
2.ASM管理磁盘组相关命令
SQL>alter diskgroup DATA01 mount/dismount
SQL>alter diskgroup DATA01 online/offline disk
SQL>alter diskgroup DATA01 rebalance
SQL>alter diskgroup DATA01 check
3.删除磁盘组
SQL> select name from v$asm_diskgroup;
NAME
------------------------------
DG1
RECOVERYDEST
SQL>drop diskgroup including contents;
4.删除磁盘组的其中一块磁盘
alter diskgroup data drop disk DATA_0004 rebalance power 2;
5.创建磁盘组
create diskgroup DATATEST external redundancy disk '/dev/asm-data5','/dev/asm-data6' ATTRIBUTE 'compatible.asm'='11.2','au_size'='4M';
在节点1上操作后,会自动mount,但是在节点2上需要手工mount
alter diskgroup DATATEST mount;
----------------------------------------------------------------------------------------------------
二、oracleasm命令相关
1.以 root 用户身份在两个节点上配置 ASMLib。
# /etc/init.d/oracleasm configure
2.创建 ASM 磁盘。
以 root 用户身份在任何一个节点上创建 ASM 磁盘。
# /etc/init.d/oracleasm createdisk VOL1 /dev/sdc1
3.查看ASM磁盘
以root用户在任何一个节点上执行下面命令:
# /etc/init.d/oracleasm listdisks
4.搜索ASM磁盘
# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [ OK ]
5.ASM磁盘加状态
# /etc/init.d/oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yes
6.禁用和启用oracleasm
# /etc/init.d/oracleasm disable
# /etc/init.d/oracleasm enable
7.查看某个ASM磁盘包含那些磁盘
[oracle@hxl bdump]$ oracleasm querydisk -d vol1
Disk "VOL1" is a valid ASM disk on device /dev/sdb1[8,17]
阅读(6798) | 评论(0) | 转发(0) |