Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Help with query
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Chuck wrote:
> I'm trying to come up with a query of v$undostat that will show the
> total # of undo blocks used during any two hour period. The output
> should look like this..
>
> begin_time end_time undoblks
> ========== =========== ===========
> 09:00 11:00 123
> 09:10 11:10 145
> 09:20 11:20 1032
>
> You get the picture. It's essentially the same thing that "Select
> begin_time, end_time, undoblks from v$undostat" would show if each row
> was 2 hours apart instead of 10 minutes apart.
>
> TIA
Never mind. Figured it out.
SELECT a.begin_time,
SUM (b.undoblks)*8/ 1024 undo_mb FROM v$undostat a JOIN v$undostat b
ON b.begin_time >= a.begin_time AND b.begin_time < a.begin_time + 2 / 24GROUP BY a.begin_time
iEYEARECAAYFAkV4VXwACgkQzIf+rZpn0oSeeQCbBr6dojuZf+FsX7exIJShTT8J
FLQAoJ7jwKELAotVA0Y42Azx1skVIlwM
=xPf4
-----END PGP SIGNATURE-----
Received on Thu Dec 07 2006 - 11:55:08 CST