Thursday, December 13, 2018

How to discover newly added disks in an Oracle Linux server without restarting the server and add the disk to ASM


--a 500GB disk has beed assigned to this server from Vmware admin console but the newly added disk is not listed with "fdisk -l" command

[root@oda11 ~]# fdisk -l

Disk /dev/sdc: 322.1 GB, 322122547200 bytes
255 heads, 63 sectors/track, 39162 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x42ef9c9a

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1       39162   314568733+  83  Linux

Disk /dev/sdd: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x27e8e393

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1      133674  1073736373+  83  Linux

Disk /dev/sdb: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xca10e640

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       13054   104856223+  83  Linux

Disk /dev/sde: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd4ef0f41

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1      133674  1073736373+  83  Linux

Disk /dev/sdf: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x32693c1a

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1               1      133674  1073736373+  83  Linux

Disk /dev/sdg: 322.1 GB, 322122547200 bytes
255 heads, 63 sectors/track, 39162 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x86a86953

   Device Boot      Start         End      Blocks   Id  System
/dev/sdg1               1       39162   314568733+  83  Linux

Disk /dev/sda: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00043928

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64       13055   104344576   8e  Linux LVM

Disk /dev/mapper/vg_oda11-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_oda11-lv_swap: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_oda11-lv_home: 42.4 GB, 42421190656 bytes
255 heads, 63 sectors/track, 5157 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

------

--You can get help from the following Oracle Support note

How to Dynamically Add and Remove SCSI Devices on Linux (Doc ID 603868.1)

----

--This is how you can discover the new disk without restarting the server

[root@oda11 host0]# grep mpt /sys/class/scsi_host/host?/proc_name
/sys/class/scsi_host/host2/proc_name:mptspi
[root@oda11 host0]# echo "- - -" > /sys/class/scsi_host/host2/scan

[root@oda11 host0]# fdisk -l

Disk /dev/sdc: 322.1 GB, 322122547200 bytes
255 heads, 63 sectors/track, 39162 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x42ef9c9a

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1       39162   314568733+  83  Linux

Disk /dev/sdd: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x27e8e393

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1      133674  1073736373+  83  Linux

Disk /dev/sdb: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xca10e640

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       13054   104856223+  83  Linux

Disk /dev/sde: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd4ef0f41

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1      133674  1073736373+  83  Linux

Disk /dev/sdf: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x32693c1a

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1               1      133674  1073736373+  83  Linux

Disk /dev/sdg: 322.1 GB, 322122547200 bytes
255 heads, 63 sectors/track, 39162 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x86a86953

   Device Boot      Start         End      Blocks   Id  System
/dev/sdg1               1       39162   314568733+  83  Linux

Disk /dev/sda: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00043928

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64       13055   104344576   8e  Linux LVM

Disk /dev/mapper/vg_oda11-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_oda11-lv_swap: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_oda11-lv_home: 42.4 GB, 42421190656 bytes
255 heads, 63 sectors/track, 5157 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sdh: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

[root@oda11 host0]#

--Now we can see the new disk as /dev/sdh

-----------

--You can see the log from "/var/log/messages" file

[root@oda11 host0]# tail -100f /var/log/messages
...
Jul 27 15:39:13 oda11 kernel: scsi 2:0:8:0: Direct-Access     VMware   Virtual disk     1.0  PQ: 0 ANSI: 2
Jul 27 15:39:13 oda11 kernel: scsi 2:0:8:0: mptscsih: ioc0: qdepth=32, tagged=1, simple=1, ordered=0, scsi_level=3, cmd_que=1
Jul 27 15:39:13 oda11 kernel: sdev dma_alignment 511
Jul 27 15:39:13 oda11 kernel: scsi target2:0:8: Beginning Domain Validation
Jul 27 15:39:13 oda11 kernel: scsi target2:0:8: Domain Validation skipping write tests
Jul 27 15:39:13 oda11 kernel: scsi target2:0:8: Ending Domain Validation
Jul 27 15:39:13 oda11 kernel: scsi target2:0:8: FAST-40 WIDE SCSI 80.0 MB/s ST (25 ns, offset 127)
Jul 27 15:39:13 oda11 kernel: sd 2:0:8:0: [sdh] 1048576000 512-byte logical blocks: (536 GB/500 GiB)
Jul 27 15:39:13 oda11 kernel: sd 2:0:8:0: Attached scsi generic sg8 type 0
Jul 27 15:39:13 oda11 kernel: sd 2:0:8:0: [sdh] Write Protect is off
Jul 27 15:39:13 oda11 kernel: sd 2:0:8:0: [sdh] Cache data unavailable
Jul 27 15:39:13 oda11 kernel: sd 2:0:8:0: [sdh] Assuming drive cache: write through
Jul 27 15:39:13 oda11 kernel: sd 2:0:8:0: [sdh] Cache data unavailable
Jul 27 15:39:13 oda11 kernel: sd 2:0:8:0: [sdh] Assuming drive cache: write through
Jul 27 15:39:13 oda11 kernel: sdh: unknown partition table
Jul 27 15:39:13 oda11 kernel: sd 2:0:8:0: [sdh] Cache data unavailable
Jul 27 15:39:13 oda11 kernel: sd 2:0:8:0: [sdh] Assuming drive cache: write through
Jul 27 15:39:13 oda11 kernel: sd 2:0:8:0: [sdh] Attached SCSI disk
Jul 27 15:39:24 oda11 kernel: end_request: I/O error, dev fd0, sector 0

----------------

--Now we can format this new disk and add it to the ASM

[root@oda11 host0]# cd
[root@oda11 ~]# fdisk /dev/sdh
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x3223fa3b.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-65270, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-65270, default 65270):
Using default value 65270

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

--Check the existing ASM disks

[root@oda11 ~]# ls -l /dev/oracleasm/disks
total 0
brw-rw---- 1 oracle oinstall 8, 49 Jul 27 15:45 VOL1
brw-rw---- 1 oracle oinstall 8, 65 Jul 27 15:45 VOL2
brw-rw---- 1 oracle oinstall 8, 81 Jul 27 15:45 VOL3
brw-rw---- 1 oracle oinstall 8, 97 Jul 27 15:45 VOL4
[root@oda11 ~]# oracleasm listdisks
VOL1
VOL2
VOL3
VOL4
[root@oda11 ~]# fdisk -l

Disk /dev/sdc: 322.1 GB, 322122547200 bytes
255 heads, 63 sectors/track, 39162 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x42ef9c9a

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1       39162   314568733+  83  Linux

Disk /dev/sdd: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x27e8e393

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1      133674  1073736373+  83  Linux

Disk /dev/sdb: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xca10e640

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       13054   104856223+  83  Linux

Disk /dev/sde: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd4ef0f41

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1      133674  1073736373+  83  Linux

Disk /dev/sdf: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x32693c1a

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1               1      133674  1073736373+  83  Linux

Disk /dev/sdg: 322.1 GB, 322122547200 bytes
255 heads, 63 sectors/track, 39162 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x86a86953

   Device Boot      Start         End      Blocks   Id  System
/dev/sdg1               1       39162   314568733+  83  Linux

Disk /dev/sda: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00043928

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64       13055   104344576   8e  Linux LVM

Disk /dev/mapper/vg_oda11-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_oda11-lv_swap: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_oda11-lv_home: 42.4 GB, 42421190656 bytes
255 heads, 63 sectors/track, 5157 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sdh: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3223fa3b

   Device Boot      Start         End      Blocks   Id  System
/dev/sdh1               1       65270   524281243+  83  Linux

--Create a new ASM disk from the newly formatted disk

[root@oda11 ~]# oracleasm createdisk VOL5 /dev/sdh1
Writing disk header: done
Instantiating disk: done
[root@oda11 ~]# oracleasm listdisks
VOL1
VOL2
VOL3
VOL4
VOL5
[root@oda11 ~]# ls -l /dev/oracleasm/disks
total 0
brw-rw---- 1 oracle oinstall 8,  49 Jul 27 15:46 VOL1
brw-rw---- 1 oracle oinstall 8,  65 Jul 27 15:46 VOL2
brw-rw---- 1 oracle oinstall 8,  81 Jul 27 15:46 VOL3
brw-rw---- 1 oracle oinstall 8,  97 Jul 27 15:46 VOL4
brw-rw---- 1 oracle oinstall 8, 113 Jul 27 15:45 VOL5
[root@oda11 ~]# so
[oracle@oda11] /home/oracle > . .profile_asm

--It is important to connect to ASM as SYSASM otherwise you can get error while trying to add the new disk

[oracle@oda11] /home/oracle > sqlplus / as sysasm

SQL*Plus: Release 11.2.0.3.0 Production on Fri Jul 27 15:53:37 2018

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Automatic Storage Management option

SQL> alter diskgroup data add disk '/dev/oracleasm/disks/VOL5';

Diskgroup altered.

SQL> set lines 150
SQL> select GROUP_NUMBER,STATE,NAME,PATH from v$asm_disk;

GROUP_NUMBER STATE    NAME
------------ -------- ------------------------------
PATH
------------------------------------------------------------------------------------------------------------------------------------------------------
           3 NORMAL   REDO_0000
/dev/oracleasm/disks/VOL4

           2 NORMAL   RECO_0000
/dev/oracleasm/disks/VOL3

           1 NORMAL   DATA_0001
/dev/oracleasm/disks/VOL2


GROUP_NUMBER STATE    NAME
------------ -------- ------------------------------
PATH
------------------------------------------------------------------------------------------------------------------------------------------------------
           1 NORMAL   DATA_0000
/dev/oracleasm/disks/VOL1

           1 NORMAL   DATA_0002
/dev/oracleasm/disks/VOL5


SQL> select GROUP_NUMBER,NAME,TOTAL_MB,FREE_MB from v$asm_diskgroup;

GROUP_NUMBER NAME                             TOTAL_MB    FREE_MB
------------ ------------------------------ ---------- ----------
           1 DATA                              2609133     630774
           2 RECO                              1048568    1048380
           3 REDO                               307196     282408

SQL> select * from v$asm_operation;

GROUP_NUMBER OPERA STAT      POWER     ACTUAL      SOFAR   EST_WORK   EST_RATE EST_MINUTES ERROR_CODE
------------ ----- ---- ---------- ---------- ---------- ---------- ---------- ----------- --------------------------------------------
           1 REBAL RUN           1          1       5021     576611       1742         328

SQL>


--OK

--------------------

--Check the new size of the DATA diskgroup in asmcmd

--Before adding the new disk

[oracle@oda11] /home/oracle > . .profile_asm
[oracle@oda11] /home/oracle > asmcmd -p
ASMCMD [+] > lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  NORMAL  N         512   4096  1048576   2097140   118846                0           59423              0             N  DATA/
MOUNTED  EXTERN  N         512   4096  4194304   1048568  1047028                0         1047028              0             N  RECO/
MOUNTED  EXTERN  N         512   4096  4194304    307196   282408                0          282408              0             N  REDO/

--After adding the new disk

[oracle@oda11] /home/oracle > asmcmd -p
ASMCMD [+] > lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  NORMAL  Y         512   4096  1048576   2609133   630773          1048570         -208898              0             N  DATA/
MOUNTED  EXTERN  N         512   4096  4194304   1048568  1048380                0         1048380              0             N  RECO/
MOUNTED  EXTERN  N         512   4096  4194304    307196   282408                0          282408              0             N  REDO/
ASMCMD [+] >

-----------------

Oracle Linux - grep with some lines before and some lines after what you are searching for


-- While you are searching for a word in a big log file like Oracle database alert log, you may need sometimes to get also some lines before and some lines after the actual grep result line, below is how to do it.

--try to grep an Oracle error together with previous and next lines of the actual line containing the error info

[oracle@exastbydbadm01] /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace > grep -A1 -B1 "ORA-00354" alert_INSISSTB1.log
Errors in file /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace/INSISSTB1_tt00_7378.trc:
ORA-00354: corrupt redo log block header
ORA-00353: log corruption near block 1059434 change 6338924527898 time 02/03/2018 10:18:38
--
Errors in file /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace/INSISSTB1_tt00_7378.trc:
ORA-00354: corrupt redo log block header
ORA-00353: log corruption near block 1059434 change 6338924527898 time 02/03/2018 10:18:38
--
Errors in file /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace/INSISSTB1_tt01_319744.trc:
ORA-00354: corrupt redo log block header
ORA-00353: log corruption near block 5759631 change 6338912674240 time 02/03/2018 09:09:20
----------

--this time with two lines before and after

[oracle@exastbydbadm01] /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace > grep -A2 -B2 "ORA-00354" alert_INSISSTB1.log
Sat Feb 03 10:33:56 2018
Errors in file /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace/INSISSTB1_tt00_7378.trc:
ORA-00354: corrupt redo log block header
ORA-00353: log corruption near block 1059434 change 6338924527898 time 02/03/2018 10:18:38
ORA-00312: online log 2 thread 2: '+DATAC1/INSISSTB/ONLINELOG/group_2.3438.962114127'
--
Sat Feb 03 10:33:56 2018
Errors in file /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace/INSISSTB1_tt00_7378.trc:
ORA-00354: corrupt redo log block header
ORA-00353: log corruption near block 1059434 change 6338924527898 time 02/03/2018 10:18:38
ORA-00312: online log 2 thread 2: '+DATAC1/INSISSTB/ONLINELOG/group_2.3438.962114127'
--
Sat Feb 03 10:49:35 2018
Errors in file /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace/INSISSTB1_tt01_319744.trc:
ORA-00354: corrupt redo log block header
ORA-00353: log corruption near block 5759631 change 6338912674240 time 02/03/2018 09:09:20
ORA-00312: online log 1 thread 1: '+DATAC1/INSISSTB/ONLINELOG/group_1.3511.962114125'
--
Sat Feb 03 10:49:35 2018
Errors in file /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace/INSISSTB1_tt01_319744.trc:
ORA-00354: corrupt redo log block header
ORA-00353: log corruption near block 5759631 change 6338912674240 time 02/03/2018 09:09:20
ORA-00312: online log 1 thread 1: '+DATAC1/INSISSTB/ONLINELOG/group_1.3511.962114125'
--

--stop the search after returning this number of results (-m5)

[oracle@exastbydbadm01] /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace > grep -m5 -B2 "ORA-00354" alert_INSISSTB1.log
Sat Feb 03 10:33:56 2018
Errors in file /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace/INSISSTB1_tt00_7378.trc:
ORA-00354: corrupt redo log block header
--
Sat Feb 03 10:33:56 2018
Errors in file /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace/INSISSTB1_tt00_7378.trc:
ORA-00354: corrupt redo log block header
--
Sat Feb 03 10:49:35 2018
Errors in file /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace/INSISSTB1_tt01_319744.trc:
ORA-00354: corrupt redo log block header
--
Sat Feb 03 10:49:35 2018
Errors in file /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace/INSISSTB1_tt01_319744.trc:
ORA-00354: corrupt redo log block header
--
Sat Feb 10 19:31:04 2018
Errors in file /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace/INSISSTB1_tt01_196447.trc:
ORA-00354: corrupt redo log block header
[oracle@exastbydbadm01] /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace >

-----------

--print the line numbers in the document (-in)

[oracle@exastbydbadm01] /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace > grep -m5 -in "ORA-00354" alert_INSISSTB1.log
1671756:ORA-00354: corrupt redo log block header
1671763:ORA-00354: corrupt redo log block header
1671880:ORA-00354: corrupt redo log block header
1671896:ORA-00354: corrupt redo log block header
1683409:ORA-00354: corrupt redo log block header
[oracle@exastbydbadm01] /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace >

--------------------

[oracle@exastbydbadm01] /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace > grep -m5 -in -B2 "ORA-00354" alert_INSISSTB1.log
1671754-Sat Feb 03 10:33:56 2018
1671755-Errors in file /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace/INSISSTB1_tt00_7378.trc:
1671756:ORA-00354: corrupt redo log block header
--
1671761-Sat Feb 03 10:33:56 2018
1671762-Errors in file /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace/INSISSTB1_tt00_7378.trc:
1671763:ORA-00354: corrupt redo log block header
--
1671878-Sat Feb 03 10:49:35 2018
1671879-Errors in file /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace/INSISSTB1_tt01_319744.trc:
1671880:ORA-00354: corrupt redo log block header
--
1671894-Sat Feb 03 10:49:35 2018
1671895-Errors in file /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace/INSISSTB1_tt01_319744.trc:
1671896:ORA-00354: corrupt redo log block header
--
1683407-Sat Feb 10 19:31:04 2018
1683408-Errors in file /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace/INSISSTB1_tt01_196447.trc:
1683409:ORA-00354: corrupt redo log block header
[oracle@exastbydbadm01] /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace >

-----------------------
--find all the "ORA-" errors

[oracle@exastbydbadm01] /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace > grep -m5 -in -B1 "ORA-" alert_INSISSTB1.log
15-Mon Jun 05 17:48:33 2017
16:Error ORA-235 occurred during an un-locked control file transaction.  This
--
130-Mon Jun 05 19:01:13 2017
131:Error ORA-235 occurred during an un-locked control file transaction.  This
--
391-Tue Jun 06 00:15:13 2017
392:ORA-01555 caused by SQL statement below (SQL ID: 1r8tm1nqr4vtk, Query Duration=47114 sec, SCN: 0x05ba.ae6d7dc8):
--
1098-Tue Jun 06 07:00:21 2017
1099:Error ORA-235 occurred during an un-locked control file transaction.  This
--
2215-Tue Jun 06 12:32:12 2017
2216:Error ORA-235 occurred during an un-locked control file transaction.  This
[oracle@exastbydbadm01] /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace >

-------------------
--"tail -f" the alert log and filter only the Ora error you are searching for with two previous and next lines

[oracle@exastbydbadm01] /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace > tail -5000f alert_INSISSTB1.log | grep -in -A2 -B2 "ORA-00354"
2364-Wed Jul 25 00:35:26 2018
2365-Errors in file /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace/INSISSTB1_tt00_294480.trc:
2366:ORA-00354: corrupt redo log block header
2367-ORA-00353: log corruption near block 67998 change 6375885933243 time 07/25/2018 00:26:39
2368-ORA-00312: online log 1 thread 1: '+DATAC1/INSISSTB/ONLINELOG/group_1.3511.962114125'
--
2371-Wed Jul 25 00:35:26 2018
2372-Errors in file /u01/app/oracle/diag/rdbms/insisstb/INSISSTB1/trace/INSISSTB1_tt00_294480.trc:
2373:ORA-00354: corrupt redo log block header
2374-ORA-00353: log corruption near block 67998 change 6375885933243 time 07/25/2018 00:26:39
2375-ORA-00312: online log 1 thread 1: '+DATAC1/INSISSTB/ONLINELOG/group_1.3511.962114125'

---------------