When was the last date a harvest project was used?
Tania Moreno R.
I think to query harpackages to get this information. Right?
This question came up quite a few times on customer sites. You need to define exactly what you mean by "used", but it will normally be either the last time a new version was created in the project or the last time a package was created, promoted or demoted. Detecting the last time code was checked-out for browse is not possible AFAIK.
Here is a quick query that will list all projects with packages created in the last two months:
select distinct e.environmentname from harenvironment e, harpackage p where p.envobjid=e.envobjid and p.creationtime > sysdate-62;
If you want to get the last time, you can simply do a max() on the creationtime (or execdtime for promotes/demotes) and tie the envobjid back to the project you want to examine.
Let me know if you need more help and I will try and write some examples for you.
This query will give you the date of the last version created for a project:
SELECT HARENVIRONMENT.ENVIRONMENTNAME, MAX(DISTINCT HARVERSIONS.MODIFIEDTIME) AS LAST_USED_DATEFROM HARENVIRONMENT INNER JOIN HARVIEW ON HARENVIRONMENT.ENVOBJID = HARVIEW.ENVOBJID INNER JOIN HARVERSIONINVIEW ON HARVIEW.VIEWOBJID = HARVERSIONINVIEW.VIEWOBJID INNER JOIN HARVERSIONS ON HARVERSIONS.VERSIONOBJID = HARVERSIONINVIEW.VERSIONOBJIDWHERE HARENVIRONMENT.ENVIRONMENTNAME = 'MyProjectName' /* <---- Project Name goes here */GROUP BY HARENVIRONMENT.ENVIRONMENTNAME
It might provide a good indicator of the last time the project was used.
Let me know if this helps.
This script works.
Thanks a lot!