Oracle對錶的監控

denglt發表於2010-11-15
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       --表建立好後,預設就是監控的.
 
 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/195110/viewspace-678088/,如需轉載,請註明出處,否則將追究法律責任。

相關文章