Posts

MySQL: To find a table

  Contains a word: SHOW TABLES LIKE '%users%'; (Finds app_users , users_log , etc.) Starts with a word: SHOW TABLES LIKE 'wp_%'; (Finds tables starting with wp_ ) Ends with a word: SHOW TABLES LIKE '%_backup';     OR    SELECT table_name  FROM information_schema.tables  WHERE table_schema = 'your_database_name'    AND table_name LIKE '%your_name%'   AND table_type = 'BASE TABLE';     example: SELECT table_name FROM information_schema . tables WHERE table_schema = 'pmmtest'   AND table_name LIKE '%PARA%'   AND table_type = 'BASE TABLE' ;

Oracle: get row count of each table

 create table RWCNTS_AFTER_PUMUPGRADE_10282026 as select /*+ NO_INDEX */ table_name, get_rows( user||'.'||table_name) row_count from user_tables order by table_name

Postgres: To find the owner of a function and to change owner

  SELECT proname AS function_name , proowner :: regrole AS owner_name FROM pg_proc WHERE pronamespace :: regnamespace :: text = 'cpnadmin' ; ALTER FUNCTION cpnadmin . assign_coupon_batch OWNER TO cpnadmin ;

KABA: listening connector

Image
  http://hrtestib.tmw.com/PSIGW/HttpListeningConnector http://hrprod92ib.tmw.com/PSIGW/HttpListeningConnector

Oracle: Track TEMP size

 SELECT sysdate,a.username, a.sid, a.serial#, a.osuser,  (b.blocks*d.block_size)/1048576 MB_used, c.sql_text FROM v$session a, v$tempseg_usage b, v$sqlarea c,      (select block_size from dba_tablespaces where tablespace_name='TEMP02') d     WHERE b.tablespace = 'TEMP02'     and a.saddr = b.session_addr     AND c.address= a.sql_address     AND c.hash_value = a.sql_hash_value     AND (b.blocks*d.block_size)/1048576 > 1024     ORDER BY b.tablespace, 6 desc;

Oracle: To find COBOL version

 psoft-psfsps601.tmw.com:fsprod:/opt/lib/visualcobol/bin> cob -V version @(#)cob.c       6.0.0.84 PRN=KXCRH/AAD:Ao.U4.13.04 PTI=32/64 bit PTI=Micro Focus Visual COBOL Development Hub 6.0 - Patch Update 02 PTI=Patch Update 02 PTI=pkg_264847 PTI=MFInstaller I see no work (see `cob -?' for help)