Solved

How to list jobs from last 24 hours in a CommServeDB query?

  • 5 August 2022
  • 6 replies
  • 180 views

Userlevel 2
Badge +8

CommServe DB query

==================

SELECT startdate
   ,clientname
   ,idataagent
   ,instance
   ,backupset
   ,subclient
   ,backuplevel
   ,jobstatus
   ,jobid
FROM CommcellBackupInfo
WHERE jobstatus = 'Failed to Start'
and backuplevel = 'Synthetic Full'
and iDataAgent = 'Virtual Server' 
order by jobid desc ;

 

I was this list to contain  only the jobs from last 24 hours, how to add the time range in this sql query.

 


 

icon

Best answer by Jos Meijer 5 August 2022, 11:23

View original

6 replies

Userlevel 7
Badge +16
SELECT startdate
   ,clientname
   ,idataagent
   ,instance
   ,backupset
   ,subclient
   ,backuplevel
   ,jobstatus
   ,jobid
FROM CommcellBackupInfo
WHERE jobstatus = 'Failed to Start'
and backuplevel = 'Synthetic Full'
and iDataAgent = 'Virtual Server'
and startdate >= DATEADD(day, -1, GETDATE())
order by jobid desc ;

 

Userlevel 1
Badge +3

Jos, Meier you might know this. 
What’s the simplest way to achieve conditional and statements in a query.

google fails me.

Userlevel 7
Badge +16

something like this?

 

CASE
WHEN condition_1 AND condition_2 THEN result_1
ELSE result_2
END

 

Userlevel 3
Badge +10

Honestly I have to try it to be sure.

i want to use a check box to modify a where clause in a workflow.

even if it doesnt work this gives me a good idea what to try next. Thanks @Jos Meijer 

Userlevel 2
Badge +8

@Jos Meijer Hi is there a way to get the list of repeated failures in a report or query.

I tried to prepare a report in the report builder, but failing to achieve it :(

So i just want a list of client for which backups are failing repeatedly for more than 2 days.

Userlevel 7
Badge +16

Hi @alligator 

Would this report help you?
https://cloud.commvault.com/webconsole/softwarestore/store.do#!/135/660/10390

This will show you how many strikes a client/subclient has, since when this is happening and when the last strike was registered.

Or are you looking for specific information?

Reply