Perforce 2007.1 P4Report User's Guide
<< Previous Chapter
Configuring and Using P4Report
Table of Contents
Index
Perforce on the Web
Next Chapter >>
Defect Tracking

Chapter 2
Administrative Reporting

This chapter contains queries that return information about Perforce clients and users, typically of interest to system administrators. You can use these queries in Microsoft Excel, Crystal Reports, and other tools that can be configured with ODBC data sources. For details about executing SQL queries in Excel, see "Reporting Using Microsoft Excel" on page 10. For details about supported functions, refer to Appendix B, P4Report Functions.

What users made the most changes?

select user, count(*) from changes
     group by user
     order by 2 desc;

What has a specified user done in the past 24 hours?

select change, description from changes
     where user='jones' and timestampdiff(3, date, curtime()) < 24;

What clients haven't been used in a year or more?

select client, owner, accessed from clients
     where timestampdiff(8, accessed, curtimestamp())>0;

What users haven't been used in a year or more?

select user, fullname, accessed from users
     where timestampdiff(8, accessed,  curtimestamp())>0;

What clients belong to a specified user?

select client, owner, accessed from clients
     where owner='jones';

How many files/which files does a specified user have open?

select client, count(*) from opened
     group by client
     order by 2 desc;

Which groups contain a specified user?

select groupname from groups
     where userspec='tonyz';

What users have superuser privileges?

select * from protections
     where mode = 'super' and type  = 'user';

Note

The results of queries against the protections table can be misleading. Identifying paths in the protection table that have a specified access level is not the same as determining the access level for that path. P4Report can report on records in the protections table that match an evaluation condition (user, path, access), but P4Report cannot actually compute the protections. Computing protections requires knowledge of the order of the protection lines, exclusionary mappings, and Perforce wildcards.


Perforce 2007.1 P4Report User's Guide
<< Previous Chapter
Configuring and Using P4Report
Table of Contents
Index
Perforce on the Web
Next Chapter >>
Defect Tracking
Please send comments and questions about this manual to manual@perforce.com.
Copyright 2002-2007 Perforce Software. All rights reserved.
Last updated: 03/06/07