0% found this document useful (0 votes)
12 views1 page

PLS Note

Imp Note

Uploaded by

aribrabbani2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

PLS Note

Imp Note

Uploaded by

aribrabbani2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

select

blocking_session,
sid,
serial#,
wait_class,
seconds_in_wait
from
v$session
where
blocking_session is not NULL
order by
blocking_session;

SQL> SELECT name, username, EXPIRY_DATE


FROM dba_users, v$database
WHERE username = 'WCUSER';
2 3 WHERE username = 'ABCD';

SELECT
t.tablespace_name,
t.status,
t.contents,
t.extent_management,
t.segment_space_management,
ROUND((d.bytes / 1024 / 1024), 2) AS total_size_MB,
ROUND((d.bytes - NVL(f.bytes, 0)) / 1024 / 1024, 2) AS used_MB,
ROUND(NVL(f.bytes, 0) / 1024 / 1024, 2) AS free_MB,
ROUND(((d.bytes - NVL(f.bytes, 0)) / d.bytes) * 100, 2) AS used_percent
FROM
dba_tablespaces t
JOIN
(SELECT tablespace_name, SUM(bytes) AS bytes
FROM dba_data_files
GROUP BY tablespace_name) d
ON t.tablespace_name = d.tablespace_name
LEFT JOIN
(SELECT tablespace_name, SUM(bytes) AS bytes
FROM dba_free_space
GROUP BY tablespace_name) f
ON d.tablespace_name = f.tablespace_name
ORDER BY 1;

You might also like