- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to find the free space in a tablespace
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-29-2001 03:16 AM
тАО08-29-2001 03:16 AM
How to find the free space in a tablespace
Using sql scripts, how can I find the free space and occupied space in bytes (or MB) in a tablespace (NOT the extents free and used)? I would appreciate any pointers to this.
Thanks,
Vinu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-29-2001 03:41 AM
тАО08-29-2001 03:41 AM
Re: How to find the free space in a tablespace
on one side you have unallocated extents in your tablespace which can be used for anything you want (ref. dba_free_space).
On the other side you have tables with extents allocated which are filled up or still free. Compute statistics for the table and check empty_blocks in user_tables (or dba_tables).
good luck,
Thierry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-29-2001 07:22 AM
тАО08-29-2001 07:22 AM
Re: How to find the free space in a tablespace
Try this
SELECT f.tablespace_name, SUM(f.bytes)/(1024*1024) "Free (MB)",
Total_MB
FROM sys.dba_free_space f,
(select TABLESPACE_NAME, sum(BYTES)/(1024*1024) Total_MB
from dba_data_files
group by TABLESPACE_NAME
) d
where f.tablespace_name=d.tablespace_name
GROUP BY f.tablespace_name, d.Total_MB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-29-2001 11:48 AM
тАО08-29-2001 11:48 AM
Re: How to find the free space in a tablespace
select tablespace_name,count(bytes),sum(bytes) from dba_free_space group by tablespace_name;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-30-2001 01:56 AM
тАО08-30-2001 01:56 AM
Re: How to find the free space in a tablespace
select tablespace_name,
round(sum(bytes)/(1024*1024),1) free,
max(round(bytes/(1024*1024),1)) largest
from dba_free_space
group by tablespace_name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-31-2001 12:16 AM
тАО08-31-2001 12:16 AM
Re: How to find the free space in a tablespace
My first select was more or less like statistical select,
but if we talking about fragmentation then you
must check your db extents also:
select owner,segment_name, next_extent, s.tablespace_name,max_free_bytes
from sys.dba_segments s,
(select tablespace_name,max(bytes) max_free_bytes
from sys.dba_free_space
group by tablespace_name) f
where s.next_extent > f.max_free_bytes
and s.tablespace_name=f.tablespace_name
If you receive any rows then trouble is waiting for you.
Could be next help you:
alter tablespace tablespace_name coalesce
tablespace_name is the same what you receive before.