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)

ORA: ORA-19809: limit exceeded for recovery files

 released channel: aux1 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of Duplicate Db command at 01/24/2016 13:31:46 RMAN-05501: aborting duplication of target database RMAN-03015: error occurred in stored script Memory Script RMAN-06136: ORACLE error from auxiliary database: ORA-19809: limit exceeded for recovery files ORA-19804: cannot reclaim 512000000 bytes disk space from 2147483648 limit SQL> alter database open resetlogs; alter database open resetlogs * ERROR at line 1: ORA-00392: log 18 of thread 1 is being cleared, operation not allowed ORA-00312: online log 18 thread 1: '/usr/opt/app/oracle/admin/hrcnv1/flash01/HRCNV1/onlinelog/o1_mf_18_%u_.log' SQL> alter database clear unarchived logfile group 18; Database altered. SQL> alter database open resetlogs; alter database open ...