查看数据库的SQL如何编程实现?
1、查看表空间的名称及大小set linesize 140;set pages 200;column tablespace_name format a30;select tablespace_name,min_extents,max_extents,pct_increase,status from dba_tablespaces;select tablespace_name,initial_extent,next_extent,contents,logging,extent_management,allocation_type from dba_tablespacesorder by t...全部
1、查看表空间的名称及大小set linesize 140;set pages 200;column tablespace_name format a30;select tablespace_name,min_extents,max_extents,pct_increase,status from dba_tablespaces;select tablespace_name,initial_extent,next_extent,contents,logging,extent_management,allocation_type from dba_tablespacesorder by tablespace_name;
2、查看表空间物理文件的名称及大小column db_block_size new_value blksz noprintselect value db_block_size from v$parameter where name='db_block_size';column tablespace_name format a16;column file_name format a60;set linesize 160;select file_name,round(bytes/(1024*1024),0) total_space,autoextensible,increment_by*&blksz/(1024*1024) as incement,maxbytes/(1024*1024) as maxsize from dba_data_files order by tablespace_name;
3、查看回滚段名称及大小COLUMN roll_name FORMAT a13 HEADING 'Rollback Name'COLUMN tablespace FORMAT a11 HEADING 'Tablspace'COLUMN in_extents FORMAT a20 HEADING 'Init/Next Extents'COLUMN m_extents FORMAT a10 HEADING 'Min/Max Extents'COLUMN status FORMAT a8 HEADING 'Status'COLUMN wraps FORMAT 999 HEADING 'Wraps' COLUMN shrinks FORMAT 999 HEADING 'Shrinks'COLUMN opt FORMAT 999,999,999 HEADING 'Opt。
Size'COLUMN bytes FORMAT 999,999,999 HEADING 'Bytes'COLUMN extents FORMAT 999 HEADING 'Extents'。
收起