on  it road.com

ASM 快速重新平衡

在 11g 中,我们可以在执行维护时使用 STARTUP RESTRICT 命令来控制对 ASM 实例的访问。
此启动选项用于实现 ASM 快速重新平衡功能。
当磁盘组处于 RESTRICTED 模式时发生的重新平衡操作消除了 Oracle RAC 环境中 ASM 实例之间的锁定和解锁范围映射消息传递。

当 ASM 实例使用“STARTUP RESTRICT”选项启动并在此模式下处于活动状态时,所有磁盘组都以 RESTRICTED 模式挂载,这会阻止数据库连接到 ASM 实例。
此外,ASM 实例禁用了 ALTER SYSTEM 语句的受限子句。

下面给出了一个显示 ASM 快速重新平衡功能的示例。
首先在受限模式下启动 ASM 实例:

SQL> startup restrict;
ASM instance started
Total System Global Area 92065792 bytes
Fixed Size 1297984 bytes
Variable Size 65601984 bytes
ASM Cache 25165824 bytes

现在,如果我们希望以正常模式挂载磁盘组,则会出现以下错误:

SQL> alter diskgroup dgext11gasm mount;
alter diskgroup dgext11gasm mount
*
ERROR at line 1:
ORA-15251: only restricted mount is allowed in the ASM instance

我们需要将受限子句与挂载方法一起使用。

SQL> alter diskgroup dgext11gasm mount restricted;
Diskgroup altered.
SQL> alter diskgroup dgext11gasm rebalance;
Diskgroup altered.

如果 ASM 磁盘组以受限模式挂载,数据库实例将无法访问驻留在 ASM 磁盘组中的文件。

SQL> startup
ORACLE instance started.
Total System Global Area 418484224 bytes
Fixed Size 1300200 bytes
Variable Size 268437784 bytes
Database Buffers 142606336 bytes
Redo Buffers 6139904 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '+DGEXT11GASM/o11g/datafile/test.256.627345731'

与普通的数据库实例不同,ASM 实例禁用了alter system disable 受限会话。

我们需要在 Normal 模式下关闭和启动 ASM Instance 才能访问驻留在 ASM Diskgroup for Database Instance 中的文件

ASM Instance 
============= 
SQL> alter system disable restricted session; 
alter system disable restricted session 
* 
ERROR at line 1: 
ORA-15000: command disallowed by current instance type 
SQL>shutdown immediate
SQL>startup

说明:这篇文章适用于 11gR1.
在 11gR2 上,集群件文件存储在 ASM 中,在这种情况下,如果需要,集群件和 ASM 磁盘组可以仅在一个节点上以独占模式启动。

Oracle 11g ASM 快速重新平衡

这篇文章讨论了 11g 新功能 ASM 快速重新平衡以及如何在 11g ASM 实例中实现。

日期:2020-09-17 00:11:27 来源:oir作者:oir