Monthly Archives: October 2012

Timeout SQL materialized view refresh

Problem today where one hourly cron MV refresh hung (waiting on “SQL*Net message from dblink”), causing the other refreshes to queue up waiting on locks, eventually using up all the session so users got “ORA-00018: maximum number of sessions exceeded”

Posted in Uncategorized

Convert java dates to oracle sql dates (esp. odm_publicobject createdate)

Java dates are recorded in milliseconds after 01-Jan-1970 00:00:00 GMT. To convert these to oracle dates, use sql like: SELECT TO_DATE(’01-JAN-1970 00:00:00′,’DD-MON-YYYY HH24:MI:SS’) + createdate/(1000*60*60*24) createdate , creator FROM odm_publicobject WHERE TO_DATE(’01-JAN-1970 00:00:00′,’DD-MON-YYYY HH24:MI:SS’) + createdate/(1000*60*60*24) > sysdate – 30

Posted in Scripts

QR Code Tag create

http://createqrcode.appspot.com/ is good for creating QR Codes. Don’t use www.qrtag.net, because they redirect the URL to point at their own website.

Posted in Uncategorized

Atira Pure Research – List Users by last activity

List out users by last activity in Atira’s Pure Research Information System with: SELECT a.username , u.name_first_name forename , u.name_last_name surname , TRUNC ( MAX ( a.entry_date ) ) last_audit_entry FROM audit_entry a , users u WHERE a.username = u.username(+)

Posted in Uncategorized

Oracle regexp_replace remove non alpha ASCII

Replace everything that isn’t a standard ASCII alpha character with a space: SELECT REGEXP_REPLACE ( ‘xxXX € Ááé 123 %; test text æ¸¬è© ¦ “xmxmx” number²’ , ‘[^a-zA-Z]’ , ‘ ‘ ) FROM DUAL h/t Kok Yan Lo and jadarnel27

Posted in Scripts