Need a query to find out which user added a new user to the database

Document ID : KB000117115
Last Modified Date : 08/10/2018
Show Technical Document Details
Question:
We need to be able to find out which user added a new user to the Harvest database.
Environment:
CA Harvest SCM ll versions and platforms
Answer:
Here is a quick query that will answer the question:
 
For Oracle database:
SELECT HARUSER.USROBJID,
  HARUSER.USERNAME,
  CREATOR.USERNAME AS CREATORNAME,
  TO_CHAR(HARUSER.CREATIONTIME,'mm-dd-yyyy hh:mi:ss') AS CREATIONTIME
FROM HARUSER
INNER JOIN HARUSER CREATOR
ON HARUSER.CREATORID = CREATOR.USROBJID
WHERE HARUSER.USERNAME = 'testuser1'  /* <--- Type the userid of the user you want to know about here */

For SQL Server database:
SELECT HARUSER.USROBJID,
  HARUSER.USERNAME,
  CREATOR.USERNAME AS CREATORNAME,
  HARUSER.CREATIONTIME
FROM HARUSER
INNER JOIN HARUSER CREATOR
ON HARUSER.CREATORID = CREATOR.USROBJID
WHERE HARUSER.USERNAME = 'testuser1'  /* <--- Type the userid of the user you want to know about here */