一. 手动注册应用到OCR 的概要
1.1 在做 ORACLE 的集群时,官方提供了很多的图形化进行配置(如:netca , vipca ...),这是一个非常方便和快捷的方式; 并且在大多数的情况下,我们都会去使用这些工具来进行 RAC 的部署和管理。 但是在一些特殊的情况下,使用这些工具无法满足我们的需求时,那我们又该怎么办呢?不用担心,oracle 为我想到了,在提供了GUI工具外,同时它还为我们提供手动创建application 方式 。 其实这些操作都是通过一系列的命令配合使用完成的。 其中主要包括crs_profile , crs_register , crs_setperm 等 。 crs_profile 是为crs_register 命令创建application 所需的脚本,crs_setperm 是为了设置使用application的权限 , crs_register 是将application 注册到 OCR 磁盘中。
二. crs_profile 命令介绍
2.1 现在我们从注册的最开始说起。如要将 application注册到 OCR 中,就必须要注册脚本,这个注册脚本我们可以通过手工编辑文本文件得到,也可以用 crs_profile创建得到。这里主要讲解 crs_profile 方式创建。
2.2 首先我们来说说crs_profile创建的这个脚本到时个什么样的东西。其实这个脚本内容是一系列的键值对组成 。 下面是官方对这些键一些介绍:
Attribute | Required | Default | Description |
---|---|---|---|
ACTION_SCRIPT |
Yes |
None |
The resource-specific script. for starting, stopping, and checking a resource. You may specify a full path for the action program file. Otherwise, the default paths are used: CRS_home/crs/script for privileged, and CRS_home/crs/public for public. You may also specify a relative path with this default path as the starting point. |
ACTIVE_PLACEMENT |
No |
0 |
When set to 1, Oracle Clusterware re-evaluates the placement of a resource during addition or restart of a cluster node. |
AUTO_START |
No |
restore |
Indicates whether Oracle Clusterware should automatically start a resource after a cluster restart. Valid AUTO_START values are: always—Causes the resource to restart when the node restarts regardless of the resource's state when the node stopped. restore—Does not start the resource at restart time if it was in an offline state, such as STATE=OFFLINE, TARGET=OFFLINE, when the node stopped. The resource is restored to its state when the node went down. The resource is started only if it was online before and not otherwise. never—Oracle Clusterware never restarts the resource regardless of the resource's state when the node stopped. Note: Oracle only supports lower-case values for always, restore, and never. |
CHECK_INTERVAL |
No |
60 |
The time interval, in seconds, between repeated executions of the check entry point of a resource's action program. There can be some overhead associated if you set the check interval to a low value and enable frequent checks. |
DESCRIPTION |
No |
Name of the resource |
A description of the resource. |
FAILOVER_DELAY |
No |
0 |
The amount of time, in seconds, that Oracle Clusterware waits before attempting to restart or fail over a resource. |
FAILURE_INTERVAL |
No |
0 |
The interval, in seconds, during which Oracle Clusterware applies the failure threshold. If the value is zero (0), then tracking of failures is disabled. |
FAILURE_THRESHOLD |
No |
0 |
The number of failures detected within a specified FAILURE_INTERVAL before Oracle Clusterware marks the resource as unavailable and no longer monitors it. If a resource's check script. fails this number of times, then the resource is stopped and set offline. If the value is zero (0), then tracking of failures is disabled. The maximum value is 20. |
HOSTING_MEMBERS |
Sometimes |
None |
An ordered list of cluster nodes separated by blank spaces that can host the resource. This attribute is required only if PLACEMENT equals favored or restricted. This attribute must be empty if PLACEMENT equals balanced. Enter node names as values for the HOSTING_MEMBERS attribute, not virtual host names or physical host names. Use the node names that you used when you installed Oracle Clusterware. The resources that you mention should contain the node name for the node on which they run. Run the olsnodes commands to see your node names. The HOSTING_MEMBERS Oracle Clusterware attribute is set automatically when these Oracle Clusterware resources are created; you do not need to take further action to ensure that the attribute is set. The node name is usually the same as the physical host name. However, it can be different. For example, when vendor clusterware is present, the Oracle Clusterware nodes are named the same as the vendor clusterware nodes. Not all vendor clusterware implementations use the physical node names as node names. Use the lsnodes command to display vendor clusterware node names. When there is no vendor clusterware, then the Oracle Clusterware node names must be the same as the physical hostname. Your Listener.ora file should contain one entry for the virtual internet protocol (VIP) address, using the VIP's name, and another entry for the physical host, by IP address not name. |
NAME |
Yes |
None |
The name of the application. The application name is a string that contains a combination of letters a-z or A-Z, and digits 0-9. The naming convention is to start with an alphanumeric prefix, such as ora, and complete the name with an identifier for to describe it. The name can contain any platform-supported characters except the exclamation point (!). However, the application name cannot begin with a period. |
OPTIONAL_RESOURCES |
No |
None |
An ordered list of resource names separated by blank spaces that this resource uses during placement decisions. Up to 58 user-defined resources can be listed. |
PLACEMENT |
No |
balanced |
The placement policy (balanced, favored, or restricted) specifies how Oracle Clusterware chooses the cluster node on which to start the resource. |
REQUIRED_RESOURCES |
No |
None |
An ordered list of resource names separated by blank spaces that this resource depends on. Each resource to be used as a required resource in this profile must be registered with Oracle Clusterware or the resource's profile registration will fail. |
RESTART_ATTEMPTS |
No |
1 |
The number of times that Oracle Clusterware attempts to restart a resource on a single cluster node before attempting to relocate the resource. A value of 1 means that Oracle Clusterware only attempts to restart the resource once on a node. A second failure causes an attempt to relocate the resource. |
RESTART_COUNT |
The counter maintained by the Oracle Clusterware daemon for the number of times that a resource had been restarted. It goes from zero to RESTART_ATTEMPTS. This is also written to OCR. |
||
SCRIPT_TIMEOUT |
No |
60 |
The maximum time, in second, that an action program may require to complete before an error is returned. This attribute specifies the time out value for the "check" action of the action script. If the check action does not return before this time, Oracle Clusterware will consider the action failed. |
START_TIMEOUT |
This attribute specifies the timeout value for the "start" action of the action script. If the start action does not return before this time, Oracle Clusterware will consider the action failed. |
||
STOP_TIMEOUT |
This attribute specifies the timeout value for the "stop" action of the action script. If the stop action does not return before this time, Oracle Clusterware will consider the action failed. |
||
TYPE |
Yes |
None |
Must be APPLICATION. |
UPTIME_THRESHOLD |
The value for UPTIME_THRESHOLD represents the length of time that a resource must be up before Oracle Clusterware considers the resource to be stable. By setting a value for the UPTIME_THESHOLD attribute, you can indicate a resource's stability. |
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25380220/viewspace-711549/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/25380220/viewspace-711549/