Monday, August 24, 2009

Moved archive logs, what next...

If you had to urgently moved archive log files to different location to release space and allow users to login, you need then to backup them using rman. But of course rman will not see them automatically. This is what you need to do:

rman> catalog archivelog '/archivelogname';

rman> backup archivelog ... delete input;

Tuesday, August 04, 2009

Convert sql_id into hash_value

Suprise? Hash value can be easly calculated knowing sql_id:

select
lower(trim('&1')) sql_id
, trunc(mod(sum((instr('0123456789abcdfghjkmnpqrstuvwxyz',substr(lower(trim('&1')),level,1))-1)
*power(32,length(trim('&1'))-level)),power(2,32))) hash_value
from
dual
connect by
level <= length(trim('&1'))
/