Oracle10g前对表进行监控,必须要发出监控指令。

SQL> select * from v$version;

BANNER

----------------------------------------------------------------

Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production

PL/SQL Release 9.2.0.1.0 - Production

CORE 9.2.0.1.0 Production

TNS for 32-bit Windows: Version 9.2.0.1.0 - Production

NLSRTL Version 9.2.0.1.0 - Production

SQL> create table t_blob (b blob);

Table created

SQL> select monitoring from user_tables where table_name=upper('t_blob');

MONITORING

----------

NO

SQL> alter table t_blob monitoring;

Table altered

SQL> select monitoring from user_tables where table_name=upper('t_blob');

MONITORING

----------

YES

SQL> insert into t_blob values(utl_raw.cast_to_raw('denglt'));

1 row inserted

SQL> commit;

Commit complete

SQL> insert into t_blob values(utl_raw.cast_to_raw('denglt'));

1 row inserted

SQL> commit;

Commit complete

SQL> select *from  user_tab_modifications where table_name='T_BLOB';

TABLE_NAME                     PARTITION_NAME                 SUBPARTITION_NAME                 INSERTS    UPDATES    DELETES TIMESTAMP   TRUNCATED

------------------------------ ------------------------------ ------------------------------ ---------- ---------- ---------- ----------- ---------

SQL>

SQL> begin

2    dbms_stats.FLUSH_DATABASE_MONITORING_INFO();

3  end;

4  /

PL/SQL procedure successfully completed

SQL> select *from  user_tab_modifications where table_name='T_BLOB';

TABLE_NAME                     PARTITION_NAME                 SUBPARTITION_NAME                 INSERTS    UPDATES    DELETES TIMESTAMP   TRUNCATED

------------------------------ ------------------------------ ------------------------------ ---------- ---------- ---------- ----------- ---------

T_BLOB                                                                                                1          0          0 2010/11/15  NO

SQL>

10g的情况:

SQL>  select * from v$version;

BANNER

----------------------------------------------------------------

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi

PL/SQL Release 10.2.0.4.0 - Production

CORE 10.2.0.4.0 Production

TNS for 64-bit Windows: Version 10.2.0.4.0 - Production

NLSRTL Version 10.2.0.4.0 - Production

SQL> create table t_blob (b blob);

create table t_blob (b blob)

ORA-00955: 名称已由现有对象使用

SQL> drop table t_blob;

Table dropped

SQL> create table t_blob (b blob);

Table created

SQL> select monitoring from user_tables where table_name=upper('t_blob');

MONITORING

----------

YES      --表建立好后,默认就是监控的.

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐