crsctl add type

Use the crsctl add type command to create a resource type in Oracle Clusterware.

Syntax

crsctl add type type_name -basetype base_type_name {-attr
"ATTRIBUTE=attribute_name | -file file_path,TYPE={string | int}
 [,DEFAULT_VALUE=default_value][,FLAGS=typeFlags"} [-i]

Parameters

Table E-3 crsctl add type Command Parameters

Parameter Description
type_name

A name for the resource type in the form of xxx.yyy.type. Resource type names must be unique and cannot be changed after the resource type is registered.

-basetype base_type_name

The name of an existing base type. Any resource type that you create must either have local_resource or cluster_resource as its base resource type.

-attr

You can specify the resource type attributes using the -attr argument. Each type attribute definition can contain up to four type attribute keywords that must be displayed in the order shown. Enter a comma-delimited description of one or more resource type attributes enclosed in double quotation marks (""). The keywords for an attribute include:

  1. ATTRIBUTE: Specify a name for the attribute. The name is case-sensitive and cannot contain spaces.

  2. TYPE: Specify whether the attribute type is integer or string.

  3. DEFAULT_VALUE: (Optional) If the attribute is required, then a default value is not required. For attributes that are not required, you must specify a default value that Oracle Clusterware uses when you create resources based on this resource type.

  4. FLAGS: (Optional) Specify one or more of the following types, separated by a vertical bar (|):

    CONFIG: After you register a resource with this resource type, you can configure the attribute.

    READONLY: After you register a resource with this resource type, you cannot modify this attribute.

    REQUIRED: You must specify the name and value of this attribute when you create a resource that is based on this resource type. If you specify that this attribute is not required, then Oracle Clusterware uses the default value of this attribute that you specify.

    HOTMOD: If you change the value of an attribute for resources of this type, then the changes are applied immediately with the need to restart the resource.

You cannot use multiple -attr arguments to define multiple arguments for the resource type. Instead, you can specify multiple types within the double quotation marks after the -attr flag. For example:

"ATTRIBUTE=FOO,TYPE=integer,DEFAULT_
VALUE=0,FLAGS=REQUIRED|HOTMOD,ATTRIBUTE=BAR,TYPE=string"

The preceding example defines two type attributes, FOO and BAR. When you specify the ATTRIBUTE keyword, it ends the previous type attribute (if any) and begins a new type attribute.

-file file_path

Path name (either absolute or relative) for a text file containing line-delimited resource type keyword-value pairs that define the resource type. An example of the contents of the file is:

ATTRIBUTE=FOO
TYPE=integer
DEFAULT_VALUE=0
FLAGS=REQUIRED
ATTRIBUTE=BAR
TYPE=string

Note: The keywords must be in the following order: ATTRIBUTE, TYPE, DEFAULT_VALUE, and FLAGS. When you specify the ATTRIBUTE keyword, it ends the previous type attribute (if any) and begins a new type attribute.

The preceding example defines two type attributes, FOO and BAR.

Note: All operators must be surrounded by spaces.

See Also: "Filters" for more information about operators

-i

If you specify -i, then the command fails if Oracle Clusterware cannot process the request immediately.

See Also:

"Oracle Clusterware Resource Types" for more information about resource types

Usage Notes

  • Both the type_name and base_type_name parameters are required

  • You can either specify a file containing the type information or you can specify the type information on the command line

  • Do not use this command for any resource types with names that begin with ora because these resource types are Oracle resource types

  • You must have read permissions on the base type

Example

To create a resource type for demoActionScript:

# crsctl add type test_type1 -basetype cluster_resource 
 -attr "ATTRIBUTE=FOO,TYPE=integer,DEFAULT_VALUE=0"