SELECT B.TABLESPACE_NAME,
B.TOTAL_MB-NVL(A.FREE_MB,0) USED_MB, B.TOTAL_MB TOTAL_MB,
ROUND((B.TOTAL_MB-NVL(A.FREE_MB,0))/B.TOTAL_MB*100,2) USED_PERCENT,
B.TOTAL_ALLOCATE_MB+NVL(C.NONAUTO,0) MAX_ALLOCATE_MB,
NVL(B.TOTAL_ALLOCATE_MB,0) AUTO_MB,NVL(C.NONAUTO,0) NONAUTO_MB
FROM
(SELECT TABLESPACE_NAME,ROUND(SUM(BYTES)/1048576) FREE_MB
FROM DBA_FREE_SPACE GROUP BY TABLESPACE_NAME) A,
(SELECT TABLESPACE_NAME,ROUND(SUM(BYTES)/1048576) TOTAL_MB, ROUND(SUM(MAXBYTES)/1048576) TOTAL_ALLOCATE_MB
FROM DBA_DATA_FILES GROUP BY TABLESPACE_NAME) B,
(SELECT SUM(BYTES)/1048576 NONAUTO, TABLESPACE_NAME
FROM DBA_DATA_FILES
WHERE MAXBYTES ='0' GROUP BY TABLESPACE_NAME) C
WHERE A.TABLESPACE_NAME(+)=B.TABLESPACE_NAME
AND C.TABLESPACE_NAME(+)=B.TABLESPACE_NAME
AND B.TABLESPACE_NAME LIKE 'UNDO%'
ORDER BY USED_PERCENT DESC ;
TABLESPACE_NAME USED_MB TOTAL_MB USED_PERCENT MAX_ALLOCATE_MB AUTO_MB NONAUTO_MB
------------------------------ ---------- ---------- ------------ --------------- ---------- ----------
UNDOTBS1 3885 4100 94.76 4100 4100 0
UNDOTBS2 3138 4000 78.45 4000 4000 0
SELECT DISTINCT STATUS, SUM(BYTES)/1024/1024, COUNT(*)
FROM DBA_UNDO_EXTENTS GROUP BY STATUS;
STATUS SUM(MB)/1024/1024 COUNT(*)
--------- -------------------- ----------
UNEXPIRED 6654.5625 1531
EXPIRED 347.75 291
select
((select (nvl(sum(bytes),0))
from dba_undo_extents
where tablespace_name='UNDOTBS1'
and status in ('ACTIVE','UNEXPIRED')) *100) /
(select sum(bytes)
from dba_data_files
where tablespace_name='UNDOTBS1')
"PCT_INUSE"
from dual;
PCT_INUSE
----------
88.1295732
SQL> show parameter UNDO_RETENTION
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_retention integer 900
SELECT TO_CHAR(BEGIN_TIME, 'MM/DD/YYYY HH24:MI:SS') BEGIN_TIME,
TUNED_UNDORETENTION FROM V$UNDOSTAT;
alter tablespace undotbs1 retention guarantee;
alter tablespace undotbs1 retention noguarantee;
SQL> SELECT DISTINCT STATUS, SUM(BYTES)/1024/1024, COUNT(*)
2 FROM DBA_UNDO_EXTENTS GROUP BY STATUS;
STATUS SUM(BYTES)/1024/1024 COUNT(*)
--------- -------------------- ----------
UNEXPIRED 119.125 16
EXPIRED 6715.1875 1694
This command will commit the files in the staging area. If you haven't made any changes since the last commit (for example, if you executed this command immediately after the last commit), the snapsho...
At any stage, you are likely to want to undo some operations. Here, we will learn the basic tools you have done a few changes to undo. Note that some undo action is not reversible. This is one of the ...
Undo operation Write in front:Some undo operations are irreversible. This is one of the few places where previous work will be lost due to operational errors during the process of using Git. Modify th...
GIT study notes Modify management, cancel Manage changes Why Git is better than other versions of the control system design, because Git tracks and manages changes, not files. In other words, all modi...
Suppose now that you are changing a report, you added a line to readme.txt: My stupid boss still prefers SVN. Before you are ready to submit, you suddenly discovered that "stupid boss" may m...
Redo log Redo log is to ensure the durability of the transaction. To prevent dirty pages from being written to the disk at the point of failure, when restarting the mysql service, redo according to th...
Chapter content Filter, slice and match Find, match, and stipulate Use numerical flow such as numerical range Create a stream from multiple sources Unlimited flow Screening and slicing Filter with pre...
Install Virtual Machine Install Virtual Machine docker-machine create --engine-registry-mirror=https://nm7he5wc.mirror.aliyuncs.com -d virtualbox zdy View information docker info Set up shared folders...
Docker default installation location: /var/lib/docker 1. Mirror operation instructions 1.docker help|grep image: View all operation instructions related to mirroring in docker 2.docker search m...
Screening and slicing Filtering Filter with predicate-filter Filter different elements-de-duplication-distinct Truncated stream-limit Skip element-skip Map-map Apply function-map to each element in th...