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 --表建立好后,默认就是监控的.