Monday, October 23, 2017

Query to List all Empty Tables

  SELECT    'select '''
         || owner
         || ''' owner,'''
         || table_name
         || ''' table_name  '
         || CHR (10)
         || 'FROM '
         || owner
         || '.'
         || table_name
         || ' where rownum<2 having count(*)=0; '
            sql
    FROM all_tables
   WHERE     owner NOT IN ('SYS',
                           'SYSTEM',
                           'OUTLN',
                           'WMSYS')
         AND SUBSTR (owner, 1, 4) <> 'OPS$'
ORDER BY 1;

No comments:

Post a Comment

Query to get the Concurrent Program along with Value Set details

SELECT fcpl1.user_concurrent_program_name       ,fdfcuv.end_user_column_name       ,ffvs.flex_value_set_name value_set_name       ,ffvt.appl...