This section contains information about subclassing a GDSv2 resource type.
When using a resource of type ORCL.gds or ORCL.gds_proxy, you cannot deploy new extension properties that might be required for your application. For example, if you require a user name to start or stop and probe your application, you will typically have to hard code that user name within your scripts. Instead, you could subclass the GDSv2 resource type and then create a new extension property within the subclassed resource type.
|
# cd /opt/ORCLscgds/etc # cp ORCL.gds your path/my.gds
Change the following entries to reflect your new resource type name:
RESOURCE_TYPE = “gds”; VENDOR_ID = my; #% SERVICE_NAME = “my.gds”;
Create a new extension property within the new Resource Type Registration file. For example, edit your path/my.gds and copy the Boot_command extension property and amend it the Username extension property.
{ PROPERTY = Username; EXTENSION; STRING; DEFAULT = ""; TUNABLE = AT_CREATION; DESCRIPTION = "Username for my application"; }
Other extension properties can be created and copied from an existing extension property to meet your requirements. For example, the Boot_command extension property was copied to create the Username extension property above. However, the TUNABLE attribute was amended to use AT_CREATION. See the property_attributes(5) man page for more information about resource property attributes.
# clresourcetype register -f your path/my.gds my.gds
# clresourcegroup create newrg # clresource create -g newrg -t my.gds \ -p Start_command=your start command \ -p Username=me -d newrs
# clresource show -p username newrs
You have now successfully subclassed the ORCL.gds resource type. Your new resource type [my.gds] will behave exactly as the ORCL.gds resource type, except that you have introduced a new extension property.
root@node1:~# user=$(/usr/cluster/bin/scha_resource_get -O extension -R newrs -G newrg username | tail -1) root@node1:~# echo $user me root@node1:~#
The steps to subclass the ORCL.gds_proxy resource type are similar to the steps for subclassing the ORCL.gds resource type.
# cd /opt/ORCLscgds/etc # cp ORCL.gds_proxy your path/my.gds_proxy
Change the following entries to reflect your new resource type name:
RESOURCE_TYPE = “gds_proxy”; VENDOR_ID = my; #% SERVICE_NAME = “my.gds_proxy”;
Create a new extension property within the new Resource Type Registration file. For example, edit your path/my.gds_proxy and copy the Boot_command extension property and amend it as the Username extension property.
{ PROPERTY = Username; EXTENSION; STRING; DEFAULT = ""; TUNABLE = AT_CREATION; DESCRIPTION = "Username for my application"; }
Other extension properties can be created and copied from an existing extension property to meet your requirements. For example, the Boot_command extension property was copied to create the Username extension property. However, the TUNABLE attribute was amended to use AT_CREATION. See the property_attributes(5) man page for more information about resource property attributes.
# clresourcetype register -f your path/my.gds_proxy my.gds_proxy
# clresourcegroup create -S newsrg # clresource create -g newsrg -t my.gds_proxy \ -p Prenet_start_command=your prenet_start command \ -p Username=me -d newsrs
# clresource show -p username newsrs
You have now successfully subclassed the ORCL.gds_proxy resource type. Your new resource type [my.gds_proxy] will behave exactly as the ORCL.gds_proxy resource type, except that you have introduced a new extension property.
root@node1:~# user=$(/usr/cluster/bin/scha_resource_get -O extension -R newsrs -G newsrg username | tail -1) root@node1:~# echo $user me root@node1:~#