【zt】How to disable flush of ASH data to AWR?

MMON process will periodically flush ASH data into AWR tables.
Oracle introduced WF enqueue which is used to serialize the flushing of snapshots.

If for any reason ( space issue, bugs, hanging etc..) you need to disable flushing the run time statistics for
particular table than following procedure needs to be done.

First, locate the exact AWR Table Info (KEW layer):

SQL>  select table_id_kewrtb, table_name_kewrtb from x$kewrtb order by 1

TABLE_ID_KEWRTB TABLE_NAME_KEWRTB
--------------- --------------------------------------------------------
              0 WRM$_DATABASE_INSTANCE
              1 WRM$_SNAPSHOT
              2 WRM$_BASELINE
              3 WRM$_WR_CONTROL
              4 WRH$_STAT_NAME
              5 WRH$_PARAMETER_NAME
              6 WRH$_EVENT_NAME
              7 WRH$_LATCH_NAME
              8 WRH$_FILESTATXS
              9 WRH$_TEMPSTATXS
             10 WRH$_DATAFILE
             11 WRH$_TEMPFILE
             12 WRH$_SQLSTAT
             13 WRH$_SQLTEXT
             14 WRH$_SQL_SUMMARY
             15 WRH$_SQL_PLAN
             16 WRH$_SYSTEM_EVENT
             17 WRH$_BG_EVENT_SUMMARY
             18 WRH$_WAITSTAT
             19 WRH$_ENQUEUE_STAT
             20 WRH$_LATCH
             21 WRH$_LATCH_CHILDREN
             22 WRH$_LATCH_PARENT
             23 WRH$_LATCH_MISSES_SUMMARY
             24 WRH$_LIBRARYCACHE
             25 WRH$_DB_CACHE_ADVICE
             26 WRH$_BUFFER_POOL_STATISTICS
             27 WRH$_ROWCACHE_SUMMARY
             28 WRH$_SGA
             29 WRH$_SGASTAT
             30 WRH$_PGASTAT
             31 WRH$_RESOURCE_LIMIT
             32 WRH$_SHARED_POOL_ADVICE
             33 WRH$_SQL_WORKAREA_HISTOGRAM
             34 WRH$_PGA_TARGET_ADVICE
             35 WRH$_INSTANCE_RECOVERY
             36 WRH$_SYSSTAT
             37 WRH$_PARAMETER
             38 WRH$_UNDOSTAT
             39 WRH$_PROCESS_MEMORY_SUMMARY
             40 WRH$_SEG_STAT
             41 WRH$_SEG_STAT_OBJ
             42 WRH$_DLM_MISC
             43 WRH$_SERVICE_NAME
             44 WRH$_SERVICE_STAT
             45 WRH$_ACTIVE_SESSION_HISTORY
             46 WRH$_SYSMETRIC_HISTORY
             47 WRH$_FILEMETRIC_HISTORY
             48 WRH$_WAITCLASSMETRIC_HISTORY
             49 WRI$_ALERT_HISTORY
             50 WRH$_TABLESPACE_STAT
             51 WRH$_LOG
             52 WRH$_MTTR_TARGET_ADVICE
             53 WRH$_TABLESPACE_SPACE_USAGE
             54 WRH$_METRIC_NAME
             55 WRH$_SYSMETRIC_SUMMARY
             56 WRH$_SQL_BIND_METADATA
             57 WRH$_JAVA_POOL_ADVICE
             58 WRH$_THREAD
             59 WRH$_SESSMETRIC_HISTORY
             60 WRH$_OSSTAT
             61 WRH$_OSSTAT_NAME
             62 WRH$_SYS_TIME_MODEL
             63 wri$_optstat_opr
             64 WRH$_OPTIMIZER_ENV
             65 WRM$_SNAP_ERROR
             66 WRH$_SERVICE_WAIT_CLASS
             67 WRH$_CR_BLOCK_SERVER
             68 WRH$_CURRENT_BLOCK_SERVER
             69 WRH$_INST_CACHE_TRANSFER
             70 SQL Group
             71 Segment Group
             72 Datafile Group
             73 Tempfile Group
             74 Service Group
             75 Undo Group
             76 WRH$_STREAMS_POOL_ADVICE
             77 WRI$_SEGADV_OBJLIST
             78 WRI$_SEGADV_CNTRLTAB
             79 WRH$_COMP_IOSTAT
             80 WRH$_SGA_TARGET_ADVICE
             81 WRH$_SESS_TIME_STATS
             82 WRH$_STREAMS_CAPTURE
             83 WRH$_STREAMS_APPLY_SUM
             84 WRH$_BUFFERED_QUEUES
             85 WRH$_BUFFERED_SUBSCRIBERS
             86 WRH$_RULE_SET
             87 WRH$_EVENT_HISTOGRAM
             88 WRH$_MUTEX_SLEEP
             89 WRH$_MEMORY_TARGET_ADVICE
             90 WRH$_MEMORY_RESIZE_OPS
             91 WRH$_PERSISTENT_QUEUES
             92 WRH$_PERSISTENT_SUBSCRIBERS
             93 WRM$_COLORED_SQL
             94 WRH$_IOSTAT_FUNCTION
             95 WRH$_IOSTAT_FUNCTION_NAME
             96 WRH$_IOSTAT_FILETYPE
             97 WRH$_IOSTAT_FILETYPE_NAME
             98 WRH$_RSRC_CONSUMER_GROUP
             99 WRH$_RSRC_PLAN
            100 WRM$_BASELINE_DETAILS
            101 WRM$_BASELINE_TEMPLATE
            102 WRH$_CLUSTER_INTERCON
            103 WRH$_MEM_DYNAMIC_COMP
            104 WRH$_IC_CLIENT_STATS
            105 WRH$_IC_DEVICE_STATS
            106 WRH$_INTERCONNECT_PINGS
            107 WRH$_DISPATCHER
            108 WRH$_SHARED_SERVER_SUMMARY
            109 WRH$_IOSTAT_DETAIL
            110 WRH$_DYN_REMASTER_STATS
            111 WRH$_PLAN_OPERATION_NAME
            112 WRH$_PLAN_OPTION_NAME
            113 WRH$_SQLCOMMAND_NAME
            114 WRH$_TOPLEVELCALL_NAME
            115 WRM$_WR_USAGE
            116 WRH$_MVPARAMETER
            117 WRH$_PERSISTENT_QMN_CACHE
            118 WRH$_TABLESPACE
            119 WRM$_SNAPSHOT_DETAILS
            120 WRI$_SQLTEXT_REFCOUNT

121 rows selected.

1st option :

SQL> alter system set “_awr_disabled_flush_tables”=’<table_name>’;

e.g.

alter system set “_awr_disabled_flush_tables”=’WRH$_INTERCONNECT_PINGS,WRH$_RSRC_PLAN’;

System altered.

2nd option:

SQL> alter session set events ‘immediate trace name awr_flush_table_off level 106′;
SQL> alter session set events ‘immediate trace name awr_flush_table_off level 99′

If you decide to turn on flushing statistics than

SQL> alter session set events ‘immediate trace name awr_flush_table_on level 106′;
SQL> alter session set events ‘immediate trace name awr_flush_table_on level 99′;

你可能感兴趣的:(thread,oracle,sql,SQL Server,cache)