Check HBA card type

$  lspci | grep -i fibre
18:00.0 Fibre Channel: QLogic Corp. ISP2722-based 16/32Gb Fibre Channel to PCIe Adapter (rev 01)
18:00.1 Fibre Channel: QLogic Corp. ISP2722-based 16/32Gb Fibre Channel to PCIe Adapter (rev 01)

Physical slot, driver, module information

$  lspci -v -s 18:00.0
18:00.0 Fibre Channel: QLogic Corp. ISP2722-based 16/32Gb Fibre Channel to PCIe Adapter (rev 01)
    Subsystem: QLogic Corp. QLE2692 Dual Port 16Gb Fibre Channel to PCIe Adapter
    Flags: bus master, fast devsel, latency 0, IRQ 231, NUMA node 0
    Memory at aab05000 (64-bit, prefetchable) [size=4K]
    Memory at aab02000 (64-bit, prefetchable) [size=8K]
    Memory at aaa00000 (64-bit, prefetchable) [size=1M]
    Expansion ROM at 9d900000 [disabled] [size=256K]
    Capabilities: [44] Power Management version 3
    Capabilities: [4c] Express Endpoint, MSI 00
    Capabilities: [88] Vital Product Data
    Capabilities: [90] MSI-X: Enable+ Count=16 Masked-
    Capabilities: [9c] Vendor Specific Information: Len=0c <?>
    Capabilities: [100] Advanced Error Reporting
    Capabilities: [154] Alternative Routing-ID Interpretation (ARI)
    Capabilities: [1c0] #19
    Capabilities: [1f4] Vendor Specific Information: ID=0001 Rev=1 Len=014 <?>
    Kernel driver in use: qla2xxx
    Kernel modules: qla2xxx

Check if the driver/module loaded

$  lsmod | grep qla2xxx
qla2xxx               792059  246
nvme_fc                33640  1 qla2xxx
scsi_transport_fc      64007  1 qla2xxx

Check module file name

$  modinfo -n qla2xxx
/lib/modules/3.10.0-1062.12.1.el7.x86_64/kernel/drivers/scsi/qla2xxx/qla2xxx.ko

Check HBA driver and version

$  modinfo -d qla2xxx
QLogic Fibre Channel HBA Driver
QLogic Fibre Channel HBA Driver (Target Mode Support, including 24xx+ ISP)

$  modinfo qla2xxx | grep version
version:        8.07.00.34.Trunk-SCST.19-k
rhelversion:    7.7
srcversion:     B6770D64FCF8A0A0273AD2C
vermagic:       3.10.0-1062.12.1.el7.x86_64 SMP mod_unload modversions

Check if the running driver is same as kernel

$  modinfo -k `uname -r` -n qla2xxx
/lib/modules/3.10.0-1062.12.1.el7.x86_64/kernel/drivers/scsi/qla2xxx/qla2xxx.ko

Remove current module/driver

$  modprobe -r qla2xxx

Show dependent devices/modules

$  modprobe --show-depends qla2xxx
insmod /lib/modules/3.10.0-1062.12.1.el7.x86_64/kernel/drivers/scsi/scsi_tgt.ko.xz
insmod /lib/modules/3.10.0-1062.12.1.el7.x86_64/kernel/drivers/scsi/scsi_transport_fc.ko.xz
insmod /lib/modules/3.10.0-1062.12.1.el7.x86_64/kernel/drivers/scsi/qla2xxx/qla2xxx.ko ql2xfwloadbin=2

Check the available HBA ports

$  ls -l /sys/class/fc_host
total 0
lrwxrwxrwx. 1 root root 0 Mar  9 13:01 host2 -> ../../devices/pci0000:17/0000:17:00.0/0000:18:00.0/host2/fc_host/host2
lrwxrwxrwx. 1 root root 0 Mar  9 13:01 host3 -> ../../devices/pci0000:17/0000:17:00.0/0000:18:00.1/host3/fc_host/host3

View used HBA ports on server

$  ls -ltr /sys/class/fc_transport/
total 0
lrwxrwxrwx. 1 root root 0 Mar  9 13:01 target6:0:0 -> ../../devices/pci0000:85/0000:85:02.0/0000:87:00.0/host6/rport-6:0-0/target6:0:0/fc_transport/target6:0:0
lrwxrwxrwx. 1 root root 0 Mar  9 13:01 target4:0:0 -> ../../devices/pci0000:85/0000:85:00.0/0000:86:00.0/host4/rport-4:0-0/target4:0:0/fc_transport/target4:0:0
[...]

Find the WWN numbers for your fc host

$  cat /sys/class/fc_host/host?/port_name
0x210034800d6baa70
0x210034800d6baa71

Port state

$  cat /sys/class/fc_host/host?/port_state
Online
Online

Queue depth

$  cat /sys/module/qla2xxx/parameters/ql2xmaxqdepth
64

To set/change the qdepth value on the fly:

$ echo 16 > /sys/module/qla2xxx/parameters/ql2xmaxqdepth

To set the qdepth value permanently:

$ modinfo qla2xxx | grep ql2xmaxqdepth
parm: ql2xmaxqdepth:Maximum queue depth to set for each LUN. Default is 32. (int)

$ vi /etc/modprobe.conf
alias scsi_hostadapter1 qla2xxx
options qla2xxx ql2xmaxqdepth=16

Scan disks

$  ls /sys/class/scsi_host
host1  host2  host3  host4  host5  host6  host7

$  for x in `ls /sys/class/scsi_host`
> do
> echo "- - -" > /sys/class/scsi_host/$x/scan
> done

Check number of LUNs

$  pwd
/opt/QLogic_Corporation/QConvergeConsoleCLI

$ ./scli -t 
HBA Instance 1: QLE2692 Port 2 WWPN 21-00-34-80-0D-6B-AA-71 PortID 02-1D-00
Link: Online

Path                           : 0
Target                         : 0
Device ID                      : 0xffff
Product Vendor                 : PURE
Product ID                     : FlashArray
Product Revision               : 8888
Serial Number                  : 7CA43045E3514BF700011025
Node Name                      : 52-4A-93-77-BB-B4-74-03
Port Name                      : 52-4A-93-77-BB-B4-74-03
Port ID                        : 02-2C-00
Product Type                   : FCP Disk
LUN Count(s)                   : 16
Status                         : Online

Check HBA speed

$  grep -Hv "zz" /sys/class/fc_host/host*/speed
/sys/class/fc_host/host2/speed:16 Gbit
/sys/class/fc_host/host3/speed:16 Gbit

Collect QLogic HBA stats

$  pwd
/opt/QLogic_Corporation/QConvergeConsoleCLI

$  ./qaucli -gs 8 SetRate 10 LogToFile /tmp/fs.stat.csv

Reference

The following script will allow you to monitor progress of an RMAN backup or Restore from 4 different perspectives (channel, session wait events, datafiles, backuppieces). The script is run from SQLPlus and takes a date input value in the format ‘dd-mon-rr hh24:mi:ss’. The date supplied does not have to be precise and can be taken from the rman log of the job that is running.

REM 
REM Script to monitor rman backup/restore operations
REM To run from sqlplus:   @monitor '[dd-mon-rr hh24:mi:ss]' 
REM Example:  
--SQL>spool monitor.out
--SQL>@monitor '06-aug-12 16:38:03'
REM where [date] is the start time of your rman backup or restore job
REM Run monitor script periodically to confirm rman is progessing
REM 

alter session set nls_date_format='dd-mon-rr hh24:mi:ss';
set lines 1500
set pages 100
col CLI_INFO format a10
col spid format a5
col ch format a20
col seconds format 999999.99
col filename format a65
col bfc  format 9
col "% Complete" format 999.99
col event format a40
set numwidth 10

select sysdate from dual;

REM gv$session_longops (channel level)

prompt
prompt Channel progress - gv$session_longops:
prompt
select s.inst_id, o.sid, CLIENT_INFO ch, context, sofar, totalwork,
                    round(sofar/totalwork*100,2) "% Complete"
     FROM gv$session_longops o, gv$session s
     WHERE opname LIKE 'RMAN%'
     AND opname NOT LIKE '%aggregate%'
     AND o.sid=s.sid
     AND totalwork != 0
     AND sofar <> totalwork;

REM Check wait events (RMAN sessions) - this is for CURRENT waits only
REM use the following for 11G+
prompt
prompt Session progess - CURRENT wait events and time in wait so far:
prompt
select inst_id, sid, CLIENT_INFO ch, seq#, event, state, wait_time_micro/1000000 seconds
from gv$session where program like '%rman%' and
wait_time = 0 and
not action is null;

REM use the following for 10G
--select  inst_id, sid, CLIENT_INFO ch, seq#, event, state, seconds_in_wait secs
--from gv$session where program like '%rman%' and
--wait_time = 0 and
--not action is null;

REM gv$backup_async_io
prompt
prompt Disk (file and backuppiece) progress - includes tape backuppiece 
prompt if backup_tape_io_slaves=TRUE:
prompt
select s.inst_id, a.sid, CLIENT_INFO Ch, a.STATUS,
open_time, round(BYTES/1024/1024,2) "SOFAR Mb" , round(total_bytes/1024/1024,2)
TotMb, io_count,
round(BYTES/TOTAL_BYTES*100,2) "% Complete" , a.type, filename
from gv$backup_async_io a,  gv$session s
where not a.STATUS in ('UNKNOWN')
and a.sid=s.sid and open_time > to_date('&1', 'dd-mon-rr hh24:mi:ss') order by 2,7;

REM gv$backup_sync_io
prompt
prompt Tape backuppiece progress (only if backup_tape_io_slaves=FALSE):
prompt
select s.inst_id, a.sid, CLIENT_INFO Ch, filename, a.type, a.status, buffer_size bsz, buffer_count bfc,
open_time open, io_count
from gv$backup_sync_io a, gv$session s
where
a.sid=s.sid and
open_time > to_date('&1', 'dd-mon-rr hh24:mi:ss') ;
REM 

From RMAN log, you can see the follwoing timestamp.

Starting restore at 16-DEC-2019 12:38:04

You can run this script at any time if you suspect that rman is taking longer than expected - simply spool the results to a file and rerun the script periodically to check that the job is progressing.

Sample output:

$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Mon Dec 16 14:08:34 2019
Copyright (c) 1982, 2016, Oracle.  All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> @monitor "16-DEC-2019 12:38:04"
Session altered.


SYSDATE
16-dec-19 14:08:45


Channel progress - gv$session_longops:
no rows selected

Session progess - CURRENT wait events and time in wait so far:

   INST_ID	  SID CH			 SEQ# EVENT				       STATE		      SECONDS

     1	  217				35823 SQL*Net message from client	       WAITING		       115.75
     1	  225 rman channel=ch00 	 3647 Backup: MML restore backup piece	       WAITING		       115.94
     1	  229 rman channel=ch01 	32765 Backup: MML restore backup piece	       WAITING		       115.88
     1	  233 rman channel=ch02 	51706 Backup: MML restore backup piece	       WAITING		       115.81
     1	  237 rman channel=ch03 	62302 Backup: MML restore backup piece	       WAITING		       115.75

Disk (file and backuppiece) progress - includes tape backuppiece
if backup_tape_io_slaves=TRUE:

old   7: and a.sid=s.sid and open_time > to_date('&1', 'dd-mon-rr hh24:mi:ss') order by 2,7
new   7: and a.sid=s.sid and open_time > to_date('16-DEC-2019 12:38:04', 'dd-mon-rr hh24:mi:ss') order by 2,7

   INST_ID	  SID CH		   STATUS      OPEN_TIME	    SOFAR Mb	  TOTMB   IO_COUNT % Complete TYPE	FILENAME

     1	  225 rman channel=ch00    FINISHED    16-dec-19 13:03:03	  31	     31 	 9     100.00 OUTPUT	+DATA/tpcc/iitem_0_0
     1	  225 rman channel=ch00    FINISHED    16-dec-19 12:47:56      31900	  31900       7977     100.00 OUTPUT	+DATA/tpcc/hist_0_0
     1	  229 rman channel=ch01    FINISHED    16-dec-19 12:57:30      30600	  30600       7652     100.00 OUTPUT	+DATA/tpcc/stok_0_6
     1	  229 rman channel=ch01    FINISHED    16-dec-19 12:53:37      30890	  30890       7724     100.00 OUTPUT	+DATA/tpcc/ordr_0_9
     1	  229 rman channel=ch01    FINISHED    16-dec-19 12:50:21      31280	  31280       7822     100.00 OUTPUT	+DATA/tpcc/cust_0_6
     1	  233 rman channel=ch02    FINISHED    16-dec-19 13:02:39	  90	     90 	24     100.00 OUTPUT	+DATA/tpcc/ware_0_0
     1	  233 rman channel=ch02    FINISHED    16-dec-19 13:01:49	 933	    933        235     100.00 OUTPUT	+DATA/tpcc/tpccaux
     1	  233 rman channel=ch02    FINISHED    16-dec-19 12:58:16      30600	  30600       7652     100.00 OUTPUT	+DATA/tpcc/stok_0_11
     1	  233 rman channel=ch02    FINISHED    16-dec-19 12:55:07      30890	  30890       7724     100.00 OUTPUT	+DATA/tpcc/ordr_0_14
     1	  233 rman channel=ch02    FINISHED    16-dec-19 12:51:07      30890	  30890       7724     100.00 OUTPUT	+DATA/tpcc/ordr_0_4
     1	  237 rman channel=ch03    FINISHED    16-dec-19 13:02:48      33.21	  33.21 	10     100.00 OUTPUT	+DATA/tpcc/iware_0_0
     1	  237 rman channel=ch03    FINISHED    16-dec-19 13:01:59	 400	    400        102     100.00 OUTPUT	+DATA/tpcc/system_1
     1	  237 rman channel=ch03    FINISHED    16-dec-19 13:00:34    7490.45	7490.45       1874     100.00 OUTPUT	+DATA/tpcc/icust1_0_0
     1	  237 rman channel=ch03    FINISHED    16-dec-19 12:55:15      30600	  30600       7652     100.00 OUTPUT	+DATA/tpcc/stok_0_0
     1	  237 rman channel=ch03    FINISHED    16-dec-19 12:53:02      30890	  30890       7724     100.00 OUTPUT	+DATA/tpcc/ordr_0_8
     1	  237 rman channel=ch03    FINISHED    16-dec-19 12:48:06      31280	  31280       7822     100.00 OUTPUT	+DATA/tpcc/cust_0_1

16 rows selected.

Tape backuppiece progress (only if backup_tape_io_slaves=FALSE):

old   6: open_time > to_date('&1', 'dd-mon-rr hh24:mi:ss')
new   6: open_time > to_date('16-DEC-2019 12:38:04', 'dd-mon-rr hh24:mi:ss')

   INST_ID	  SID CH		   FILENAME							     TYPE      STATUS		  BSZ BFC OPEN		       IO_COUNT

     1	  225 rman channel=ch00    bk_dTPCC_ucuuj5dpp_s414_p1_t1026733881			     INPUT     FINISHED        262144	4 16-dec-19 12:47:56	  65392
     1	  225 rman channel=ch00    bk_dTPCC_uehuj5udh_s465_p1_t1026750897			     INPUT     FINISHED        262144	4 16-dec-19 13:03:03	      8
     1	  229 rman channel=ch01    bk_dTPCC_ud7uj5i8g_s423_p1_t1026738448			     INPUT     FINISHED        262144	4 16-dec-19 12:50:21	 116172
     1	  229 rman channel=ch01    bk_dTPCC_udtuj5q1d_s445_p1_t1026746413			     INPUT     FINISHED        262144	4 16-dec-19 12:57:30	 113036
     1	  229 rman channel=ch01    bk_dTPCC_udhuj5l9e_s433_p1_t1026741550			     INPUT     FINISHED        262144	4 16-dec-19 12:53:37	  63372
     1	  233 rman channel=ch02    bk_dTPCC_ueeuj5u99_s462_p1_t1026750761			     INPUT     FINISHED        262144	4 16-dec-19 13:02:39	    312
     1	  233 rman channel=ch02    bk_dTPCC_udmuj5mm0_s438_p1_t1026742976			     INPUT     FINISHED        262144	4 16-dec-19 12:55:07	  63776
     1	  233 rman channel=ch02    bk_dTPCC_ue0uj5rik_s448_p1_t1026747988			     INPUT     FINISHED        262144	4 16-dec-19 12:58:16	 113444
     1	  233 rman channel=ch02    bk_dTPCC_ueauj5u3a_s458_p1_t1026750570			     INPUT     FINISHED        262144	4 16-dec-19 13:01:49	   3220
     1	  233 rman channel=ch02    bk_dTPCC_udauj5jb1_s426_p1_t1026739553			     INPUT     FINISHED        262144	4 16-dec-19 12:51:07	  64180
     1	  237 rman channel=ch03    bk_dTPCC_ueguj5uc3_s464_p1_t1026750851			     INPUT     FINISHED        262144	4 16-dec-19 13:02:48	      0
     1	  237 rman channel=ch03    bk_dTPCC_uecuj5u6f_s460_p1_t1026750671			     INPUT     FINISHED        262144	4 16-dec-19 13:01:59	   1184
     1	  237 rman channel=ch03    bk_dTPCC_ue7uj5trl_s455_p1_t1026750325			     INPUT     FINISHED        262144	4 16-dec-19 13:00:34	  28188
     1	  237 rman channel=ch03    bk_dTPCC_udnuj5mut_s439_p1_t1026743261			     INPUT     FINISHED        262144	4 16-dec-19 12:55:15	 113444
     1	  237 rman channel=ch03    bk_dTPCC_udfuj5knj_s431_p1_t1026740979			     INPUT     FINISHED        262144	4 16-dec-19 12:53:02	  63372
     1	  237 rman channel=ch03    bk_dTPCC_ud1uj5f5c_s417_p1_t1026735276			     INPUT     FINISHED        262144	4 16-dec-19 12:48:06	 115768

16 rows selected.

References

RMAN backs up the datafiles, control file, archived log files, and server parameter files in a RMAN specific format called a backup piece. In a nutshell, a backup set is a bundle of dbf, ctl and redo file that can restore a database. A set of one or more such backup pieces makes up a backup set. A backup set is created using the BACKUP command.

Useful views for backup query

  • V$BACKUP_SET displays information about backup sets from the control file. A backup set record is inserted after the backup set is successfully completed. The backup set stamp (SET_STAMP) and count (SET_COUNT) uniquely identify the backup set.

  • V$BACKUP_PIECE displays information about backup pieces from the control file. Each backup set consists of one or more backup pieces.

  • V$BACKUP_DATAFILE displays information about control files and datafiles in backup sets from the control file.

  • V$BACKUP_FILES displays information about all RMAN backups (both image copies and backup sets) and archived logs.This view simulates the LIST BACKUP and LIST COPY RMAN commands. This view requires that the database be set using the DBMS_RCVMAN.SETDATABASE procedure.

Useful SQL statements

  • Query backup set information. The very last record(e.g. RECID=360) could be used as the start point for future queries.

    SQL> select recid, set_stamp, set_count, backup_type,incremental_level,pieces,start_time,completion_time,elapsed_seconds,block_size from v$backup_set;

Image

  • Query backup pieces for certain backup set.

    SQL> select piece#,compressed,start_time,completion_time,elapsed_seconds,bytes/1024/1024 from v$backup_piece where set_stamp=1029939968 and set_count=372;

Image

  • Query backup files for certain backup set.

    SQL> select pkey,fname,file_type,bytes/1024/1024,bs_key,bs_type,bs_pieces,bs_incr_type,bs_bytes/1024/1024, bs_completion_time from v$backup_files where FILE_TYPE=’PIECE’order by bs_key;

Image

SQL> select pkey,file_type, fname, bytes/1024/1024,bs_key,bs_type,bs_incr_type,bs_bytes/1024/1024 from v$backup_files where bs_key=360;

Image

  • Query total blocks and read blocks for certain backup set.

    SQL> select set_stamp,set_count,incremental_level,datafile_blocks,blocks,block_size, CREATION_TIME ,completion_time,used_change_tracking,blocks_read from v$backup_datafile where set_count>365;

Image

  • Query total blocks and read blocks for certain backup. The following example checks the read and write ratio when BCT is enabled and a full backup is done.

    SQL> select sum(BLOCKS_READ*BLOCK_SIZE)/1024/1024/1024 read_GB from v$backup_datafile where USED_CHANGE_TRACKING = ‘YES’;

    READ_GB
    1195.7244

    SQL> select sum(BLOCKS*BLOCK_SIZE)/1024/1024/1024 write_GB from v$backup_datafile where USED_CHANGE_TRACKING = ‘YES’;

    WRITE_GB
    

    898.733315

    SQL> select sum(DATAFILE_BLOCKS*BLOCK_SIZE)/1024/1024/1024 datafile_GB from v$backup_datafile where USED_CHANGE_TRACKING = ‘YES’;

    DATAFILE_GB
    1195.7244

    SQL> select sum(BLOCKS_READ)/sum(DATAFILE_BLOCKS) from v$backup_datafile where USED_CHANGE_TRACKING = ‘YES’;

    SUM(BLOCKS_READ)/SUM(DATAFILE_BLOCKS)
    1
    SQL> select sum(BLOCKS)/sum(DATAFILE_BLOCKS) from v$backup_datafile where USED_CHANGE_TRACKING = ‘YES’;

    SUM(BLOCKS)/SUM(DATAFILE_BLOCKS)
    .751622457

  • The following example checks the read and write blocks ratio after incremental backup is done which is based on previous full backup. The write blocks ratio can be treated as data change ratio.

    $ cat bct_check.sql
    set linesize 500;

    select set_stamp,set_count,incremental_level, used_change_tracking,blocks_read,blocks,datafile_blocks,block_size from v$backup_datafile where set_count>372 order by set_count;

    select sum(BLOCKS_READ*BLOCK_SIZE)/1024/1024/1024 read_GB from v$backup_datafile where set_count>372;

    select sum(BLOCKS*BLOCK_SIZE)/1024/1024/1024 write_GB from v$backup_datafile where set_count>372;

    select sum(DATAFILE_BLOCKS*BLOCK_SIZE)/1024/1024/1024 total_GB from v$backup_datafile where set_count>372;

    select sum(BLOCKS_READ)/sum(DATAFILE_BLOCKS) “%READ” from v$backup_datafile where set_count>372;

    select sum(BLOCKS)/sum(DATAFILE_BLOCKS) “%WRITE” from v$backup_datafile where set_count>372;

    exit

$ sqlplus / as sysdba @bct_check.sql

Image

READ_GB
662.855164

WRITE_GB
103.244957

TOTAL_GB
1195.75419

%READ
.554337382

%WRITE
.086336245
  • The following command also checks total write data during backup.

    SQL> select sum(BYTES)/1024/1024/1024 from v$backup_piece where set_count>372;

    SUM(BYTES)/1024/1024/1024
    130.938721

Danny Pickett is a man who is too poor to afford one of Mr. Haggins champion Irish Setters. However, he is drawn close to a dog called Big Red. Their friendship builds up as they know each other. Their loyalty and courage are tested during various hunts such as when they fought against Old Majesty, a massive bear.

Read more »

Incremental backups can be either level 0 or level 1. A level 0 incremental backup, which is the base for subsequent incremental backups, copies all blocks containing data, backing the datafile up into a backup set just as a full backup would. The only difference between a level 0 incremental backup and a full backup is that a full backup is never included in an incremental strategy.

A level 1 incremental backup can be either of the following types:

  • A differential backup, which backs up all blocks changed after the most recent incremental backup at level 1 or 0
  • A cumulative backup, which backs up all blocks changed after the most recent incremental backup at level 0

Incremental backups are differential by default.

The size of the backup file depends solely upon the number of blocks modified and the incremental backup level.

Image

In the example shown above, the following occurs:

  • Sunday

An incremental level 0 backup backs up all blocks that have ever been in use in this database.

  • Monday - Saturday

On each day from Monday through Saturday, a differential incremental level 1 backup backs up all blocks that have changed since the most recent incremental backup at level 1 or 0. So, the Monday backup copies blocks changed since Sunday level 0 backup, the Tuesday backup copies blocks changed since the Monday level 1 backup, and so forth.

  • The cycle is repeated for the next week.

Image

In the example shown above, the following occurs:

  • Sunday

An incremental level 0 backup backs up all blocks that have ever been in use in this database.

  • Monday - Saturday

A cumulative incremental level 1 backup copies all blocks changed since the most recent level 0 backup. Because the most recent level 0 backup was created on Sunday, the level 1 backup on each day Monday through Saturday backs up all blocks changed since the Sunday backup.

  • The cycle is repeated for the next week.

Incremental Backup Algorithm

Each data block in a datafile contains a system change number (SCN), which is the SCN at which the most recent change was made to the block. During an incremental backup, RMAN reads the SCN of each data block in the input file and compares it to the checkpoint SCN of the parent incremental backup. If the SCN in the input data block is greater than or equal to the checkpoint SCN of the parent, then RMAN copies the block.

Note that if you enable the block change tracking feature, RMAN can refer to the change tracking file to identify changed blocks in datafiles without scanning the full contents of the datafile. Once enabled, block change tracking does not alter how you take or use incremental backups, other than offering increased performance.

What is patrolread

The Patrol Read feature is designed as a preventative measure to ensure hard drive health and data integrity. Patrol Read scans for and resolves potential problems on configured hard drives.

Patrol Read Behavior

The following is an overview of Patrol Read behavior:

  • Patrol Read runs on all disks on the controller that are configured as part of a virtual disk, including hot spares.

  • Patrol Read does not run on hard drives that are not part of a virtual disk or are in Ready state.

  • Patrol Read adjusts the amount of controller resources that are dedicated to Patrol Read operations based on outstanding disk I/O. For example, if the system is busy processing I/O operation, then Patrol Read uses fewer resources to allow the I/O to take a higher priority.

  • Patrol Read does not run on any disks that are involved in any of the following operations:

  • Rebuild

  • Replace Member

  • Full or Background Initialization

  • Consistency Check

Patrol Read Modes

Patrol Read Mode can be set in BIOS configuration utility and UEFI RAID Configuration Utility. The default Patrol Read mode is automatic. When Patrol Read is in automatic mode, Patrol Read runs automatically at its scheduled interval.

Below is a summary of the different Patrol Read modes:

  • In Auto Mode, Patrol Read will run every 168 hours (7 days). Whenever started, the duration depends on the size of storage. For NBFS, it would last 24 hours
  • In Auto Mode, Firmware allows Patrol Read to be started manually
  • In Auto Mode, Patrol Read can be stopped manually.
  • In Manual Mode, Patrol Read does not start automatically as per the scheduled time.
  • In Manual Mode, Patrol Read can be started manually.
  • In Manual Mode, Patrol Read can be stopped manually.
  • In Disabled Mode, Patrol Read will not run automatically.
  • In Disabled Mode, Patrol Read cannot be started manually.

Performance issues

We have observed a few performance issues that were caused by Patrol read. When Patrol read is running, much higher IO service time (svctm) can be seen.

The Revolutionary and Civil War were two of the most well known wars in American history. They greatly impacted America in different ways. The Civil War abolished slavery while the Revolutionary War created our nation.

Read more »

Shell

Special variables in Shell:

  • $0 - The filename of the current script.
  • $# - The number of arguments supplied to a script.
  • $* - All the arguments are double quoted. If a script receives two arguments, $* is equivalent to $1 $2.
  • $@ - All the arguments are individually double quoted. If a script receives two arguments, $@ is equivalent to $1 $2.
  • $? - The exit status of the last command executed.
  • $$ - The process number of the current shell. For shell scripts, this is the process ID under which they are executing.
  • $! - The process number of the last background command.

Enable ssh passwordless login for multiple servers:

$ rpm -ivh sshpass-1.06-1.el7.x86_64.rpm

$ for i in `seq 0 239`
do
    sshpass -p "password" ssh-copy-id -i /root/.ssh/id_rsa.pub -o StrictHostKeyChecking=no server$i
done

Sed

$ sed -n 5p <file>

Replace specific line with new string:

$ sed -i '2s/.*/aa/' /file/path

Add line after string match:

$ sed -i '/SERVER = str1/a SERVER = "str2"' /file/path

Remove strings from beginning of lines:

# Remove 40 characters from beginning of lines
$ cat file | sed -r 's/.{40}//' 

Remove leading and tailing spaces:

$ echo $diskstats
252       2 dev/dev1029144966969016657 150 0 1200 8031 2297170 2606 165332568 46106742 0 684017 44948515 5 0 72 4
$ echo $diskstats | awk '{$1="";$2="";$3="";print}' | sed 's/^[ \t]*//;s/[ \t]*$//;'
150 0 1200 8031 2297170 2606 165332568 46106742 0 684017 44948515 5 0 72 4

Replace multiple digits in a string

$ echo fio.read_16k_8jobs_20210927_103626.out | sed 's/fio\.//g;s/\.out//g;' | awk '{gsub("_[0-9]{5,}","",$1); print}'
read_16k_8jobs

awk

Use awk regex to match variable passed from shell

str=abc
awk  '/'$str'/ {print $0 }' filename

Or

str=abc
awk  -v pattern=$str '$0 ~ pattern{print $0 }' filename

Misc

download a file

$ sudo curl -vL -o testfile.zip 'https://example.com/remote_testfile.zip'

wget directory:

$ wget -r -np -R "index.html*" http://example.com/configs/.vim/

Sync Mac Address during boot

$ cat /etc/rc.d/rc.local
new_mac=`cat /sys/class/net/eno16780032/address`
sed -i "s/HWADDR=.*/HWADDR=$new_mac/" /etc/sysconfig/network-scripts/ifcfg-eno16780032
service network restart

Check command exit status

for pool in $pools 
do 
    for vol in $vols
    do 
        pxctl v i $vol | grep $pool > /dev/null 2>&1
        if [ $? -eq 0 ]; then echo $vol; break; fi
    done
done

by Edgar Albert Guest

Courage isn’t a brilliant dash,

A daring deed in a moment’s flash;

It isn’t an instantaneous thing

Born of despair with a sudden spring

It isn’t a creature of flickered hope

Or the final tug at a slipping rope;

But it’s something deep in the soul of man

That is working always to serve some plan.

Courage isn’t the last resort

In the work of life or the game of sport;

It isn’t a thing that a man can call

At some future time when he’s apt to fall;

If he hasn’t it now, he will have it not

When the strain is great and the pace is hot.

For who would strive for a distant goal

Must always have courage within his soul.

Courage isn’t a dazzling light

That flashes and passes away from sight;

It’s a slow, unwavering, ingrained trait

With the patience to work and the strength to wait.

It’s part of a man when his skies are blue,

It’s part of him when he has work to do.

The brave man never is freed of it.

He has it when there is no need of it.

Courage was never designed for show;

It isn’t a thing that can come and go;

It’s written in victory and defeat

And every trial a man may meet.

It’s part of his hours, his days and his years,

Back of his smiles and behind his tears.

Courage is more than a daring deed:

It’s the breath of life and a strong man’s creed.

In the Northern and Southern Dynasties of china, there lived a heroine named Hua Mulan. Mulan was born in a small village, and she lived with her veteran father, who served in war for the emperor, and her kind hearted mother. Mulan also had an nice little sister. From a very young age, Mulan developed a great interest in the life of a warrior. In his spare time, Mulan’s father trained her in fighting skills at the riverside, everything from riding a horse to shooting an arrow, from swinging a sword to wielding a staff.

One day, in the small village, an shocking event happened. Boai Khan’s army was invading the emperor’s land once again. Guards of the emperor said that one man from every family must volunteer to fight in the war. Mulan knew what this meant. Father was the only man in the family, so he had to join the army. But if he joined and fought, he may never come back. Mulan knew what was necessary. She would take her father’s place in the military. She took his armor, sword, and horse. At dawn, she rode to the military camp.

During her training, Mulan overcame many troubles. She didn’t want to shower with men, so she offered to be on night guard duty. When she wanted to take a bath, she would do it at the lake. But it also made her a tough warrior. Her fighting skills surpassed any men. When the soldiers were forced to carry two buckets of water up a mountain, Mulan was the first to reach the peak.

After a few months of training, the commander said that it was time to enter the war. They were losing the moment they started. Khan’s army even had fireballs. While the rest of the army struggled to defend themselves, mulan targeted on Khan. When Khan saw Mulan coming, he hopped on a horse and ran away. Mulan darted after him but was soon lost in a canyon. Suddenly, the witch came and shot an arrow at Mulan. Mulan died for a lie can only live so long. But the chi inside her wasn’t held back. Like a phoenix, Mulan rebirthed. She revealed her true identity. When she went back, she grabbed a few helmets with her. She put the helmets on a rock so they looked like soldiers. She hid behind the rock and shot an arrow at the enemy. The enemy saw the fake soldiers and launched a fireball at them. This fireball caused a snowstorm down from the mountain. Though Mulan saved her general and the rest of the army, the leader thought she was an imposter. But when Mulan said that Khan was planning a sneak attack on the emperor, her friends believed in her and made her their leader. They rushed back to the palace. Using her chi, Mulan defeated the enemy and saved the emperor. The emperor, who owed his life to Mulan, asked her what reward she wanted. Mulan said that she wanted to apologize to her parents for stealing their armor and sword. After that, she would take care of them. The emperor granted the wish after making Mulan an officer in the army.

People admire Mulan for her bravery, honesty, loyalty to the army, and filial piety to her parents.

0%