Search This Blog

Loading...

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"


Thursday, November 6, 2014

RMAN-06749: restore point LAST_POINT does not exist.

I need to flashback database to restore point called last_point.
But there was an error during the flashback.
Look :

RMAN> list restore point all;

using target database control file instead of recovery catalog
SCN              RSP Time  Type       Time      Name
---------------- --------- ---------- --------- ----
39133655                   GUARANTEED 30-OCT-14 last_point

RMAN> flashback database to restore point last_point;

Starting flashback at 06-NOV-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=225 instance=dwh1 device type=DISK

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of flashback command at 11/06/2014 13:03:42
RMAN-06749: restore point LAST_POINT does not exist.

RMAN> flashback database to restore point "last_point";

Starting flashback at 06-NOV-14
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:03
Finished flashback at 06-NOV-14

RMAN> alter database open resetlogs;


If you know, the name of restore point must be in caps lock letters.
But in my case the name of RP was in small case.
The solution - to use " " for name.