We could design two separate tables: a user logon table and a user logoff table. In order to get around this table issue, we can create a database design whereby a single table is used to record both logon and logoff events (Listing A).
If we did, however, we'd have the difficulty of joining these two tables together and correlating which logon corresponds to which logoff and so on. This eliminates the need for table joins and data correlation.
Using the user audit table to generate reports can provide a wealth of information that may prove to be critical to you as an Oracle administrator.
Our first report is a summary of total session time, shown in Listing D.
We update the last module that was accessed by the user session.