This post will cover multiple options that can be used with “olsnodes” command. This is one of the most useful command that cab be used for Oracle Grid Infrastructure management & troubleshooting.
This command will be located under $GRID_HOME/bin and it can be executed with “root”, “GI user” and “DB User”.
- To list nodes participating in the cluster:
[root@flexnode2 bin]# pwd /u01/grid/12.1.0/bin [root@flexnode2 bin]# ./olsnodes flexnode1 flexnode2 flexnode3 flexnode4 flexnode5 [root@flexnode2 bin]#
- To list nodes aparticipating in the cluster with node number:
[root@flexnode2 bin]# ./olsnodes -n flexnode1 1 flexnode2 2 flexnode3 3 flexnode4 100 flexnode5 101 [root@flexnode2 bin]#
- To list nodes with assigned virtual IP’s:
[root@flexnode2 bin]# ./olsnodes -i flexnode1 192.168.2.21 flexnode2 192.168.2.25 flexnode3 192.168.2.26 flexnode4 <none> flexnode5 <none> [root@flexnode2 bin]#
- To list the node roles participating in the cluster:
[root@flexnode2 bin]# ./olsnodes -a flexnode1 Hub flexnode2 Hub flexnode3 Hub flexnode4 Leaf flexnode5 Leaf [root@flexnode2 bin]#
- To list node status:
[root@flexnode2 bin]# ./olsnodes -s flexnode1 Active flexnode2 Active flexnode3 Active flexnode4 Active flexnode5 Active [root@flexnode2 bin]#
- To list nodes whether its pinned/unpinned:
[root@flexnode2 bin]# ./olsnodes -t flexnode1 Unpinned flexnode2 Unpinned flexnode3 Unpinned flexnode4 Unpinned flexnode5 Unpinned [root@flexnode2 bin]#
- To list the private interconnect IP:
[root@flexnode2 bin]# ./olsnodes -l -p flexnode2 10.10.2.82 [root@flexnode2 bin]#
This will only list the private Interconnect IP on the node where command is executed.
Conclusion:
This command is not only useful for monitoring/managing the cluster, it is even very useful for troubleshooting the Grid Infrastructure operational issue. This command is even used by Cluster verification utility (CVU) to list node names when “-n” option is provide.