How to check the size of the tablespace by query?

How to check the size of the tablespace by query?

Run this query...

SELECT
A.tablespace_name 'space ',.
A.bytes / (1024 * 1024) "Total_Size (MB).
Sum (B.bytes) / (1024 * 1024) "free_space (MB).
NVL (Round (Sum (B.bytes) * 100 / A.bytes), 1) "%Free."
Round ((A.bytes - SUM (B.bytes)) * 100/A.bytes) '% Used_Space '.
FROM dba_free_space B,.
(SELECT tablespace_name, SUM (bytes) bytes
FROM dba_data_files
A GROUP BY nom_tablespace)
WHERE B.tablespace_name (+) = A.tablespace_name
GROUP OF A.tablespace_name, A.bytes
UNION ALL
SELECT
A.tablespace_name 'space ',.
B.bytes / (1024 * 1024) "Total_Size (MB).
Sum (A.bytes_free) / (1024 * 1024) "free_space (MB).
NVL (Round ((Sum (B.bytes) - A.bytes_used) * 100 / B.bytes), 1) "%Free."
Round ((Sum (B.bytes) - A.bytes_free) * 100 / B.bytes) '% Used_Space '.
FROM dba_temp_files B,.
(SELECT tablespace_name, bytes_free, bytes_used
V $ temp_space_header
GROUP BY tablespace_name, bytes_free, bytes_used) has
WHERE B.tablespace_name (+) = A.tablespace_name
GROUP OF A.tablespace_name, B.bytes, A.bytes_free, A.bytes_used
ORDER BY DESC 4;

Tags: Database

Similar Questions

  • How to check the performance of query via the command sqlplus prompt

    Hello

    I work in the production environment, I want to check the performance of the queries in a production environment, we have no specific tools such as the expliin plan, TK Proff.

    I need chek performnce of sqlplus command line query

    Please let me know the process of query tuning of sqlplus command promt

    Here to explain plan:

    SQL> explain plan for
      2  select * from employees where employee_id = 170;
    
    Explained.
    
    SQL> select * from table(dbms_xplan.display());
    
    PLAN_TABLE_OUTPUT
    -----------------------------------------------------------------------------------------------
    Plan hash value: 1833546154
    
    ---------------------------------------------------------------------------------------------
    | Id  | Operation                   | Name          | Rows  | Bytes | Cost (%CPU)| Time     |
    ---------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT            |               |     1 |    69 |     1   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| EMPLOYEES     |     1 |    69 |     1   (0)| 00:00:01 |
    |*  2 |   INDEX UNIQUE SCAN         | EMP_EMP_ID_PK |     1 |       |     0   (0)| 00:00:01 |
    ---------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       2 - access("EMPLOYEE_ID"=170)
    

    You can also use autotrace, which is super easy:

    SQL> set autotrace on
    SQL> select * from emp;
    
                   EMPNO ENAME      JOB                        MGR HIREDATE
    -------------------- ---------- --------- -------------------- --------------------
                    7369 SMITH      CLERK                     7902 17-DEC-1980 00:00:00
                    7499 ALLEN      SALESMAN                  7698 20-FEB-1981 00:00:00
                    7521 WARD       SALESMAN                  7698 22-FEB-1981 00:00:00
                    7566 JONES      MANAGER                   7839 02-APR-1981 00:00:00
                    7654 MARTIN     SALESMAN                  7698 28-SEP-1981 00:00:00
                    7698 BLAKE      MANAGER                   7839 01-MAY-1981 00:00:00
                    7782 CLARK      MANAGER                   7839 09-JUN-1981 00:00:00
                    7788 SCOTT      ANALYST                   7566 19-APR-1987 00:00:00
                    7839 KING       PRESIDENT                      17-NOV-1981 00:00:00
                    7844 TURNER     SALESMAN                  7698 08-SEP-1981 00:00:00
                    7876 ADAMS      CLERK                     7788 23-MAY-1987 00:00:00
                    7900 JAMES      CLERK                     7698 03-DEC-1981 00:00:00
                    7902 FORD       ANALYST                   7566 03-DEC-1981 00:00:00
                    7934 MILLER     CLERK                     7782 23-JAN-1982 00:00:00
    
    14 rows selected.
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 3956160932
    
    --------------------------------------------------------------------------
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------
    |   0 | SELECT STATEMENT  |      |    14 |   532 |     3   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| EMP  |    14 |   532 |     3   (0)| 00:00:01 |
    --------------------------------------------------------------------------
    
    Statistics
    ----------------------------------------------------------
            480  recursive calls
              0  db block gets
             92  consistent gets
              9  physical reads
              0  redo size
           1630  bytes sent via SQL*Net to client
            520  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              7  sorts (memory)
              0  sorts (disk)
             14  rows processed
    

    This guide has lots of good info:
    http://docs.Oracle.com/CD/B19306_01/server.102/b14211/TOC.htm

  • How to check the value of the space of the tablespaces and tables when errors occur?

    Hi Experts,

    For example, lets say we get ORA-01653: unable to extend table of error. How to check the size of the table and a tablespace? And how understanding is full?

    Thanks for your help

    Hello

    Select df.tablespace_name "Tablespace"

    totalusedspace 'Used MB',

    (df.totalspace - tu.totalusedspace) "MB free.

    DF. TotalSpace 'Total MB. "

    round (100 * ((df.totalspace-tu.totalusedspace) / df.totalspace))

    "PCT free."

    Of

    (select nom_tablespace,

    Round (Sum (bytes) / 1048576) TotalSpace

    from dba_data_files

    Group by tablespace_name) df,.

    (select round (sum (bytes) /(1024*1024)) totalusedspace, nom_tablespace)

    from dba_segments

    you group by tablespace_name)

    where df.tablespace_name = tu.tablespace_name

    and df.tablespace_name = "";

    For example, lets say we get ORA-01653: unable to extend table of error. How to check the size of the table and a tablespace? And how understanding is full?

    Is to say clearly to the question (you can let us know what you have understood so we can fix)

    [oracle@machine1 ~] $01653 oerr ora

    01653, 00000, "impossible to extend %s.%s table by %s in %s tablespace»

    * Cause: Failed to allocate a certain measure the required number of blocks for

    a segment of the table in the specified tablespace.

    * Action: Use ALTER TABLESPACE ADD DATAFILE statement to add one or more

    storage of files indicate.

    -Thank you

    Pavan Kumar N

  • How to check the size of the file to a text file.

    How to check the size of the file to a text file.

    Please explain to me.

    I'm new in LabVIEW. and have no idea about that...;

    Hi prashant,

    go to the file e/s palette and then the advanced palette which is a search palletteand sub getfilesize.vi... but this function gives the result in bytes...

    Thank you and best regards,

    srikrishnaNF

  • How to check the size of/var/tmp local partition in esxi5

    Hello

    I'm trying to run command vm-support with / tmp to empty the log in / tmp, but unable to do so because of the issue of space in /tmp/...when I run the df-h command, I can see that the local data store is to have 10 GB of free space but I can't see/tmp/var partition size seperatety. Please see attached wink. Could u pl I want to know how to check the size/var/tmp.

    Thank you.TMP.jpg

    How can we check that ESXi is running for RAMDISK and all their disadvantage of this.

    There is no way to 'check', he always does. Hard drive actually leave data partitions vfat see you with df - h.

    It takes that data and creates a virtual disk it uses for execution.

  • How to check the file for the virtual machine size Esxi shell

    Anyone who can tell me how to check the file for the virtual machine size Esxi Shell. I tried this command-h ls but does not work.

    Have you checked "ls-lh', it will provide information as the attached screenshot." "

  • How to check the status of the import in Windows?

    Hello

    Import runs in my box of Wndows. The log file is not updated since long. How to check the status of the import job? FYI its oracle 10g.

    And I checked the database which.

    FYI
    ===
    Select * from DBA_DATAPUMP_SESSIONS;

    no selected line.

    Select * from DBA_JOBS_RUNNING;

    no selected line


    Select the username, machine, module, sid, State, event, seq #, session seconds_in_wait $ v where type <>'IMPORT' and username = "AUTOTIME";

    no selected line



    Please let me know.

    You actually look at the session of $ v and check the status of the session that is created by the import job.

    Sometimes the underlying tablespace is full, so import session just hangs, it must increase the size of the storage space.

    You should also look at alert.log file and see if there is any error message like "cannot extend table space '.

  • How to check the amount/number of issued on the database DDL operations

    Hello

    Can someone please clear some doubts.

    1. How can we check the number of DDL operations on the database

    2. how we check the amount of growth in the size of the database.

    3. How can we check the growth of a single table.

    Concerning
    Amith

    Select startup_time "Startup."
    MySQL 'Transactions. "
    /Decode (value) sum (Sum (trunc(sysdate-STARTUP_TIME)), 0.1, Sum (trunc(sysdate-STARTUP_TIME))) "Avg per day."
    /Decode (value) sum (Sum (trunc(sysdate-STARTUP_TIME)), 0.1, Sum (trunc(sysdate-STARTUP_TIME))) / 24 ' Avg / hour. "
    /Decode (value) sum (Sum (trunc(sysdate-STARTUP_TIME)), 0.1, Sum (trunc(sysdate-STARTUP_TIME))) / 1440 "Avg / min.
    v $ sysstat, instance $v
    WHERE name in (a "user is committed," restores user)
    Startup_time group;

  • How to check the backup?

    Hi, we take each backup to hot day and export the backup via scripts?...

    export backup we can check by using the log file, he succeeded...
    But how to check the backup to hot or cold backup is successfully completed?

    Help, please...

    Published by: user10745179 on February 24, 2010 03:39

    Hello

    CHCK the size of the backup in the backup location...

    Kind regards
    Deepak

  • How to find the tablespace that has maxsize UNLIMITED?

    Oracle 9.2
    I'm looking for tablespaces that maxsize UNLIMITED in the dictionary dba_xxxx from view. I want to use SQL to find storage space is not UNLIMTED file. I can't find which table dictionary or what column to indicate what storage space isn't UNLIMITED file?

    Please throw some lights.
    Thank you
    S.

    See Note 468096.1 How to check the CanGrow data files the Maxsize unlimited value.
    Oracle limit the number of blocks in a file of data to approximately * 4 million blocks *, so you can run:
    Select file_name in dba_data_files where maxblocks = 4194302;

    HTH

    Enrique

    Published by: Enrique Orbegozo on October 13, 2008 12:10

  • Anyone know how to check the date of warranty until when?

    Anyone know how to check the date of warranty until when?

    https://checkcoverage.Apple.com/Jo/en/;JSESSIONID=9pJ0X9pFPJtNg3c44yDGCvk9pVpt5l QSgn4B60y4Skv1WfmnqMkF!-1840326800

  • How to check the balance on the gift card itunes

    How to check the balance on the gift card itunes

    Redeem it

  • Satellite A200 - how to check the temperature of the processor fan?

    Hi all

    I have a Satellite A200 that my teenagers use a little, or abuse a little! Recently, it would not start up. I suspect the fan and pulled out the fan cleaned and tested the fan on a PSU, worked out well. He put it back together, ran startup repair and now the computer is operating normally. The fan is however not appear to come at all. In the Device Manager it tells me it works very well. I'm all good with the mechanical side of the House, but I'm a quamby operating system! How to check the temp CPU or fan?

    Thought that replace the fan but don't want to go that far just to get no results. Currently using the vacuum on low like an external fan and didn't want to just run the laptop with no cooling for fear of permanent damage. Although children watch movies with her on their doona may have already reached this!

    Any advice would be appreciated.

    Hey mate,

    How to clean the fan exactly? It s advisable to use the jet of compressed air. This could blow the dust of fans cooling and, therefore, it of not necessary to disassemble the laptop.

    In addition if the fan doesn't work anymore it of necessary to replace. You can order spare parts at an authorized service provider.

  • How to check the print queue in Windows 8

    Difficulty controlling the queue with your new Windows 8? Here's a great video on how to do it:

    Hope this helps to understand how to check the print queue in Windows 8. If you have problems, let me know, I'll see what I can do to help.

  • HP Photosmart 7525: How to check the version of the firmware of the HP PhotoSmart 7525 is up-to-date?

    How to check the version of the firmware of the HP Photosmart 7525 is up-to-date? And where can I go to download the latest firmware?

    Hello

    Follow these steps to check the update of firmware for your printer:

    http://support.HP.com/us-en/product/HP-Photosmart-7520-e-all-in-one-printer-series/5199461/model/5286642/document/c03312867/

    Note: the printer must be connected to your network to check the updates, if it is connected with a USB key follow the steps in the tehse to connect the * beep * to your wireless network:

    1. In the wireless menu, tap Settings.

Maybe you are looking for

  • My Firefox has lost all the standard tabs and search is no longer using Google?

    Today, my former excellent Firefox all lost it's memory. My standard tabs in the top bar are all gone. He constantly only to search in Yahoo, I hate. I want to like it was yesterday. I want that all my tabs back and I want it to look using Google. I

  • How to request the pdf to open it with adobe web code plugin

    Hello, I have a pdf hosted on my site that I can't change. It does not appear in FF built in PDF preview, it crashes just with a circle of rotation being displayed. If I force FF using the software Adobe Reader (or Adobe DC or what they call it now)

  • Links to files such as PDF files won't open

    When I click on a link to a file as a PDF file, I see a momentary large green arrow top right of the screen and that's all that happens. I have to go to my download folder to search for the file. The file used to open, that is what I want it to do. I

  • Satellite P10-304 combo DVD drive replacement

    I need to know what combo dvd/cd-rw are compatible with my p10-304. It came with a sd-r2412, but it does not read DVDs more. I'm trying to get a replacement, but I must be sure that it will fit and work. can someone give me a hand? Thank you [Edited

  • Cannot install the express updates

    Hello I tried several times to download the express updates and still get the same message: Some updates could not be installed: Update security for Windows XP (KB971486)Microsoft .NET Framework 1.1 Service Pack 1 update security for Windows 2000, Wi