当前位置:数据库 > Oracle >>

oracle 11g asm基本操作

oracle 11g asm基本操作
 
相关视图:
v$asm_diskgroup
v$asm_disk
v$asm_operation

----添加,删除磁盘
ALTER DISKGROUP diskgroup_name 
{ ADD ... }
{ DROP ... }
[ REBALANCE [POWER integer] [WAIT | NOWAIT] ]
;
eg:(避免多次 rebalance 操作)
ALTER DISKGROUP FRA 
ADD DISK 'ORCL:SDE7' NAME 'FRA_DISK5' SIZE 977 M ,
'ORCL:SDE8' NAME 'FRA_DISK6' SIZE 977 M
DROP DISK FRA_DISK1, FRA_DISK2;

----添加,删除故障组
ALTER DISKGROUP FRA 
DROP DISKS IN FAILGROUP FAIL2
REBALANCE POWER 1;
ALTER DISKGROUP FRA 
ADD FAILGROUP FAIL2 
DISK 'ORCL:SDE11' SIZE 977 M ,'ORCL:SDE12' SIZE 977 M
DROP DISKS IN FAILGROUP FAIL1
REBALANCE POWER 11 WAIT;
ALTER DISKGROUP FRA
ADD FAILGROUP FAIL1
DISK 'ORCL:SDE9' SIZE 977 M ,'ORCL:SDE10' SIZE 977 M
REBALANCE POWER 0;

----取消磁盘删除操作:
ALTER DISKGROUP
{ diskgroup_name [, diskgroup_name ] ...
| ALL
}
UNDROP DISKS
;
eg:
ALTER DISKGROUP DATA UNDROP DISKS;
ALTER DISKGROUP DATA2, DATA3 UNDROP DISKS;
ALTER DISKGROUP ALL UNDROP DISKS;

 

 
 注意:This statement cannot be used to restore disks that are bei ng dropped as the result of a  DROP DISKGROUP statement, or for disks that are being dropped using the FORCEclause.
 
----挂载,卸载磁盘组
ALTER DISKGROUP
{ diskgroup_name [, diskgroup_name ] ...
| ALL
}
{ MOUNT [ RESTRICTED | NORMAL ] 
[ FORCE | NOFORCE ]
| DISMOUNT [ FORCE | NOFORCE ]
}
;
eg:
ALTER DISKGROUP DATA MOUNT;
ALTER DISKGROUP DATA2, DATA3 MOUNT;
ALTER DISKGROUP ALL DISMOUNT;

 

 
注意:If you try to dismount a disk group that contains  open files, the statement will fail, unless you also specify the  FORCEclause. If you  DISMOUNT FORCE, the files in the disk group become immediately inaccessible to your databases, and  any operations involving those files will fail. In extreme cases, your database instance will abort if a disk group that it uses is forcibly dismounted.
 
-----查看链接客户端
V$ASM_CLIENT
asmcmd>lsct


----删除磁盘组
DROP DISKGROUP diskgroup_name
[  FORCE INCLUDING CONTENTS
| { INCLUDING | EXCLUDING } CONTENTS
]
;
eg:
DROP DISKGROUP DATA;
DROP DISKGROUP DATA2 INCLUDING CONTENTS;
DROP DISKGROUP DATA3 FORCE INCLUDING CONTENTS;

 

注意:
If you cannot mount a disk group but need to drop it, you can use the  FORCE INCLUDING CONTENTS option. This enables you to remove the headers on disks that belong to a disk group that cannot be mounted by a ny ASM instances. When you use the FORCE INCLUDING CONTENTS option, the ASM instance does not atte mpt to verify that the disk group is being used by another ASM instance.
 
----检查磁盘组元数据的一致性
ALTER DISKGROUP diskgroup_name CHECK [ REPAIR | NOREPAIR ];
    --REPAIR option to resolve inconsistencies.

 

 
Oracle
MySQL
Access
SQLServer
DB2
Excel
SQLite
SYBASE
Postgres
如果你遇到数据库难题:
请访问www.zzzyk.com 试试
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,