SQL to find when PeopleSoft table was built and analyzed in Oracle
Ever wondered when a PeopleSoft table was last built / altered or when its database stats were gathered ?
Many times, you need to know that information to analyze what’s happening with a table. For example, your table may not be working correctly or the performance may be degraded.
You may want to check when was the last time changes were done to the table. Of course you can use several other tools to validate this but I find below SQL to be handy.
Here is all the information below SQL will pull for you:
- PeopleSoft Record Name, Database table name, PeopleSoft Record description
- Find when was the last time PeopleSoft table was built (for e.g. when you use application designer to build a table or run a SQL script to build it)
- Find when was the last time stats were gathered and analyzed for PeopleSoft table
PS Basics Tip
-- Find when PeopleSoft table was built and analyzed SELECT A.OWNER, A.OBJECT_NAME AS TABLE_NAME, B.RECNAME AS RECORD_NAME, B.RECDESCR AS DESCRIPTION, A.CREATED, C.LAST_ANALYZED FROM DBA_OBJECTS A, PSRECDEFN B, DBA_TABLES C WHERE A.OWNER = 'SYSADM' AND A.OBJECT_TYPE = 'TABLE' AND (A.OBJECT_NAME = B.RECNAME OR A.OBJECT_NAME = 'PS_' || B.RECNAME) AND A.OBJECT_NAME = C.TABLE_NAME AND C.NUM_ROWS > 0;
Above SQL will give you the data for all the PeopleSoft table but if you want you can filter it using C.TABLE_NAME OR A.OBJECT_NAME.
If you like this tip, just let us in the comment section. Share it with others too.