Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create new tablespace oracle:
- ==============================
- create bigfile tablespace finance_data datafile '/u01/app/oracle/oradata/EE/finance_data_data01.dbf' size 50M autoextend on;
- list all tablespaces for Oracle 12c:
- ====================================
- SELECT substr(df.tablespace_name, 1, 20) "Tablespace Name",
- substr(df.file_name, 1, 80) "File Name",
- round(df.bytes / 1024 / 1024, 0) "Size (M)",
- decode(e.used_bytes, NULL, 0, round(e.used_bytes/1024/1024, 0)) "Used (M)",
- decode(f.free_bytes, NULL, 0, round(f.free_bytes/1024/1024, 0)) "Free (M)",
- decode(e.used_bytes, NULL, 0, round((e.used_bytes / df.bytes) * 100, 0)) "% Used"
- FROM dba_data_files df,
- (SELECT file_id, sum(bytes) used_bytes
- FROM dba_extents
- GROUP by file_id) E,
- (SELECT max(bytes) free_bytes, file_id
- FROM dba_free_space
- GROUP BY file_id) f
- WHERE e.file_id(+) = df.file_id
- AND df.file_id = f.file_id(+)
- ORDER BY df.tablespace_name, df.file_name;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement