Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
tpt-oracle/bclass.sql
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
22 lines (19 sloc)
795 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Copyright 2018 Tanel Poder. All rights reserved. More info at http://tanelpoder.com | |
-- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms & conditions. | |
-- blcass.sql by Tanel Poder (http://blog.tanelpoder.com) | |
-- | |
-- Usage: @bclass <block_class#> | |
--with undostart as (select r from (select rownum r, class from v$waitstat) where class = 'undo header') | |
select class, r undo_segment_id from ( | |
select class, null r | |
from (select class, rownum r from v$waitstat) | |
where r = bitand(&1,to_number('FFFF','XXXX')) | |
union all | |
select | |
decode(mod(bitand(&1,to_number('FFFF','XXXX')) - 17,2),0,'undo header',1,'undo data', 'error') type | |
, trunc((bitand(&1,to_number('FFFF','XXXX')) - 17)/2) undoseg_id | |
from | |
dual | |
) | |
where rownum = 1 | |
/ |