MYSQL to acquire all ONTAP and 7-Mode replications in NetApp OCI DWH

Just a bit of SQL to show all the ONTAP and 7-Mode replications from the NetApp OnCommand Insight Data  Warehouse.

For source and target we have the fields: 

Country, FAS/AFF Model, ONTAP MicroCode Version, Name, Type (i.e. Flexvol or Qtree), Snapshot Count

And the additional field:

Replication Technology (i.e. SnapMirror or SnapVault)

  • # MySQL to acquire all ONTAP and 7-Mode replications in the OCI DWH (from dwh_inventory)

  • SELECT
  • ss.country          AS 'Source Country',
  • ss.model            AS 'Source FAS/AFF',
  • ss.microcodeVersion AS 'Source ONTAP',
  • siv.`name`          AS 'Source Name',
  • siv.`type`          AS 'Source Type',
  • siv.snapshotCount   AS 'Source Snapshots',
  • drivr.technology    AS 'Replication Technology',
  • ts.country          AS 'Target Country',
  • ts.model            AS 'Target FAS/AFF',
  • ts.microcodeVersion AS 'Target ONTAP',
  • tiv.`name`          AS 'Target Name',
  • tiv.`type`          AS 'Target Type',
  • tiv.snapshotCount   AS 'Target Snapshots'
  • FROM dr_internal_volume_replica AS drivr
  • JOIN storage         AS ss  ON ss.id = drivr.sourceStorageId
  • JOIN internal_volume AS siv ON siv.id = drivr.sourceInternalVolumeId
  • JOIN storage         AS ts  ON ts.id = drivr.targetStorageId
  • JOIN internal_volume AS tiv ON tiv.id = drivr.targetInternalVolumeId
  • WHERE drivr.technology != 'LoadSharingMirror'

  • UNION

  • SELECT
  • ss.country          AS 'Source Country',
  • ss.model            AS 'Source FAS/AFF',
  • ss.microcodeVersion AS 'Source ONTAP',
  • sq.identifier       AS 'Source Name',
  • 'Qtree'             AS 'Source Type',
  • ''                  AS 'Source Snapshots',
  • drqr.technology     AS 'Replication Technology',
  • ts.country          AS 'Target Country',
  • ts.model            AS 'Target FAS/AFF',
  • ts.microcodeVersion AS 'Target ONTAP',
  • tq.identifier       AS 'Target Name',
  • 'Qtree'             AS 'Target Type',
  • ''                  AS 'Target Snapshots'
  • FROM dr_qtree_replica AS drqr
  • JOIN storage AS ss ON ss.id = drqr.sourceStorageId
  • JOIN qtree   AS sq ON sq.id = drqr.sourceQtreeId
  • JOIN storage AS ts ON ts.id = drqr.targetStorageId
  • JOIN qtree   AS tq ON tq.id = drqr.targetQtreeId;

Comments