ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Oracle对表的监控

Oracle对表的监控

原创 Linux操作系统 作者:denglt 时间:2010-11-15 09:21:22 0 删除 编辑
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博客 ” ,链接:https://blog.itpub.net/195110/viewspace-678088/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-11-04

  • 博文量
    118
  • 访问量
    763937