实验如下:
SQL> conn scott/tiger;
Connected.
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------------------------------------ --------------
BONUS TABLE
DEPT TABLE
EMP TABLE
SALGRADE TABLE
SQL>
SQL> create table test (id number,name varchar2(10));
Table created.
SQL> alter table test add constraint pk_id primary key(id);
Table altered.
SQL> create index idx_name on test(name);
Index created.
SQL> insert into test values(1,'wagn');
1 row created.
SQL> insert into test values(2,'xue');
1 row created.
SQL> commit;
Commit complete.
SQL> select * from test;
ID NAME
---------- --------------------
1 wagn
2 xue
--分析表:
--查询:
SQL> set lines 200
SQL> col owner for a10
SQL> col SEGMENT_NAME for a25
SQL> col TABLESPACE_NAME for a25
SQL> col PARTITION_NAME for a25
SQL> select OWNER, SEGMENT_NAME,TABLESPACE_NAME,PARTITION_NAME, BYTES / 1024 / 1024 size_m from dba_segments where segment_name='TEST';
OWNER SEGMENT_NAME TABLESPACE_NAME PARTITION_NAME SIZE_M
---------- ------------------------- ------------------------- ------------------------- ----------
SCOTT TEST USERS .0625
SQL> select OWNER,TABLE_NAME,TABLESPACE_NAME,STATUS,LAST_ANALYZED,PARTITIONED from dba_tables where table_name ='TEST';
OWNER TABLE_NAME TABLESPACE_NAME STATUS LAST_ANALYZED PAR
---------- ------------------------- ------------------------- -------- ------------------- ---
SCOTT TEST USERS VALID 2018-01-24 00:58:46 NO
SQL> col index_name for a25
SQL> col TABLE_OWNER for a15
SQL> col TABLE_NAME for a25
SQL> select O
SQL> conn scott/tiger;
Connected.
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------------------------------------ --------------
BONUS TABLE
DEPT TABLE
EMP TABLE
SALGRADE TABLE
SQL>
SQL> create table test (id number,name varchar2(10));
Table created.
SQL> alter table test add constraint pk_id primary key(id);
Table altered.
SQL> create index idx_name on test(name);
Index created.
SQL> insert into test values(1,'wagn');
1 row created.
SQL> insert into test values(2,'xue');
1 row created.
SQL> commit;
Commit complete.
SQL> select * from test;
ID NAME
---------- --------------------
1 wagn
2 xue
--分析表:
--查询:
SQL> set lines 200
SQL> col owner for a10
SQL> col SEGMENT_NAME for a25
SQL> col TABLESPACE_NAME for a25
SQL> col PARTITION_NAME for a25
SQL> select OWNER, SEGMENT_NAME,TABLESPACE_NAME,PARTITION_NAME, BYTES / 1024 / 1024 size_m from dba_segments where segment_name='TEST';
OWNER SEGMENT_NAME TABLESPACE_NAME PARTITION_NAME SIZE_M
---------- ------------------------- ------------------------- ------------------------- ----------
SCOTT TEST USERS .0625
SQL> select OWNER,TABLE_NAME,TABLESPACE_NAME,STATUS,LAST_ANALYZED,PARTITIONED from dba_tables where table_name ='TEST';
OWNER TABLE_NAME TABLESPACE_NAME STATUS LAST_ANALYZED PAR
---------- ------------------------- ------------------------- -------- ------------------- ---
SCOTT TEST USERS VALID 2018-01-24 00:58:46 NO
SQL> col index_name for a25
SQL> col TABLE_OWNER for a15
SQL> col TABLE_NAME for a25
SQL> select O