Oracle : TableSpace Menu Bar in SecureCRT
Dear Readers, In this article, we will see TableSpace Menu Bar in SecureCRT . TBS_FREE :
|
1 2 3 |
set linesize 130 set pagesize 1000 col tablespace format a30 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
select tablespace_name tablespace, round(sum(a.total1)/1048576, 0) Total, round(sum(a.total1)/1048576, 0)-round(sum(a.sum1)/1048576, 0) used, round(sum(a.sum1)/1048576, 0) free, round(((sum(a.sum1)/1048576)/(sum(a.total1)/1048576))*100, 0) pct_free, round(sum(a.maxb)/1048576, 0) largest, max(a.cnt) fragment from (select tablespace_name, 0 total1, sum(bytes) sum1, max(bytes) MAXB, count(bytes) cnt from dba_free_space group by tablespace_name union select tablespace_name, sum(bytes) total1, 0, 0, 0 from dba_data_files group by tablespace_name) a group by a.tablespace_name order by 5 desc; |
Out Put :
|
1 2 3 4 5 6 |
TABLESPACE TOTAL USED FREE PCT_FREE LARGEST FRAGMENT ------------------------------ ---------- ---------- ---------- ---------- ---------- ---------- USERS 5 2 3 65 3 1 UNDOTBS1 60 24 36 59 25 13 SYSAUX 730 690 40 5 38 14 SYSTEM 800 792 8 1 8 2 |
TBS_FILE :
|
1 2 3 4 |
set linesize 130 set pagesize 1000 set echo on col file_name format a80 |
|
1 2 3 4 |
select file_id,file_name, bytes/1048576 mb,AUTOEXTENSIBLE,MAXBYTES/1024/1024/1024 MAX_BYTES_GB from dba_data_files where tablespace_name='&tbs' order by substr(file_name,length(file_name)-5,6); |
SEGMENTBYNAME :
|
1 2 3 4 5 6 7 8 9 10 11 |
set ver off set trimspool on set lines 199 col owner for a15 col segment_name for a30 col segment_type for a25 col tablespace_name for a22 set pagesize 150 col part_name for a30 compu sum of size_mb on report break on report skip 2 |
|
1 2 3 4 5 |
select owner, segment_name,partition_name part_name, buffer_pool, segment_type, tablespace_name, extents, round(bytes/1024/1024) size_mb from dba_segments where segment_name like upper('&segname'); |
DBSIZE :
|
1 2 3 4 |
select sum(bytes)/1024/1024/1024 GB from dba_segments; GB ---------- 1.46954346 |
|
1 2 3 4 |
select sum(bytes)/1024/1024/1024 GB from dba_data_files; GB ---------- 1.55761719 |
|
1 2 3 4 |
select sum(bytes)/1024/1024/1024 GB from dba_temp_files; GB ---------- .05859375 |
Seg_With_Highest_IO_Reads :
|
1 2 3 4 |
set pagesize 200 set linesize 300 col segment_name format a40 col owner format a10 |
|
1 2 3 4 5 6 7 |
select segment_name,object_type,total_physical_reads from ( select owner||'.'||object_name as segment_name,object_type, value as total_physical_reads from v$segment_statistics where statistic_name in ('physical reads') order by total_physical_reads desc) where rownum <=10; |
Out Put :
|
1 2 3 4 5 6 7 8 9 10 11 12 |
SEGMENT_NAME OBJECT_TYPE TOTAL_PHYSICAL_READS ---------------------------------------- ------------------ -------------------- SYS.REFCON$ TABLE 6665 SYS.OBJ$ TABLE 3057 SYS.TYPE$ TABLE 2728 SYS.SEG$ TABLE 2694 SYS.IDL_UB1$ TABLE 1803 SYS.I_OBJ5 INDEX 962 SYS.HISTGRM$ TABLE 958 SYS.I_OBJ1 INDEX 615 SYS.IDL_UB2$ TABLE 542 SYS.WRI$_OPTSTAT_HISTGRM_HISTORY TABLE PARTITION 462 |
Seg_With_Highest_IO_Writes :… Read More







