Moneycontrol Brokerage Recos

Monday, May 21, 2012

Database object and it's corresponsing datafiles, owner, tablespace

Here you could find which database object is located in which datafile of it's tablespace and it's owner, object name, object type and it's respective size:

SQL> select t.ts#, t.name as Tablespace_name, d.name as Datafile, s.owner, s.segment_name, s.segment_type, s.bytes/1024/1024 as "MB"
from v$tablespace t, v$datafile d, dba_segments s
where t.ts#=d.ts#
and t.name=s.tablespace_name
and s.owner='SCOTT';
TS# TS_NAME DATAFILE                                  OWNER  SEGMENT_NAME SEGMENT_TYPE Size(MB)
--- ------ ------------------------------------------ ------ ------------ ------------ ----------
4 USERS    E:\APP\RAJKUMAR\ORADATA\ORCL\USERS01.DBF SCOTT  DEPT         TABLE        .0625
4 USERS    E:\APP\RAJKUMARN\ORADATA\ORCL\USERS01.DBF SCOTT  EMP          TABLE        .0625
4 USERS    E:\APP\RAJKUMAR\ORADATA\ORCL\USERS01.DBF SCOTT  PK_EMP       INDEX        .0625
4 USERS    E:\APP\RAJKUMAR\ORADATA\ORCL\USERS01.DBF SCOTT  PK_DEPT      INDEX        .0625
4 USERS    E:\APP\RAJKUMAR\ORADATA\ORCL\USERS01.DBF SCOTT  SALGRADE     TABLE        .0625
SQL>

No comments:

Post a Comment