Monday, November 17, 2014

dcli shows nothing or shows error

I wanted to look list alerthistory from DB node across all cells in Exadata quarter rack:

[DB01]# dcli -l root -g cell_group cellcli -e list alerthistory

It works, but it gives too many rows on the screen, so i decided to cut out some old messages.

I connected to cell and picked the right syntax. As we know the each cellcli command has some fields and i decided to use beginTime as filter:

CellCLI> help list alerthistory

  Usage: LIST ALERTHISTORY [<name> | <filters>] [<attribute_list>] [DETAIL]

  Purpose: Displays specified attributes for alerts.

  Arguments:
    <name>:  The id of the alert to be displayed.
    <filters>:  an expression which determines which alerts should
                be displayed.
    <attribute_list>: The attributes that are to be displayed.
                      ATTRIBUTES {ALL | attr1 [, attr2]... }

  Options:
    [DETAIL]: Formats the display as an attribute on each line, with
              an attribute descriptor preceding each value.

 
[CELL01]# cellcli -e list alerthistory detail
     name:                   6_1
     alertDescription:       "A power supply component ..."
     alertMessage:           "A power supply component ..."
     alertSequenceID:        6
     alertShortName:         Hardware
     alertType:              Stateful
     beginTime:              2014-10-15T11:07:33+04:00
     endTime:                2014-10-15T12:59:11+04:00
     examinedBy:           
     metricObjectName:       /SYS/PS1_FAULT
     notificationState:      1
     sequenceBeginTime:      2014-10-15T11:07:33+04:00
     severity:               critical
     alertAction:            "For additional information ..."


CellCLI> list alerthistory where beginTime > 2014-10-11T11:22:52+04:00
                                                  ^
CELL-01504: Invalid command syntax.

And the final command for the cellcli was :

CellCLI> list alerthistory where beginTime > '2014-10-11T11:22:52+04:00'
 

     6_1     2014-10-15T11:07:33+04:00     critical     "A power supply ... "
     6_2     2014-10-15T12:59:11+04:00     clear        "A power supply ..."
     7_1     2014-10-17T03:39:38+04:00     info         "The HDD disk controller is ..."
     7_2     2014-10-17T03:39:41+04:00     clear        "All disk drives are in WriteBack ..."

CellCLI>


But from bash command line this command showed nothing! :

[CELL01]# cellcli -e list alerthistory where beginTime > '2014-10-11T11:22:52+04:00'
[CELL01]# cellcli

Becaus the ">" sign works as redirection to file and created the file on the cell  (many files - are my testing runs):

[CELL01]# ls -l
-rw-r--r-- 1 root root        0 Aug  1 10:16 00
-rw-r--r-- 1 root root       36 Nov 17 10:16 2014-09-15T03:39:41+04:00
-rw-r--r-- 1 root root       36 Nov 17 10:27 '2014-10-11T11:22:52+04:00'
-rw-r--r-- 1 root root       36 Nov 17 10:28 "2014-10-11T11:22:52+04:00"
-rw-r--r-- 1 root root       36 Nov 17 10:28 2014-10-11T11:22:52+04:00
-rw-r--r-- 1 root root       36 Nov 17 10:14 2014-10-15
-rw-r--r-- 1 root root       36 Nov 17 10:15 2014-10-15T03:39:38+04:00
-rw-r--r-- 1 root root       36 Nov 17 10:16 2014-10-15T03:39:41+04:00
-rw-r--r-- 1 root root       36 Nov 17 10:14 2014-11-01
-rw-r--r-- 1 root root       36 Nov 17 10:14 2014-11-13
-rw-r--r-- 1 root root       36 Nov 17 10:14 2014-11-14
-rw-r--r-- 1 root root       36 Nov 17 10:13 2014-11-15
-rw-r--r-- 1 root root     1480 Aug  1 10:14 CmdTool.log
-rw-r--r-- 1 root root 10485760 Apr 30  2014 $device
-rw-r--r-- 1 root root   576836 Aug  1 10:14 MegaSAS.log

Obviously, we need to use bash shields ' and ":

# cellcli -e list alerthistory where beginTime \> '2014-10-11T11:22:52+04:00'
CELL-01504: Invalid command syntax.

Let look to 





Chapter 9 :




And the final working command is

[DB01]# dcli -l root -g cell_group "cellcli -e list alerthistory where beginTime \> \'2014-10-16T11:00:00+04:00\'"

exa1cel01-priv1: 7_1     2014-10-17T03:39:38+04:00     info      "The HDD disk controller battery is performing a learn cycle. Battery Serial Number : 4286  Battery Type          : ibbu08  Battery Temperature   : 28 C  Full Charge Capacity  : 1329 mAh  Relative Charge       : 100 %  Ambient Temperature   : 21 C"
exa1cel01-priv1: 7_2     2014-10-17T03:39:41+04:00     clear     "All disk drives are in WriteBack caching mode.  Battery Serial Number : 4286  Battery Type          : ibbu08  Battery Temperature   : 28 C  Full Charge Capactiy  : 1329 mAh  Relative Charge       : 100 %  Ambient Temperature   : 21 C"
exa1cel02-priv1: 7_1     2014-10-17T03:46:30+04:00     info      "The HDD disk controller battery is performing a learn cycle. Battery Serial Number : 4218  Battery Type          : ibbu08  Battery Temperature   : 30 C  Full Charge Capacity  : 1321 mAh  Relative Charge       : 99 %  Ambient Temperature   : 21 C"
exa1cel02-priv1: 7_2     2014-10-17T03:46:33+04:00     clear     "All disk drives are in WriteBack caching mode.  Battery Serial Number : 4218  Battery Type          : ibbu08  Battery Temperature   : 30 C  Full Charge Capactiy  : 1321 mAh  Relative Charge       : 99 %  Ambient Temperature   : 21 C"
exa1cel03-priv1: 7_1     2014-10-17T04:00:47+04:00     info      "The HDD disk controller battery is performing a learn cycle. Battery Serial Number : 4546  Battery Type          : ibbu08  Battery Temperature   : 32 C  Full Charge Capacity  : 1347 mAh  Relative Charge       : 97 %  Ambient Temperature   : 22 C"
exa1cel03-priv1: 7_2     2014-10-17T04:00:50+04:00     clear     "All disk drives are in WriteBack caching mode.  Battery Serial Number : 4546  Battery Type          : ibbu08  Battery Temperature   : 32 C  Full Charge Capactiy  : 1347 mAh  Relative Charge       : 97 %  Ambient Temperature   : 22 C"


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

How to disable/setup autostart parameters for specified instance ?

Q: We have a 4-node RAC. I need to disable autostart of the DB on one node only.    How to do it and how to see autostart parameters, confir...