Use the crsctl add resource command to register a resource to be managed by Oracle Clusterware. A resource can be an application process, a database, a service, a listener, and so on.
crsctl add resource resource_name -type resource_type [-file file_path | -attr "attribute_name=attribute_value,attribute_name=attribute_value,..."] [-i] [-f]
Table E-2 crsctl add resource Command Parameters
| Parameter | Description |
|---|---|
resource_name |
A short, descriptive name for the resource. |
-type resource_type |
The type of resource that you are adding preceded by the |
-file file_path |
Path name (either absolute or relative) for a text file containing line-delimited attribute name-value pairs that define the resource. |
-attr "attribute_name= attribute_value |
You can specify attributes for a resource you are adding in two different ways:
|
-i |
If you specify |
-f |
Use the force parameter:
|
See Also:
Oracle Clusterware Resource Reference for more information about resources and resource attributes
Both the resource_name and -type resource_type parameters are required. You can create an associated resource type using the crsctl add type command.
Any user can create a resource but only clusterware administrators can create resources of type local_resource or resources of type cluster_resource that have SERVER_POOLS=*.
Once a resource is defined, its ACL controls who can perform particular operations with it. The Oracle Clusterware administrator list is no longer relevant.
On Windows, a member of the Administrators group has full control over everything.
See Also:
"crsctl setperm resource" for more information about setting ACLs
If an attribute value for an attribute name-value pair contains commas, then the value must be enclosed in single quotation marks ('').
Following is an example of an attribute file:
PLACEMENT=favored HOSTING_MEMBERS=node1 node2 node3 RESTART_ATTEMPTS@CARDINALITYID(1)=0 RESTART_ATTEMPTS@CARDINALITYID(2)=0 FAILURE_THRESHOLD@CARDINALITYID(1)=2 FAILURE_THRESHOLD@CARDINALITYID(2)=4 FAILURE_INTERVAL@CARDINALITYID(1)=300 FAILURE_INTERVAL@CARDINALITYID(2)=500 CHECK_INTERVAL=2 CARDINALITY=2
Do not use this command for any resources with names that begin with ora because these resources are Oracle resources.
Example 1
To register a VIP as a resource with Oracle Clusterware:
$ crsctl add resource app.appvip -type app.appvip.type -attr "RESTART_ATTEMPTS=2, START_TIMEOUT=100,STOP_TIMEOUT=100,CHECK_INTERVAL=10, USR_ORA_VIP=172.16.0.0, START_DEPENDENCIES=hard(ora.net1.network)pullup(ora.net1.network), STOP_DEPENDENCIES=hard(ora.net1.network)"
Example 2
To register a resource based on the test_type1 resource type:
$ crsctl add resource r1 -type test_type1 -attr "PATH_NAME=/tmp/r1.txt" $ crsctl add resource r1 -type test_type1 -attr "PATH_NAME=/tmp/r2.txt"
Example 3
To register a Samba server resource of the generic_application resource type, using the EXECUTABLE_NAMES attribute:
# crsctl add resource my_samba -type generic_application -attr "EXECUTABLE_NAMES=smbd,START_PROGRAM='/etc/rc.d/init.d/smb start', STOP_PROGRAM='/etc/rc.d/init.d/smb stop'"
Example 4
To register a DNS server of the generic_application resource type, using the EXECUTABLE_NAMES attribute:
# crsctl add resource my_dns -type generic_application -attr "EXECUTABLE_NAMES=named,START_PROGRAM='/etc/rc.d/init.d/named start', STOP_PROGRAM='/etc/rc.d/init.d/named stop'"
Example 5
To register an Apache web server of the generic_application resource type using the PID_FILES attribute:
# crsctl add resource my_apache -type generic_application -attr "START_PROGRAM='/usr/sbin/httpd -k start',STOP_PROGRAM='/usr/sbin/httpd -k stop', PID_FILES=/etc/httpd/run/httpd.pid"
Example 6
To register an application of generic_application resource type using environment variables:
# crsctl add resource my_app -type generic_application -attr "START_PROGRAM='/opt/my_app start', EXECUTABLE_NAMES=my_app, ENVIRONMENT_VARS='USE_NETAPP=no,USE_BACKUP=yes,CLEAN_ON_KILL=yes'"