cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Query for Calendar Schedule

karuispirit
Level 1

Hi all,

I'm trying to get this to display in a readable format. Is it possible to format the 'days', 'specificExcludeDates', and 'specificIncludeDates'.

SQL Query:

SELECT

domain_ScheduleCalendar.policyname,
domain_ScheduleCalendar.days,
domain_ScheduleCalendar.specificexcludedates,
domain_ScheduleCalendar.specificincludedates

FROM

domain_ScheduleCalendar

What I see:

policyname

daysspecificexcludedatesspecificincludedates
test_b100000010000001000000100000010000000 133233300000000000;133262676000000000;133286868000000000;134181972000000000;134496468000000000;134810964000000000;135125460000000000;135446004000000000;

 

I want to see them in a readable format.

Thank you in advance!

 

 

1 REPLY 1

Krutons
Moderator
Moderator
   VIP   

@karuispirit Well, the days column is easy. It's grouped in 7 single digits with the first digit being Sunday and the last being Saturday.

1000011 - Means the job is scheduled with an active window on Sunday, Friday and Saturday. You could write a script to convert this column to text for yourself.

The specificExcludeDates and specificIncludeDates is not so easy. So, these are supposed to be in epoch (unix time). That's how you can make changes to a calendar and submit exclude dates through the command line. However, the numbers that are pulled from this SQL table are not that.

For example...

Real Epoch Time
1510963200 - 11/18/2017
1510876800 - 11/17/2017

What my SQL Query pulled back on a policy that I had excluded both of those dates.

NetBackup
137302740000000000 - 11/18/2017 
137301876000000000 - 11/17/2017

What I noticed right away was that there was a scale difference, so I looked at the difference between the 2 days since they both are at the beginning of the day.

Real Epoch Time Difference = 86,400

NetBackup SQL Query Values Difference = 864,000,000,000

That means there is a 10,000,000 scale difference and even after I scaled the NetBackup SQL Query Values down to what the real Epoch time was, the values were still way off and that's all the digging I did  currently.