查询oracle clob占用空间脚本

SELECT 'EDCRAWDATA' AS TABLE_NAME,
       SUM(size_gb) AS TOTAL_GB
  FROM (SELECT a.owner,
               a.table_name,
               a.column_name,
               b.segment_name,
               ROUND(b.BYTES / 1024 / 1024 / 1024) size_gb
          FROM dba_lobs     a,
               dba_segments b
         WHERE a.segment_name = b.segment_name
           AND a.owner = 'EOL'
           AND a.table_name = 'EDCRAWDATA'
        UNION ALL
        SELECT a.owner,
               a.table_name,
               a.column_name,
               b.segment_name,
               ROUND(b.BYTES / 1024 / 1024 / 1024) size_gb
          FROM dba_lobs     a,
               dba_segments b
         WHERE a.index_name = b.segment_name
           AND a.owner = 'EOL'
           AND a.table_name = 'EDCRAWDATA'
        UNION ALL
        SELECT A.owner,
               'EDCRAWDATA',
               'RAWDATA',
               A.segment_name,
               round(A.BYTES / 1024 / 1024 / 1024) size_gb
          FROM DBA_SEGMENTS A
         WHERE A.segment_name = 'EDCRAWDATA'
           AND A.owner = 'EOL')

查询导出进度:

SELECT s.sid,
       s.serial#,
       dj.state,
       dj.operation,
       ds.job_name,
       ds.session_type
  FROM v$session             s,
       dba_datapump_sessions ds,
       dba_datapump_jobs     dj
 WHERE s.SADDR = ds.saddr
   AND ds.job_name = dj.job_name;

你可能感兴趣的:(oracle,空间脚本)