asm管理方法

RAC:两个节点


一、ASM实例管理

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 <disk_group_name> including contents;

 

二、oracleasm命令管理

 

[root@rac1 bdump]# /etc/init.d/oracleasm
Usage: /etc/init.d/oracleasm {start|stop|restart|enable|disable|configure|createdisk|deletedisk

|querydisk|listdisks|scandisks|status}

 

配置 ASMLib
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]


你可能感兴趣的:(Export,online,手工,contents,including)