How to monitor the current situation of oracle database tables and tablespaces declareunfnumber; unfbnumber; fs1number; fs1bnumber; fs2number; fs2bnumber; fs3number; fs3bnumber; fs4number; fs4bnumber; fullnumber; fullbnumber
How to monitor the current situation of oracle database tables and tablespaces declare unf number; unfb number; fs1 number; fs1b number; fs2 number; fs2b number; fs3 number; fs3b number; fs4 number; fs4b number; full number; fullb number; begin dbms_space.space_usage ('1', '2', 'ta
How to monitor the current situation of oracle database tables and tablespaces
Declare
Unf number;
Unfb number;
Fs1 number;
Fs1b number;
Fs2 number;
Fs2b number;
Fs3 number;
Fs3b number;
Fs4 number;
Fs4b number;
Full number;
Fullb number;
Begin
Dbms_space.space_usage ('& 1 ',
'& 2 ',
'Table ',
Unf,
Unfb,
Fs1,
Fs1b,
Fs2,
Fs2b,
Fs3,
Fs3b,
Fs4,
Fs4b,
Full,
Fullb );
Dbms_output.put_line ('unformatted _ blocks: '| unf );
Dbms_output.put_line ('full _ blocks (0% free): '| full );
Dbms_output.put_line ('fs1 _ blocks (0-25% free): '| fs1 );
Dbms_output.put_line ('fs2 _ blocks (25-50% free): '| fs2 );
Dbms_output.put_line ('fs3 _ blocks (50-75% free): '| fs3 );
Dbms_output.put_line ('fs4 _ blocks (75-100% free): '| fs4 );
End;
/
2. Use history of the tablespace (only the first statistical result of the day is output)
Select B. name,
A. rtime,
A. tablespace_usedsize,
A. tablespace_size,
Round (100 * a. tablespace_usedsize/a. tablespace_size) used_percent
From dba_hist_tbspc_space_usage,
(Select t2.name,
Min (rtime) rtime,
Min (tablespace_id) tablespace_id
From dba_hist_tbspc_space_usage t1
Inner join v $ tablespace t2 on t1.tablespace _ id = t2.TS #
Where t2.NAME = upper ('& 1 ')
Group by name, substr (rtime, 1, 10)
) B
Where a. tablespace_id = B. tablespace_id
And a. rtime = B. rtime
Order by a. rtime;
3. Prediction of the table's remaining space
Select * from table (dbms_space.OBJECT_GROWTH_TREND ('ecc _ CC', 'tkc _ ORDERRELEVANCE ', 'table ')
,