ASM实例的管理一

ASM的初始化参数

Name

Description

INSTANCE_TYPE

Must be set toASM

Note: This is the only required parameter. All other parameters take suitable defaults for most environments.

ASM_POWER_LIMIT

The default power for disk rebalancing.

Default: 1, Range: 0 – 11

See Also:"Tuning Rebalance Operations"

ASM_DISKSTRING

A comma-separated list of strings that limits the set of disks that ASM discovers. May include wildcard characters. Only disks that match one of the strings are discovered. String format depends on the ASM library in use and on the operating system. The standard system library for ASM supportsglob pattern matching.

For example, on a Solaris server that does not use ASMLib, to limit discovery to disks that are in the /dev/rdsk/ directory, ASM_DISKSTRING would be set to:

/dev/rdsk/*

Note that the asterisk cannot be omitted. To limit discovery to disks in this directory that have a name that ends in s3 ors4, ASM_DISKSTRING would be set to:

/dev/rdsk/*s3,/dev/rdsk/*s4

This could be simplified to:

/dev/rdsk/*s[34]

The ? character, when used as the first character of a path, expands to the Oracle home directory. Depending on operating system, when the ? character is used elsewhere in the path, it is a wildcard for a single character.

Default:NULL. ANULL value causes ASM to search a default path for all disks in the system to which the ASM instance has read/write access. The default search path is platform-specific. See theOracle Database Administrator's Reference for UNIX Systems on OTN for a list of default search paths for Unix platforms. For the Windows platform, the default search path is\\.\ORCLDISK*. See theOracle Database Installation Guide for Windows or the Real Application Clusters Quick Installation Guide for Oracle Database Standard Edition for Windows for more information.

See Also:"Improving Disk Discovery Time"

ASM_DISKGROUPS

A list of the names of disk groups to be mounted by an ASM instance at startup, or when theALTER DISKGROUP ALL MOUNT statement is used.

Default:NULL (If this parameter is not specified, then no disk groups are mounted.)

This parameter is dynamic, and if you are using a server parameter file (SPFILE), you should not need to manually alter this value. ASM automatically adds a disk group to this parameter when the disk group is successfully created or mounted, and automatically removes a disk group from this parameter when the disk group is dropped or dismounted. However, when using a text initialization parameter file (PFILE), you must edit the initialization parameter file to add the name of any disk group that you want automatically mounted at instance startup, and remove the name of any disk group that you no longer want automatically mounted.

Note: Issuing the ALTER DISKGROUP...ALL MOUNT orALTER DISKGROUP...ALL DISMOUNT command does not affect the value of this parameter.


 调优rebalance操作

如果在alter diskgroup命令中没有指定power选项,或是在添加或删除一个磁盘的时候自动的rebalance,平衡power默认是asm_power_limit的值。你可以动态的调整这个参数,限制越高,平衡操作完成的就越快,低的值导致平衡花费的时间很长,但是消耗的资源少。默认的值1最小化的减少了对别的应用的影响。

如果是因为手工或自动的删除了磁盘导致的平衡操作,增加这个power来减少拷贝冗余备份到别的磁盘的窗口时间。

v$asm_operation视图可以用来对调整asm_power_limit参数提供参考,该视图的est_minutes列也提供了重新平衡操作完成的时间的评估,可以观看调整power参数对于评估时间的影响。

提高磁盘发现时间

asm_diskstring初始化参数是一个操作系统依赖的值,被asm用来限制发现可用磁盘的路径。当一个新磁盘被添加到一个磁盘组,每个asm实例会使用asm_diskstring去查看新磁盘。

在很多情况下,默认的null是足够的,使用更加有限制的值,能减少asm发现的时间,也就提高了磁盘组挂载效率。在添加磁盘之前也许需要动态的修改asm_diskstring这个参数来使新的磁盘被发现。

启动asm实例

启动asm实例与启动oracle实例很相似,只是有很少的不同

1为了连接到asm实例,你必须指定oracle_sid环境变量到asm sid(默认的但实例数据库的asm sid是+asm,默认的rac的asm sid是+ASMnode#).

2初始化参数文件中,必须包含

instance_type=asm

3start命令,试着mout asm_diskgroups指定的磁盘组,如果asm_diskgroup是空的,那么asm实例启动,并发出一个警告没有磁盘组被挂载,后面你可以使用alter diskgroup ..mount命令来挂载。

startup命令的解释

STARTUP ParameterDescription
FORCEIssues a SHUTDOWN ABORT to the ASM instance before restarting it
MOUNT, OPENMounts the disk groups specified in the ASM_DISKGROUPS initialization parameter. This is the default if no command parameter is specified.
NOMOUNTStarts up the ASM instance without mounting any disk groups


CSS要求

cluster synchronization service后台进程是同步asm和数据库实例的,css后台进程在你使用dbca创建数据库的时候就启动了,如果没有使用dbca来创建数据库,你一定要确保css进程在启动asm实例前运行。

为了确保css在运行,执行crsctl check cssd,如果收到了css appears healthy,那么css就是在运行:为了启动css进程,并配置重启自动自动,执行下面的命令

1root用户登录系统

2确保$oracle_home/bin在你的PATH目录中

3执行下面的命令

localconfig add

发现磁盘

当一个磁盘被成功的发现,它就出现在v$asm_disk视图中,属于磁盘组的磁盘,在磁盘的磁盘头有一个磁盘组的名字,有个member的状态,对于发现了磁盘,但是还没有被分配到磁盘组的磁盘有一个candidate或provisioned状态。

下面是个例子

SQL> select name, header_status, path from v$asm_disk;

NAME         HEADER_STATUS PATH
------------ ------------- -------------------------
             CANDIDATE     /dev/rdsk/disk07
DISK06       MEMBER        /dev/rdsk/disk06
DISK05       MEMBER        /dev/rdsk/disk05
DISK04       MEMBER        /dev/rdsk/disk04
DISK03       MEMBER        /dev/rdsk/disk03
DISK02       MEMBER        /dev/rdsk/disk02
DISK01       MEMBER        /dev/rdsk/disk01

磁盘发现的规则如下

1asm发现不超过10000个磁盘,如果有超过10000个磁盘匹配asm_diskstring初始化参数,只有第一个10000被发现。

2asm不会发现包含操作系统分区表的磁盘,即使该磁盘在asm_diskstring路径及asm有对该磁盘的读写权限。

3如果asm看到一个磁盘头上标识,标识该磁盘是一个oracle对象,像是数据文件头之类的,那么这个磁盘会被发现,但是只能使用force关键字来添加奥一个磁盘组中,这样的磁盘在v$asm_disk中有个foreign状态。

asm在发现的过程中对下面的会有错误提示:

1多路径指向相同的磁盘

2多个asm磁盘有相同的磁盘头

关闭asm实例

SHUTDOWN ModeAction Taken By Automatic Storage Management
NORMAL, IMMEDIATE, or TRANSACTIONALASM waits for any in-progress SQL to complete before doing an orderly dismount of all disk groups and shutting down the ASM instance. If any database instances are connected to the ASM instance, the SHUTDOWN command returns an error and leaves the ASM instance running.
ABORTThe ASM instance immediately shuts down without the orderly dismount of disk groups. This causes recovery upon the next startup of ASM. If any database instance is connected to the ASM instance, the database instance aborts.


It is strongly recommended that you shut down all database instances that use the ASM instance before shutting down the ASM instance.

 管理磁盘组

磁盘组中添加或删除磁盘的影响

将添加和删除磁盘同时操作的话,效率很高,避免了不必要的数据移动。对于删除操作来说,当平衡操作完成了asm将磁盘暂时的offline,然后删除它,设置磁盘头状态到former。

asm处理磁盘失败:

1在失败组中如果高于1个磁盘坏掉了,那么这个失败组就坏掉了

2normal冗余的磁盘组可以承受1个失败组坏掉。

3high冗余的磁盘组可以承受2个失败组坏掉

4external冗余的磁盘组不能承受磁盘组中任何磁盘的失败。

失败组和镜像

镜像元数据和用户数据是通过失败组来获得的。如果没有足够的失败组被提供那么系统的可靠性会降低。所以在高可靠的系统中,失败组的配置很重要,下面是失败组的一些规则和指导:

1每个磁盘只属于一个磁盘组

2磁盘在分配给失败组后,要是需要分配给别的失败组,那么需要删除在添加

3失败组的大小最好保持一样

4对于normal冗余的磁盘组,asm要求至少2个失败组,对于high冗余的磁盘组,至少3个失败组。

5大多数系统不必明确定义失败组,默认的,放置每个磁盘在它自己的磁盘组中对大多数的安装都是满足的。失败组只是对于大型,负载的系统才需要的。

6对于小的磁盘数量(小于20),通常使用默认的失败组就很好。 This is true even for large numbers of disks when the main concern is spindle failure. If there is a need to protect against the simultaneous loss of multiple disk drives due to a single component failure, you can specify failure groups。例如,一个磁盘组有几个小的模块化磁盘阵列组成,要是系统要求当一整个模块化阵列失败的时候能继续提供服务,一个失败组应该包含一个模块中所有的磁盘,如果一个模块失败了,在失败模块中存放的冗余数据用来恢复现存的模块。

7有小部分的大失败组可能在一些情况下减少可用性。

管理磁盘组的容量

在每个磁盘组中必须有足够的容量来处理失败,当一个或多个磁盘失败了,恢复冗余的进程需要在现存的磁盘中获取空间,如果没有足够的空间可用,一些文件可能就会以减少冗余结束。

减少冗余意味着,文件中一个或更多的区不会再期望的级别镜像。例如,在high冗余级别的磁盘组中,文件上的减少冗余有2个或更少的拷贝,而不是3个拷贝了。v$asm_file中的REDUNDANCY_LOWERED提示了减少冗余的文件

v$asm_diskgroup视图可以用来帮助管理空间


REQUIRED_MIRROR_FREE_MB indicates the amount of space that must be available in the disk group to restore full redundancy after the worst failure that can be tolerated by the disk group.

USABLE_FILE_MB indicates the amount of free space, adjusted for mirroring, that is available for new files.

USABLE_FILE_MB is computed by subtracting REQUIRED_MIRROR_FREE_MB from total free space in the disk group and then adjusting for mirroring. For example, in a normal redundancy disk group, where by default mirrored files take up disk space equal to twice their size, if 4 GB of actual usable file space remains, USABLE_FILE_MB equals roughly 2 GB. You can then add up to a 2 GB file.

The following query shows capacity metrics for a normal redundancy disk group that consists of six 1 GB (1024 MB) disks, each in its own failure group:

select name, type, total_mb, free_mb, required_mirror_free_mb, 
usable_file_mb from v$asm_diskgroup;

NAME         TYPE     TOTAL_MB    FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB
------------ ------ ---------- ---------- ----------------------- --------------
DISKGROUP1   NORMAL       6144       3768                    1024           1372

The REQUIRED_MIRROR_FREE_MB column shows that 1 GB of extra capacity must be available to restore full redundancy after one or more disks fail. Note that the first three numeric columns in the query results are raw numbers. That is, they do not take redundancy into account. Only the last column is adjusted for normal redundancy. Notice that:

FREE_MB - REQUIRED_MIRROR_FREE_MB = 2 * USABLE_FILE_MB

or

3768 - 1024 = 2 * 1372 = 2744

如果usable_file_MB变成了负数,那么建议你添加更多的磁盘空间

asm的一些限制

ASM imposes the following limits:

  • 63 disk groups in a storage system

  • 10,000 ASM disks in a storage system

  • 4 petabyte maximum storage for each ASM disk

  • 40 exabyte maximum storage for each storage system

  • 1 million files for each disk group

  • Maximum files sizes as shown in the following table:

    Disk Group TypeMaximum File Size
    External redundancy35 TB
    Normal redundancy5.8 TB
    High redundancy3.9 TB









  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值