Skip to main content
  • Place orders quickly and easily
  • View orders and track your shipping status
  • Enjoy members-only rewards and discounts
  • Create and access a list of your products
  • Manage your Dell EMC sites, products, and product-level contacts using Company Administration.

Article Number: 000022746


Avamar: How to: Query MCS database to find which backup was used in a Restore

Article Content


Instructions

At the time of this articles writing, there is not any report which provides information on which backup was used for a previously performed restore. This information could be useful if it is required to identify the date of a backup used in a restore. The MCS database view "v_activities_2" contains enough information to determine which backup was used in a restore and it can be queried to provide the needed information. Here is an example of a command that can be ran on an Avamar utility node to find the restores that were performed on August 1st 2017:

psql -p 5555 mcdb -c "select recorded_date,client_name from v_activities_2 where type!='Restore' and (backup_number,cid) in (select backup_number,cid from v_activities_2  where type ='Restore' and started_date='2017-08-01');"

Here is an example of the output from a lab machine:

admin@avamar:~/>: psql -p 5555 mcdb -c "select recorded_date,client_name from v_activities_2 where type!='Restore' and (backup_number,cid) in (select backup_number,cid from v_activities_2  where type ='Restore' and started_date='2017-08-01');"

 recorded_date |             client_name
---------------+-------------------------------------
 2017-06-15    | clientA
 2017-05-29    | clientB

(2 rows)


Based on this output, we can see that two restores were performed on August 1st 2017. They used backups from "clientA" and "clientB" and the date when that backup was taken was June 15th 2017 and May 29th 2017, respectively. By modifying the above command, the date of the restore can be changed to whatever is desired and even a date range can be used. If the restores had been performed over two weeks, then the query can be changed - from started_date='2017-08-01' to started_date>'2017-07-18' and started_date<'2017-08-02'.

admin@avamar:~/>: psql -p 5555 mcdb -c "select recorded_date,client_name from v_activities_2 where type!='Restore' and (backup_number,cid) in (select backup_number,cid from v_activities_2  where type ='Restore' and started_date>'2017-07-18' and started_date<'2017-08-02');"
 recorded_date |             client_name
---------------+-------------------------------------
 2017-06-30    | clientA
 2017-06-13    | clientB
 2017-06-15    | clientC
 2017-05-29    | clientD
(4 rows)


If more information is needed beyond the example recorded_date of the backup and the client_name, consult the Avamar Reports Guide (linked below in the notes section for the 7.3 release) for a list of the columns and their descriptions available in the v_activities_2 view. 

Additional Information

Generally, and by default, the activities data in the MCS database is kept for one year.
Therefore it is unlikely to be able to query this data for restores performed more than a year before. 
Avamar 7.3 Reports Guide

Article Properties


Affected Product

Avamar

Product

Avamar

Last Published Date

23 Nov 2020

Version

2

Article Type

How To