SELECT 'comment on table ' || a.table_name || ' is ' || '''' || a.comments || '''' || ';'
from user_tab_comments a
where a.table_type in ('TABLE', 'VIEW')
AND comments IS NOT NULL;
–导出、生成当前用户的所有表字段的注释
SELECT 'comment on column ' || t.table_name || '.' || t.column_name ||
' is ' || '''' || t1.comments || '''' || ';'
FROM User_Tab_Cols t, User_Col_Comments t1
WHERE t.TABLE_NAME = t1.table_name
AND t.column_name = t1.column_name
AND t1.comments IS NOT NULL;
1. 查看所有表空间大小
select tablespace_name,sum(bytes)/1024/1024 from dba_data_files
group by tablespace_name;
2. 未使用的表空间大小
select tablespace_name,sum(bytes)/1024/1024 from dba_free_space
group by tab