CalWin
  • Introduction
  • Code Snippets
  • Useful SQL statements
  • CalWin Script
    • Hardware Script
      • GetQty
      • DefineParts
      • WorkXXX
      • Script classes
        • TWorkWrapper
        • TFrameWrapper
        • TDividerWrapper
    • System script Events
      • OnAdjustStainLoad
      • OnAfterCalcItemRequirement
      • OnCalcPriceListAddition
      • OnCalcProductPurchaseDeliveryTime
      • OnCalcSalesHeaderAutoLineData
      • OnCalcSashLeadWeight
      • OnCheckFromSemiStock
      • OnCheckFromStock
      • OnCheckGlassFromStock
      • OnCheckProduct
      • OnCheckSalesheaderRules
      • OnCheckSaleslineDates
      • OnGetBatchGroup
      • OnGetClassification
      • OnGetDiscountGroup
      • OnGetElementProfile
      • OnGetLoadPoints
      • OnGetProductSourceAltParams
      • OnGetProductSourceParams
      • OnGetprofile (deprecated)
      • OnGetSaleslinesSourceParams
      • OnGetStockItemGroup
      • OnIncludeBottleneckLoad
      • OnIncludeCheckpoint
      • OnIsSpecialProduct
      • OnModifyEdgeList
      • OnModifyKickPlate
      • OnModifyVariants_Final
      • OnModifyVariants_Initial
      • OnSalesheaderPriceFinalization
      • OnSetElementJointType
      • OnSetSileDividersPos
      • OnSetTranMullDesignCode
      • OnSetTranMullDividersPos
      • Helper Procedure Repository
        • Loop ElementList
    • Machine Link
      • Machine Link Events
        • Initialize and Finalize
        • BeforeOptimization
        • PreParseMain_xxx
        • PostParseMain_xxx
        • ParseChild_xxx
        • BeforeOutput_xxx
      • How to use a search table in Machine Link
  • Brukerdokumentasjon (NOR)
    • Fullkostkalkyle
    • Bonus og markedsstøtte
    • CalWin enhet og faktor
    • Kalenderen
    • Budsjett
    • Eksport til Excel
    • Dokument-hÃ¥ndtering
  • Misc documentation
    • CalWin 64-bit Beta
    • CalWin E-Quote
    • CalWin WEB Dashboard
    • Oracle related
      • Oracle Database Server Requirements
      • Oracle DBA
        • Resize and rename data files
        • Arhivelog mode
        • LISTENER.ORA
        • Connection strings
        • Create Oracle user (schema) for CalWin
        • Create a database link
        • Password expiration
        • Add a Directory object
        • Show table space size
        • Recovery Area Space
        • ORA-00257 - not enough space in recovery file
    • CalWin Server
      • Legg til web certificate
Powered by GitBook
On this page

Was this helpful?

  1. Misc documentation
  2. Oracle related
  3. Oracle DBA

Show table space size

SQL script to check available and used size of table space

select
    tablespace_name,
    max(file_name) file_name,
    sum(allocated_bytes) allocated_bytes,
    sum(free_bytes) free_bytes,
    sum(gb_tildelt) gb_tildelt,
    sum(gb_ledig_av_tildelt) gb_ledig_av_tildelt,
    sum(gb_ledig_i_datafil) gb_ledig_i_datafil

from(
        select x.tablespace_name, x.file_name, x.allocated_bytes, x.free_bytes, x.gb_tildelt, x.gb_ledig_av_tildelt, x.gb_ledig_i_datafil from 
            (
                SELECT a.tablespace_name, a.file_name, a.bytes allocated_bytes, b.free_bytes,
                ROUND(GREATEST(bytes,maxbytes) / 1024/1024/1024,2) gb_tildelt,
                ROUND(b.free_bytes / 1024/1024/1024,2) gb_ledig_av_tildelt,
                ROUND((34358689792 - A.BYTES) / 1024/1024/1024,2) gb_LEDIG_i_datafil
                FROM dba_data_files a,
                (
                    SELECT file_id, SUM(bytes) free_bytes
                    FROM dba_free_space b
                    GROUP BY file_id 
                ) b
            WHERE a.file_id = b.file_id
            ) x
        ORDER BY tablespace_name, file_name
    )
        group by tablespace_name
ORDER BY tablespace_name, file_name
;
PreviousAdd a Directory objectNextRecovery Area Space

Last updated 3 years ago

Was this helpful?