Home » RDBMS Server » Server Administration » number of allocated extents of a tablespace
number of allocated extents of a tablespace [message #60802] Sun, 07 March 2004 20:12 Go to next message
Vaibhav
Messages: 13
Registered: April 2001
Junior Member
Hi !

How do we find the the number of allocated extents of a tablespace.

DBA_EXTENTS will give the no to extents allocated to a table,but where do we find information about the allocated extents of a tablespace.

 

Thanks in advance

Vaibhav

 
Re: number of allocated extents of a tablespace [message #60811 is a reply to message #60802] Mon, 08 March 2004 03:57 Go to previous messageGo to next message
Frank Naude
Messages: 4580
Registered: April 1998
Senior Member
Try the following query:

SQL> SELECT file_id, block_id, bytes, owner, segment_name
  2  FROM   dba_extents
  3  WHERE  tablespace_name = 'USERS'
  4  UNION ALL
  5  SELECT file_id, block_id, bytes, 'FREE', 'SPACE'
  6  FROM   dba_free_space
  7  WHERE  tablespace_name = 'USERS'
  8  /

   FILE_ID   BLOCK_ID      BYTES OWNER    SEGMENT_NAME
---------- ---------- ---------- -------- ------------------------------
         4          9      65536 SCOTT    DEPT
         4         25      65536 SCOTT    EMP
         4         41      65536 SCOTT    BONUS
         4         49      65536 SCOTT    SALGRADE
...
         4        369    2228224 FREE     SPACE


Best regards.

Frank
Re: number of allocated extents of a tablespace [message #60830 is a reply to message #60811] Tue, 09 March 2004 05:49 Go to previous messageGo to next message
Vaibhav
Messages: 13
Registered: April 2001
Junior Member
Hi Frank !
Thanks a for the information.
Also, can u let me know

1>Does the size of a Tablespace depend on the MaxExtents value specified in the storage clause during Tablespace creation.

Regards,

Vaibhav
Re: number of allocated extents of a tablespace [message #60851 is a reply to message #60830] Wed, 10 March 2004 01:47 Go to previous message
Frank Naude
Messages: 4580
Registered: April 1998
Senior Member
Hi,

No, "maxextents" is only a default value that will be used when createing segments (tables, indexes, etc.) in the tablespace.

According to the SQL Reference Guide:

"MAXEXTENTS: Specify the total number of extents, including the first, that Oracle can allocate for the object. The minimum value is 1 (except for rollback segments, which always have a minimum value of 2). The default value depends on your data block size."

Best regards.

Frank
Previous Topic: ORA:12203
Next Topic: find months between two date
Goto Forum:
  


Current Time: Fri Sep 20 12:28:30 CDT 2024