How to determine real-time row counts of each table in the RSA Via Lifecycle & Governance AVUSER schema
Originally Published: 2016-06-03
Article Number
Applies To
Issue
- The Statistics Report (ASR) under System > Diagnostics.
- Querying dba_tables as in:
$ sqlplus / avuser SQL> SELECT table_name, num_rows FROM dba_tables WHERE owner='AVUSER' AND num_rows IS NOT NULL;
However, neither of these methods are real time. The row counts are based on the last time database statistics (db stats) ran. Furthermore, db stats does not count the rows in every single table. This article addresses a third method that allows you to create a SQL script file that calculates and reports the current row counts for every table in the AVUSER schema. You may also modify the file to include only those tables for which you want row counts.
Tasks
- Create a SQL command file that will count the number of rows in each table in the AVUSER schema. Please note you may modify these steps to include any schema of your choosing.
$ sqlplus / as sysdba SQL> SPOOL <filename>.sql SQL> SET linesize 300; SQL> COLUMN ||TABLE_NAME|| FORMAT a200; SQL> COLUMN COUNT(*) FORMAT a10; SQL> SELECT 'SELECT '''||table_name||''',COUNT(*) FROM '||table_name||';' FROM dba_tables WHERE owner='AVUSER'; SQL> SPOOL OFF; SQL> EXIT
- Modify the SQL command file created in step 1 so that it runs without error. Using an editor of your choosing:
- Replace all occurrences of 'SELECT'''||TABLE_NAME||''',COUNT(*)FROM'||TABLE_NAME||';' with --, which is the SQL comment line command. Below is a code snippet from such a file before making the change:
- Remove the top and bottom lines prefaced with 'SQL>'. Also remove 'no. of rows selected' from the bottom of the file.
'SELECT'''||TABLE_NAME||''',COUNT(*)FROM'||TABLE_NAME||';' -------------------------------------------------------------------------------- SELECT 'T_AV_ROLE_TYPES',COUNT(*) FROM T_AV_ROLE_TYPES; SELECT 'T_AV_VIOLATIONS',COUNT(*) FROM T_AV_VIOLATIONS; SELECT 'T_AV_ROLEVER_VIOLATIONS',COUNT(*) FROM T_AV_ROLEVER_VIOLATIONS; SELECT 'T_AV_USER_RULE_VIOLATIONS',COUNT(*) FROM T_AV_USER_RULE_VIOLATIONS; SELECT 'T_AV_EXEMPTIONS',COUNT(*) FROM T_AV_EXEMPTIONS; ...
- After making the change:
-- -------------------------------------------------------------------------------- SELECT 'T_AV_ROLE_TYPES',COUNT(*) FROM T_AV_ROLE_TYPES; SELECT 'T_AV_VIOLATIONS',COUNT(*) FROM T_AV_VIOLATIONS; SELECT 'T_AV_ROLEVER_VIOLATIONS',COUNT(*) FROM T_AV_ROLEVER_VIOLATIONS; SELECT 'T_AV_USER_RULE_VIOLATIONS',COUNT(*) FROM T_AV_USER_RULE_VIOLATIONS; SELECT 'T_AV_EXEMPTIONS',COUNT(*) FROM T_AV_EXEMPTIONS; ...
- Save the file.
- Execute the file:
$ sqlplus avuser/secret SQL> @<filename>
Related Articles
Overview of Public Database Schema Views in RSA Identity Governance & Lifecycle 180Number of Views Is it possible to deploy software token 3.0 to a Blackberry with content protection enabled? 10Number of Views The Account Changes table shows an error instead of account details when change request is initiated via Roles in RSA Via … 34Number of Views How to query a public database schema table for Segregation of Duties (SOD) violations in RSA Identity Governance & Lifecycle 122Number of Views How to create Oracle SQL profile for a SQL_ID query used in RSA Governance & Lifecycle 16Number of Views
Trending Articles
How to manipulate imported RSA SecurID Software Token(s) on an iPhone or iPad device Authentication Manager Security Console and Operations Console Inaccessible After Certificate Update RSA Authentication Manager 8.9 Patches and Hotfixes Readme RSA MFA Agent 2.5 for Microsoft Windows Installation and Administration Guide "No decryption codes were found in the zip file" error when decrypting RSA SecurID tokens
Don't see what you're looking for?