Clarity

  • 1.  Query for reports in the library

    Posted May 16, 2014 06:49 AM

    I have started a thread on the rights no in the rights administration

    https://communities.ca.com/web/ca-community-feedback/message-board/-/message_boards/message/99507402?&#p_19

    The reports in the report library seem to be such that there is no way to access them unless you were given the right when the report was scheduled.

    Even if that is the case I should like to know which reports are there in the library if I were the admin and who ran them or have access to to them.

    Does anybody have such a query?

    Those tables not beeing in the Tech ref does not help.

    CMN_SCH_JOBS contains information for scheduled jobs

    CMN_SCH_JOB_RUNS contains infromation about executed jobs

    CMN_SCH_JOB_DEFINITIONS contain all the types of jobs that can be scheduled

     

    Martti K.



  • 2.  RE: Query for reports in the library

     
    Posted May 19, 2014 12:29 PM
    another_martink:

    I have started a thread on the rights no in the rights administration

    https://communities.ca.com/web/ca-community-feedback/message-board/-/message_boards/message/99507402?&#p_19

    The reports in the report library seem to be such that there is no way to access them unless you were given the right when the report was scheduled.

    Even if that is the case I should like to know which reports are there in the library if I were the admin and who ran them or have access to to them.

    Does anybody have such a query?

    Those tables not beeing in the Tech ref does not help.

    CMN_SCH_JOBS contains information for scheduled jobs

    CMN_SCH_JOB_RUNS contains infromation about executed jobs

    CMN_SCH_JOB_DEFINITIONS contain all the types of jobs that can be scheduled

     

    Martti K.


    Hi All,

    Does anyone have anything they can share with Martti?

    Thanks!

    Chris



  • 3.  RE: Query for reports in the library

    Posted May 20, 2014 09:10 AM

    Hi Martti,

    Are you able to see any results if you run the below query? We skipped the CMN_SCH_JOB_LOGS table, as in some cases we see that no entries created in it even after trying to run a report from clarity.

    select csjr.id CSJR_ID,csjd.id CSJD_ID, csj.id CSJ_ID,
    csj.name Job_Name,csjr.start_date,csjr.end_date,
    round((csjr.total_execution_time/1000)/60,2) Time_Taken_In_Minutes,
    csjr.status_code,
    csu.first_name||' '||csu.last_name Run_By,csjr.scheduler_id,
    csjr.job_hostname
    from
    CMN_SCH_JOB_RUNS csjr
    inner join CMN_SCH_JOBS csj on csjr.job_id=csj.id
    inner join CMN_SCH_JOB_DEFINITIONS csjd on csj.job_definition_id=csjd.id
    inner join CMN_LOOKUPS L on l.id=csjd.job_type and l.lookup_type = 'SCH_JOB_TYPE' and l.lookup_code = 'REPORT'
    inner join CMN_SEC_USERS csu on csjr.user_id=csu.id
    ---where csu.user_name='966644'

    Regarding Report Library rights, I think you should check the SP for Remove Job Logs and Report Library entries job, which is 'cmn_job_logs_delete_sp' as it has steps to remove those instance rights too. Below is a query made from the same SP. Please try this.

    select per.id,csj.name Report_Name,csu.first_name||' '||csu.last_name Run_By,csr.right_type, csr.permission_code 
    from cmn_sec_assgnd_obj_perm per
    inner join cmn_sec_users csu on per.principal_id=csu.id
    inner join cmn_sch_jobs csj on csj.id=per.object_instance_id
    inner join cmn_sec_right csr on csr.right_id=per.right_id and csr.permission_id=per.permission_id
    where per.object_instance_id in
    (
    select j.id from cmn_sch_jobs j, cmn_sch_job_definitions jd, cmn_lookups l
    where l.lookup_code = 'REPORT'
    and l.lookup_type = 'SCH_JOB_TYPE'
    and jd.job_type = l.id
    and j.is_visible = 0
    and jd.id = j.job_definition_id
    )
    order by per.id

     

    Thanks,

    Georgy



  • 4.  RE: Query for reports in the library

    Posted May 20, 2014 02:59 PM

    Thanks Gerogy,

    The first query seems to return just the type of information I was after. I tested it on the community sandbox.

    It will be two weeks when I am bakc on the site again and secondly it is MS SQL so maybe a little query conversion is needed.

     

    The problem the with the scheduled reports is that the rights are not within rights administration. So knowing who has what rights over what library item does not help if I cannot give that same access to my admin ID. As long as I can't do anything it is enough to know who ran what.

     

    Martti K.