Home » RDBMS Server » Server Administration » Free space of database (Oracle 11g, Linux)
( ) 1 Vote
|
|
|
|
Re: Free space of database [message #618693 is a reply to message #618692] |
Mon, 14 July 2014 22:34   |
Database admin
Messages: 365 Registered: September 2006 Location: india
|
Senior Member |
 
|
|
Blackswan,
Sorry to say that as of now i am waiting to get access to all database servers for the account i recently joined.
Once i get access to servers i will provide you the output you requested.Right now i am helping my colleague to get
resolution for issue we are facing.
Regards,
Srini
[Updated on: Mon, 14 July 2014 22:34] Report message to a moderator
|
|
|
|
Re: Free space of database [message #618821 is a reply to message #618693] |
Tue, 15 July 2014 22:43   |
trantuananh24hg
Messages: 744 Registered: January 2007 Location: Ha Noi, Viet Nam
|
Senior Member |
|
|
Database admin wrote on Tue, 15 July 2014 03:34Blackswan,
Sorry to say that as of now i am waiting to get access to all database servers for the account i recently joined.
Once i get access to servers i will provide you the output you requested.Right now i am helping my colleague to get
resolution for issue we are facing.
Regards,
Srini
DA!
I do not make a definition about concept of Database Space but just call as Datafile Space. A Database includes physical files, some of them do not grown normally as datafile. Exactly, I do not care about their space, such as control file, spfile, ...
So, I make that term "How does datafile or subset datafile grow?", it's required to many thing, sometime, it's called as sizing.
First time, if you would like to measure tbs or datafile, simply, write a script by your self by access to fix-viwed dba_free_space, dba_extends/segments, ... Or if you can not, stay with my script:
SET LINESIZE 145
SET PAGESIZE 9999
SET VERIFY OFF
COLUMN tablespace FORMAT a18 HEADING 'Tablespace Name'
COLUMN filename FORMAT a50 HEADING 'Filename'
COLUMN filesize FORMAT 99,999,999,999 HEADING 'File Size'
COLUMN used FORMAT 99,999,999,999 HEADING 'Used (in bytes)'
COLUMN pct_used FORMAT 999 HEADING 'Pct. Used'
BREAK ON report
COMPUTE SUM OF filesize ON report
COMPUTE SUM OF used ON report
COMPUTE AVG OF pct_used ON report
SELECT /*+ ordered */
d.tablespace_name tablespace
, d.file_name filename
, d.file_id file_id
, d.bytes filesize
, NVL((d.bytes - s.bytes), d.bytes) used
, TRUNC(((NVL((d.bytes - s.bytes) , d.bytes)) / d.bytes) * 100) pct_used
FROM
sys.dba_data_files d
, v$datafile v
, ( select file_id, SUM(bytes) bytes
from sys.dba_free_space
GROUP BY file_id) s
WHERE
(s.file_id (+)= d.file_id)
AND (d.file_name = v.name)
UNION
SELECT
d.tablespace_name tablespace
, d.file_name filename
, d.file_id file_id
, d.bytes filesize
, NVL(t.bytes_cached, 0) used
, TRUNC((t.bytes_cached / d.bytes) * 100) pct_used
FROM
sys.dba_temp_files d
, v$temp_extent_pool t
, v$tempfile v
WHERE
(t.file_id (+)= d.file_id)
AND (d.file_id = v.file#)
ORDER BY 1
/
But, remember, the total of datafile maybe 31gb, maybe 15gb within 30gb resized, and you should not resize from 30 to 15gb, depend something like "the last block contains data" ...etc. And, so good to read Michel's link!!!
|
|
|
Re: Free space of database [message #618827 is a reply to message #618821] |
Tue, 15 July 2014 23:56   |
 |
suhasdba
Messages: 141 Registered: April 2013 Location: INDIA
|
Senior Member |
|
|
Hi trantuananh,
Your script looks good.Does output of your script produces sizes of used,free and data space of database ?
Sorry to post my question on others thread.Just curious to know the answer.So what posted my question here.
Regards,
Suhas
[Updated on: Wed, 16 July 2014 00:01] Report message to a moderator
|
|
|
Re: Free space of database [message #618829 is a reply to message #618827] |
Wed, 16 July 2014 00:13  |
 |
Michel Cadot
Messages: 68737 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Quote:Does output of your script produces sizes of used,free and data space of database ?
Why don't you read the query or, simpler, execute it?
|
|
|
Goto Forum:
Current Time: Sat Feb 22 21:37:48 CST 2025
|