Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> REPOST: Re: MONITORING

REPOST: Re: MONITORING

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Sun, 27 Jan 2002 09:15:25 -0000
Message-ID: <1$--$%%%%-_----$%$@news.noc.cabal.int>

As a first pass, it looks as if it is joining the 'monitored modifications' table to various object tables to turn ids into names.

The different unions are:
Tables, table partitions, table composite subpartitions and table subpartitions.
The NOT IN exclusion is to avoid handling snapshot logs.

--
Jonathan Lewis
http://www.jlcomp.demon.co.uk

Now running 3-day intensive seminars
http://www.jlcomp.demon.co.uk/seminar.html

Host to The Co-Operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html

Author of:
Practical Oracle 8i: Building Efficient Databases


Brian Tkatch wrote in message <3c5353f8.1619018204_at_news.alt.net>...

>On Fri, 25 Jan 2002 21:48:49 +0000 (UTC), "John Darrah"
><jdarrah_at_veripost.net> wrote:
>
>>Brian,
>>Here is the query DBMS_STATS uses to find stale objects. To get this I
>>typed the following command at a sqlplus prompt:
>>SQL> alter session set events '10046 trace name context forever, level
>>12';
>>SQL> < execute the dbms_stats.gather_stale procedure>
>>Then if you go to your udump directory, you'll find a file named
>>something along the lines of <ORACLE_SID>_ora_<process_num>.trc. If you
>>just go after the most recent file, most times you'll have the right
>>one. Inside the file your find a bunch of sql statements, bind
>>variables for those statements and wait events posted while the
>>statements were being run. Using tkprof, you can get the statement into
>>a more readable statement but you'll lose the bind and wait stuff (until
>>9i). Anyway, here is the statement, it look pretty much like it uses a
>>10% of total rows changed to determine whether or not to reanalyze.
>
>
>I'm on 8i. I did the trace, after SETting the event was pointed out.
>The resulting trace information was too confusing for me, however, and
>figuring it out seem beyond me.
>>
>>SELECT /*+ ordered full(t) use_hash(t) use_nl(o) use_nl(u) */
>> U.NAME OWN,
>> O.NAME TAB,
>> NULL PART,
>> NULL SPART
>> FROM SYS.MON_MODS$ M,
>> SYS.TAB$ T,
>> SYS.OBJ$ O,
>> SYS.USER$ U
>> WHERE ((:b1 IS NULL ) OR (U.NAME = :b1 ))
>> AND ((:b3 IS NOT NULL ) OR (U.NAME != 'SYS' ))
>> AND M.OBJ# = T.OBJ#
>> AND (( U.NAME,O.NAME )
>> NOT IN (SELECT MOWNER,
>> LOG
>> FROM MLOG$
>> UNION ALL
>> SELECT MOWNER,
>> TEMP_LOG
>> FROM MLOG$
>> WHERE TEMP_LOG IS NOT NULL ))
>> AND BITAND(T.FLAGS,16) = 16
>> AND ((BITAND(M.FLAGS,1) = 1 ) OR ((M.INSERTS + M.UPDATES + M.DELETES
>>) > (.1 * T.ROWCNT ) ))
>> AND T.OBJ# = O.OBJ#
>> AND O.OWNER# = U.USER#
>>UNION ALL
>>SELECT /*+ ordered use_hash(tp) use_nl(o) use_nl(u) */
>> U.NAME OWN,
>> O.NAME TAB,
>> O.SUBNAME PART,
>> NULL SPART
>> FROM SYS.MON_MODS$ M,
>> SYS.TABPART$ TP,
>> SYS.OBJ$ O,
>> SYS.USER$ U
>> WHERE ((:b1 IS NULL ) OR (U.NAME = :b1 ))
>> AND ((:b3 IS NOT NULL ) OR (U.NAME != 'SYS' ))
>> AND M.OBJ# = TP.OBJ#
>> AND BITAND(TP.FLAGS,2) = 2
>> AND ((BITAND(M.FLAGS,1) = 1 ) OR ((M.INSERTS + M.UPDATES + M.DELETES
>>) > (.1 * TP.ROWCNT ) ))
>> AND TP.OBJ# = O.OBJ# AND O.OWNER# = U.USER#
>>UNION ALL SELECT /*+ ordered use_hash(tcp) use_nl(o) use_nl(u) */
>> U.NAME OWN,
>> O.NAME TAB,
>> O.SUBNAME PART,
>> NULL SPART
>> FROM SYS.MON_MODS$ M,
>> SYS.TABCOMPART$ TCP,
>> SYS.OBJ$ O,SYS.USER$ U
>> WHERE ((:b1 IS NULL ) OR (U.NAME = :b1 ))
>> AND ((:b3 IS NOT NULL ) OR (U.NAME != 'SYS' ))
>> AND M.OBJ# = TCP.OBJ# AND BITAND(TCP.FLAGS,2) = 2
>> AND ((BITAND(M.FLAGS,1) = 1 ) OR ((M.INSERTS + M.UPDATES + M.DELETES
>>) > (.1 * TCP.ROWCNT ) ))
>> AND TCP.OBJ# = O.OBJ#
>> AND O.OWNER# = U.USER#
>>UNION ALL
>>SELECT /*+ ordered use_hash(tsp) use_nl(o) use_nl(u) use_nl(op) */
>> U.NAME OWN,
>> O.NAME TAB,
>> OP.SUBNAME PART,
>> O.SUBNAME SPART
>> FROM SYS.MON_MODS$ M,
>> SYS.TABSUBPART$ TSP,
>> SYS.OBJ$ O,
>> SYS.USER$ U,
>> SYS.OBJ$ OP
>> WHERE ((:b1 IS NULL ) OR (U.NAME = :b1 ))
>> AND ((:b3 IS NOT NULL ) OR (U.NAME != 'SYS' ))
>> AND M.OBJ# = TSP.OBJ#
>> AND BITAND(TSP.FLAGS,2) = 2
>> AND ((BITAND(M.FLAGS,1) = 1 ) OR ((M.INSERTS + M.UPDATES + M.DELETES
>>) > (.1 * TSP.ROWCNT ) ))
>> AND TSP.OBJ# = O.OBJ#
>> AND O.OWNER# = U.USER#
>> AND TSP.POBJ# = OP.OBJ#
>>ORDER BY 1,2,3,4
>
>
>I ought to tear this apart later. Any pointers to help me understand
>the main tables references would be greatly appreciated.
>
>Brian
========= WAS CANCELLED BY =======: From: "Jonathan Lewis" <jonathan_at_jlcomp.demon.co.uk> Control: cancel <1012123726.10670.0.nnrp-12.9e984b29_at_news.demon.co.uk> Subject: cmsg cancel <1012123726.10670.0.nnrp-12.9e984b29_at_news.demon.co.uk> Date: Mon, 28 Jan 2002 02:27:49 GMT X-NNTP-Posting-Host: htxmmhwj.demon.co.uk:109.31.54.247 X-Trace: news.demon.co.uk 552083777nnrp-56:4056 NO-IDENT htxmmhwj.demon.co.uk:109.31.54.247 X-Complaints-To: abuse_at_demon.net Message-ID: <cancel.1012123726.10670.0.nnrp-12.9e984b29_at_news.demon.co.uk> X-No-Archive: yes Newsgroups: microsoft.test,alt.flame.niggers,comp.databases.oracle.server NNTP-Posting-Host: w088.z064003087.lax-ca.dsl.cnc.net 64.3.87.88 Lines: 1 Path: news.uni-stuttgart.de!cert.uni-stuttgart.de!news.belwue.de!news.uni-ulm.de!rz.uni-karlsruhe.de!blackbush.xlink.net!blackbush.de.kpnqwest.net!newsfeed00.sul.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.stealth.net!msrtrans1!msrnewsc1!cppssbbsa01.microsoft.com!tkmsftngp01!tkmsftngp04!u&n&a&c&anceller Xref: news.uni-stuttgart.de control:40720907 This message was cancelled from within The Unacanceller's glorious new software, Lotus 1-2-3 For Rogue Cancellers.
Received on Sun Jan 27 2002 - 03:15:25 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US