例如:我现在有一个表空间的名称为:SSPATBS,我现在想要查看该表空间的相关信息,应该怎么写SQL语句

解决方案 »

  1.   

    select * from dba_objects where tablespace_name = 'SSPATBS'
      

  2.   

    本人的数据库是ORACLE10g的在dba_objects中找不到tablespace_name这个字段名称嘛。
      

  3.   

    select * from user_tablespaces where tablespace_name = 'SSPATBS'
      

  4.   

    select * from user_tablespaces where tablespace_name = 'SSPATBS'
    这个可以SQL> conn scott/tiger
    已连接。
    SQL> ed
    已写入 file afiedt.buf  1* select * from user_tablespaces where TABLESPACE_name = upper('system')
    SQL> /TABLESPACE_NAME                BLOCK_SIZE INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS
     MAX_EXTENTS
    ------------------------------ ---------- -------------- ----------- -----------
     -----------
    PCT_INCREASE MIN_EXTLEN STATUS    CONTENTS  LOGGING   FOR EXTENT_MAN ALLOCATIO S
    EGMEN DEF_TAB_
    ------------ ---------- --------- --------- --------- --- ---------- --------- -
    ----- --------
    RETENTION   BIG
    ----------- ---
    SYSTEM                               8192          65536                       1
      2147483645
                      65536 ONLINE    PERMANENT LOGGING   NO  LOCAL      SYSTEM    M
    ANUAL DISABLED
    NOT APPLY   NO
    SQL>
      

  5.   

    select * from dba_objects where tablespace_name='SSPATBS';
      

  6.   

    ls的 dba_objects 中 有tablesapce_name 列吗? 您什么版本?
      

  7.   

    问题我已经解决了,现在讲解决办法贴出来大家参考参考
    下面是查询的语句select 
    a.bytes/1024/1024 "used(MB)",
    b.bytes/1024/1024 "free(MB)",
    a.bytes/1024/1024+b.bytes/1024/1024 "total(MB)" 
    from user_ts_quotas a,user_free_space b 
    where a.TABLESPACE_NAME=b.TABLESPACE_NAME and a.TABLESPACE_NAME='SSPATBS';