how do see how much space is used and free in a tablespace
Answer Posted / mohapatra.gouranga@gmail.com
Best ans is:
SELECT df.tablespace_name "Tablespace",
df.bytes / (1024 * 1024) "Size (MB)",
SUM(fs.bytes) / (1024 * 1024) "Free (MB)",
Nvl(Round(SUM(fs.bytes) * 100 / df.bytes),1) "%
Free",
Round((df.bytes - SUM(fs.bytes)) * 100 /
df.bytes) "% Used"
FROM dba_free_space fs,
(SELECT tablespace_name,SUM(bytes) bytes
FROM dba_data_files
GROUP BY tablespace_name) df
WHERE fs.tablespace_name (+) = df.tablespace_name
GROUP BY df.tablespace_name,df.bytes
UNION ALL
SELECT df.tablespace_name tspace,
fs.bytes / (1024 * 1024),
SUM(df.bytes_free) / (1024 * 1024),
Nvl(Round((SUM(fs.bytes) - df.bytes_used) * 100 /
fs.bytes), 1),
Round((SUM(fs.bytes) - df.bytes_free) * 100 /
fs.bytes)
FROM dba_temp_files fs,
(SELECT tablespace_name,bytes_free,bytes_used
FROM v$temp_space_header
GROUP BY tablespace_name,bytes_free,bytes_used) df
WHERE fs.tablespace_name (+) = df.tablespace_name
GROUP BY
df.tablespace_name,fs.bytes,df.bytes_free,df.bytes_used
ORDER BY 4 DESC;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How do you trace the traffic hitting a sql server? : sql server DBA
What types of replication are supported in sql server? : sql server DBA
how can you communicate with operating system files from oracle?
how can you process messages in order asynchronously?
what functionality does oracle provide to secure sensitive information?
Oracle client is not able to connect to Oracle server although tnsnames.ora file has valid enteries. Oracle error message is “ cannot resolve net service name”. Mention any three reasons.
What view(s) do you use to associate a user's SQLPLUS session with his o/s process?
What is dcl? : sql server DBA
how can you find out if a table can be redefined?
What is transparent data encryption? : sql server DBA
Due to some maintenance being done, the sql server on a failover cluster needs to be brought down. How do you bring the sql server down? : sql server DBA
Why would you use sql agent? : sql server DBA
I got an error SQL1042C. An unexpected system error occurred. Explanation: A system error occurred. One possible reason for this error is that the database manager is not installed correctly or the environment is not set up correctly. On OS/2, while trying to start the database manager, a very common reason for this error is a corrupted NET.ACC file. The command cannot be processed. The tables and views would not be opened. What is the way to open the dataase? pls help me
which background process invoke at the time of upgradation tell me???
How to craeate the New Database Schema in Oracle and mysql? Please tell me with Example?