Skip to main content
Solved

Commvault Database to fetch information related to Media Agent properites

  • December 12, 2023
  • 3 replies
  • 80 views

Forum|alt.badge.img+5

HI Team, 

I am putting media agent in maintenance mode through exescript post which i want to run a sql query to fetch media agent name along with showing whether media agent is marked in maintenance mode or not.

 

Can someone help me with sql table wherein i can fetch this information.

Best answer by Abhishek Narulkar

Hi @Rahul Nair , you can use this query to get the media Agents which are in maintenance.

select host.ClientId, APPC.name
from MMHost host with (readuncommitted)
    inner join APP_Client APPC with (readuncommitted) ON host.ClientId = APPC.id
where host.Attribute & 16 /*MMS2_MA_MARKED_FOR_MAINTENANCE*/ > 0 
 

3 replies

Forum|alt.badge.img+9
  • Vaulter
  • December 13, 2023

@Rahul Nair Good day!
please try the view check if it helps
select * from CommCellMediaAgentInfo


Forum|alt.badge.img+5
  • Author
  • Apprentice
  • December 15, 2023

Hi Sujay,

Above query doesnt give expected output. It doesnt have any column to show if a MA is marked in maintenance mode or not.


Forum|alt.badge.img+9

Hi @Rahul Nair , you can use this query to get the media Agents which are in maintenance.

select host.ClientId, APPC.name
from MMHost host with (readuncommitted)
    inner join APP_Client APPC with (readuncommitted) ON host.ClientId = APPC.id
where host.Attribute & 16 /*MMS2_MA_MARKED_FOR_MAINTENANCE*/ > 0