VIP Commands

Use commands with the vip keyword to add, manage environment variables for, list the configuration of, enable, disable, start, stop, obtain the status of, and remove a VIP.

srvctl add vip

Adds a virtual IP address (VIP) to a node.

Syntax

srvctl add vip -node node_name -address {VIP_name|ip}/netmask/if1
  -netnum network_number [-skip] [-verbose]

Parameters

Table: srvctl add vip Command Parameters

ParameterDescription
-node node_nameThe name of the node on which you are adding the VIP.
-address { VIP_name | ip }/ netmask / if1

This specification creates a traditional VIP node application on the specified node.

You can specify one VIP_name or address, along with an IPv4 netmask or IPv6 prefix length.

-netnum network_numberThe network number from which VIPs are obtained. The default network number is 1.
-skipSpecify this parameter to skip checking the reachability of the VIP address.
-verboseVerbose output

Usage Notes

  • You cannot have multiple VIPs on the same net number (subnet or interface pair) on the same node.
  • This command is only available with Oracle Clusterware.

Example

An example of this command is:

# srvctl add network -netnum 2 -subnet 192.168.16.0/255.255.255.0
# srvctl add vip -node node7 -address 192.168.16.17/255.255.255.0 -netnum 2

The first command creates a network number, 2, and the second command adds a VIP to this network. You can specify the network number after the -netnum parameter in other SRVCTL commands.

srvctl config vip

Displays all VIPs on all networks in the cluster except for user VIPs.

Syntax

srvctl config vip {-node node_name | -vip vip_name} [-exportfile file_name]

Parameters

Table: srvctl config vip Command Parameters

ParameterDescription
-node node_nameSpecify the node name.
-vip vip_nameAlternatively, you can specify the VIP name.
-exportfile file_nameSpecify the output file to which the resource configuration will be exported in JSON format for backup or resource re-creation purposes.

Usage Notes

This command is only available with Oracle Clusterware.

Example

This command returns output similar to the following:

$ srvctl config vip -node crmnode1

VIP exists: ipv4, ipv6, network number 1, hosting node adc2100252

srvctl disable vip

Disables a specific VIP.

Syntax

srvctl disable vip -vip vip_name [-verbose]

Usage Notes

  • This command is only available with Oracle Clusterware.
  • Specify the name of the VIP you want to disable.
  • Optionally, you can use the -verbose parameter to display detailed output.

Example

The following command disables a VIP:

$ srvctl disable vip -vip vip1 -verbose

srvctl enable vip

Enables a specific VIP.

Syntax

srvctl enable vip -vip vip_name [-verbose]

Usage Notes

  • You can only use this command with Oracle Clusterware.
  • Specify the name of the VIP you want to enable.
  • Optionally, you can use the -verbose parameter to display detailed output.

Example

The following example enables a VIP named crm1-vip:

$ srvctl enable vip -vip crm1-vip -verbose

srvctl getenv vip

Obtains the values of environment variables for a specific VIP.

Syntax

srvctl getenv vip -vip vip_name [-envs "name_list"] [-verbose]

Parameters

Table: srvctl getenv vip Command Parameters

ParameterDescription
-vip vip_nameSpecify the name of the VIP for which you want to obtain the values of the environment variables.
-envs " name_list "Optionally, you can specify a comma-delimited list of the names of specific environment variables. If you do not use this parameter, then SRVCTL displays the values of all environment variables associated with the VIP.

Usage Notes

You can only use this command with Oracle Clusterware.

Example

The following example lists all environment variables for the specified VIP:

$ srvctl getenv vip -vip node1-vip

srvctl modify vip

Modify the VIP's IP address type or change the IP address only.

Syntax

srvctl modify vip -node node_name -address {VIP_name1|IP1}/netmask1[/if1[|if2...]]
[,{VIP_name2|IP2}/netmask2[/if1[|if2...]]] [-netnum network_number] [-skip] [-verbose]

Parameters

Table: srvctl modify vip Command Parameters

ParameterDescription
-node node_nameSpecify the name of the node on which you are changing the VIP.
-address {VIP_name|ip}/netmask[/ if1 [| if2 ...]]

Use this parameter to change the configuration of an existing VIP. If the VIP has an IPv4 address and the address you specify is IPv6, and the IP address type is set to both and the network type is set to static, then SRVCTL adds the IPv6 address to the existing IPv4 address of that resource.

You can specify one VIP_name or IP address, along with an IPv4 netmask or IPv6 prefix length.

-address { VIP_name1 |IP1}/ netmask1 [/ if1 [| if2 ...]],{ VIP_name2 |IP2}/ netmask2 [/ if1 [| if2 ...]]

Use this syntax to specify primary and secondary VIP address specifications for node applications. The syntax with both VIP address specifications is used to add a new VIP host name or VIP IP address to an existing VIP resource when the network has been modified to have two subnets.

The VIP_name1 (or IP1) and netmask1 must match the current VIP address specification. VIP_name2 (or IP2) and netmask2 are for the additional VIP address specification.

-netnum network_numberOptionally, specify the network number from which VIPs are obtained. If you do not use this parameter, then SRVCTL obtains the VIPs from the default network used for the nodeapps VIP.
-skipOptionally, you can skip the reachability check of VIP address.
-verboseOptionally, you can use this parameter to display detailed output.

Usage Notes

  • You can only use this command with Oracle Clusterware.
  • You cannot have multiple VIPs on the same net number (subnet or interface pair) on the same node.

Examples

  • The following example adds an IPv4 address to a VIP, if one does not already exist. If the VIP has an IPv4 address, then it is replaced with the new network specification.

    # srvctl modify vip -node node7 -address 192.168.16.17/255.255.255.0 -netnum 2
  • The following example updates the VIP configuration for node7 by specifying both the current and new VIP addresses, each associated with separate subnets and interfaces.

    # srvctl modify vip -node node7 -address myvip1/255.255.255.0/eth0,myvip2/255.255.254.0/eth1 -netnum 2

    Where:

    • myvip1/255.255.255.0/eth0 is the current VIP address, netmask, and interface.
    • myvip2/255.255.254.0/eth1 is the new VIP address, netmask, and interface.
    • The -netnum 2 parameter specifies the network number from which VIPs are obtained.

srvctl predict vip

Predicts the consequences of VIP failure.

Syntax

srvctl predict vip [-vip vip_name] [-verbose]

Usage Notes

  • Optionally, you can specify the name of a VIP for which you want to evaluate the consequences of failure.
  • Optionally, you can use the -verbose parameter to display detailed output.

srvctl relocate vip

Relocates a specific VIP from its current hosting node to another node within the cluster.

Syntax

srvctl relocate vip -vip vip_name [-node node_name] [-force] [-verbose]

Parameters

Table: srvctl relocate vip Command Parameters

ParameterDescription
-vip vip_nameSpecify the name of the VIP you want to relocate.
-node node_nameOptionally, you can specify the name of the target node where you want to relocate the VIP.
-forceOptionally, you can use this parameter to force the relocation of the VIP regardless of any dependencies.
-verboseOptionally, you can use this parameter to display detailed output.

Example

The following example relocates a VIP to a different node in the cluster:

$ srvctl relocate vip -vip vip1 -node node3

srvctl remove vip

Removes the specified VIPs.

Syntax

srvctl remove vip -vip "vip_name_list" [-force] [-noprompt] [-verbose]

Parameters

Table: srvctl remove vip Command Parameters

ParameterDescription
-vip " vip_name_list "Specify a comma-delimited list of VIP names that you want to remove surrounded by double quotation marks ( "" ).
-forceOptionally, you can use this parameter to remove a VIP regardless of any dependencies.
-nopromptOptionally, you can use this parameter to suppress prompts.
-verboseOptionally, you can use this parameter to display detailed output.

Usage Notes

You can only use this command with Oracle Clusterware.

Example

The following example removes several VIPs from the system:

# srvctl remove vip -vip "vip1,vip2,vip3" -force -noprompt -verbose

srvctl setenv vip

Administers cluster VIP environment configurations.

Syntax

srvctl setenv vip -vip vip_name {-envs "name=val[,...]" | -env "name=val"}
   [-verbose]

Parameters

Table: srvctl setenv vip Command Parameters

ParameterDescription
-vip vip_nameSpecify the name of the VIP for which you want to set environment variables.
-envs " name = val [,...]"Specify a comma-delimited list of name-value pairs of environment variables enclosed in double quotation marks ( "" ) that you want to set.
-env " name = val"Alternative to a list of environment variables, you can use this parameter to set a single environment variable to a value that contains commas or other special characters enclosed in double quotation marks ( "" ).
-verboseOptionally, you can use this parameter to display detailed output.

Usage Notes

You can only use this command with Oracle Clusterware.

Example

The following example sets the language environment configuration for a cluster VIP:

$ srvctl setenv vip -vip crm1-vip -env "LANG=en"

srvctl start vip

Starts a specific VIP or a VIP on a specific node.

Syntax

srvctl start vip {-node node_name | -vip vip_name} [-verbose]

Parameters

Table: srvctl start vip Command Parameters

ParameterDescription
-node node_nameSpecify the name of the node on which the VIP resides that you want to start.
-vip vip_nameAlternative to specifying a node, you can specify a VIP that you want to start.
-verboseOptionally, you can use this parameter to display detailed ouptut.

Usage Notes

You can only use this command with Oracle Clusterware.

Example

The following example starts a specific VIP:

$ srvctl start vip -vip crm1-vip -verbose

srvctl status vip

Displays status for a specific VIP or a VIP on a specific node.

Syntax

srvctl status vip {-node node_name | -vip vip_name} [-verbose]

Parameters

Table: srvctl status vip Command Parameters

ParameterDescription
-node node_nameSpecify the name of the node on which the VIP resides that you want to check the status.
-vip vip_nameAlternative to specifying a node, you can specify a VIP that you want to check the status.
-verboseOptionally, you can use this parameter to display detailed output.

Usage Notes

You can only use this command with Oracle Clusterware.

srvctl stop vip

Stops a specific VIP or all VIPs on a specific node, including any VIPs that were relocated due to a failover.

Syntax

srvctl stop vip {-node node_name | -vip vip_name} [-force] [-relocate] [-verbose]

Parameters

Table: srvctl stop vip Command Parameters

ParameterDescription
-node node_nameSpecify the name of a node on which a VIP resides that you want to stop. If you use this parameter, then SRVCTL stops all VIPs on the specific node, including failed-over VIPs.
-vip vip_nameAlternative to specifying a node, you can specify a VIP that you want to stop.
-forceOptionally, you can use this parameter to stop the VIP regardless of any dependencies.
-relocate

Optionally, you can use this parameter to relocate the VIP.

Note: You must use the -node node_name parameter with the -relocate parameter.

-verboseOptionally, you can use this parameter to display detailed output.

Usage Notes

You can only use this command with Oracle Clusterware.

Example

The following example stops all the VIPs on mynode1, including any failed-over VIPs:

$ srvctl stop vip -node mynode1 -verbose

srvctl unsetenv vip

Unsets the environment configuration for the specified cluster VIP.

Syntax

srvctl unsetenv vip -vip "vip_name_list" -envs "name_list" [-verbose]

Parameters

Table: srvctl unsetenv vip Command Parameters

ParameterDescription
-vip " vip_name_list "Specify a comma-delimited list of VIP names enclosed in double quotation marks ( "" ).
-envs " name_list "Specify a comma-delimited list of environment variable names enclosed in double quotation marks ( "" ) that you want to unset.
-verboseOptionally, you can use this parameter to display detailed output.

Example

The following example unsets the CLASSPATH environment variable for a cluster VIP:

$ srvctl unsetenv vip -vip "crm2-vip" -envs "CLASSPATH"