-1. View the name and size of the Tablespace select T.tablespace_name, round (SUM (Bytes/(1024x768)), 0) Ts_sizefrom dba_tablespaces T, dba_data_file s Dwhere t.tablespace_name = D.tablespace_namegroup by t.tablespace_name;--2, view table space physical file name and size select Tablespace_name, File_id,file_name,round (Bytes/(1024x768), 0) Total_spacefrom Dba_data_filesorder by Tablespace_name;--3, View rollback segment Name and size select Segment_name,tablespace_name,r.status, (initial_extent/1024) initialextent, (next_extent/1024) Nextextent,max_extents,v.curext curextentfrom dba_rollback_segs R, v$rollstat vwhere r.segment_id = V.usn (+) ORDER by segment_name;--4, view Control file select name from v$controlfile;--5, view log file Select MEMBER from v$logfile;--6, view tablespace usage Select SUM (bytes)/(1024x768 * 1024x768) as free_space, Tablespace_namefrom dba_free_spacegroup by Tablespace_name; Select A.tablespace_name,a.bytes total,b.bytes used,c.bytes free, (b.bytes * +)/a.bytes "% used", (c.bytes * +)/A.B Ytes "% free" from Sys.sm$ts_avail A, sys.sm$ts_used B, Sys.sm$ts_free cwhere A.TABLESPAce_name = B.tablespace_nameand A.tablespace_name = c.tablespace_name;--7, view database library object Select Owner, object_type, status, COUNT (*) Count#from All_objectsgroup by Owner, Object_type, status;--8, view database version SELECT Versionfrom Product_component_ Versionwhere substr (product, 1, 6) = ' Oracle ';--9, view the date the database was created and how to archive select created, Log_mode, log_mode from V$database;
Querying table space and its utilization
Oracle View table space size and usage SQL statements