如何查看表结构信息

                                                                                        如何查看表结构信息
1、使用user_tables 视图

select * from user_tables where table_name='XXX';

SQL> desc user_tables
.....................


2、使用 pl/sql 包

SQL> VARIABLE total_blocks NUMBER
SQL> VARIABLE total_bytes NUMBER
SQL> VARIABLE unused_blocks NUMBER
SQL> VARIABLE unused_bytes NUMBER
SQL> VARIABLE lastextf NUMBER
SQL> VARIABLE last_extb NUMBER
SQL> VARIABLE lastusedblock NUMBER

SQL> exec DBMS_SPACE.UNUSED_SPACE('SCOTT', 'EMP', 'TABLE', :total_blocks, :total_bytes,:unused_blocks, :unused_bytes, :lastextf, :last_extb, :lastusedblock);

SQL> print

TOTAL_BLOCKS
------------
           8

TOTAL_BYTES
-----------
      65536

UNUSED_BLOCKS
-------------
            0

UNUSED_BYTES
------------
           0

  LASTEXTF
----------
         4

 LAST_EXTB
----------
       144

LASTUSEDBLOCK
-------------
            8

 

你可能感兴趣的:(如何查看表结构信息)