edit.aljunic.com

.NET/Java PDF, Tiff, Barcode SDK Library

The X$BH table shows information about the blocks in the block buffer cache (which offers more information than the documented V$BH view). Here, we can see the touch count get incremented as we hit blocks. We can run the following query against that view to find the five "currently hottest blocks" and join that information to the DBA_OBJECTS view to see what segments they belong to. The query orders the rows in X$BH by the TCH (touch count) column and keeps the first five. Then we join the X$BH information to DBA_OBJECTS by X$BH.OBJ to DBA_OBJECTS.DATA_OBJECT_ID: sys%ORA11GR2> select tch, file#, dbablk, 2 case when obj = 4294967295 3 then 'rbs/compat segment' 4 else (select max( '('||object_type||') ' || 5 owner || '.' || object_name ) || 6 decode( count(*), 1, '', ' maybe!' ) 7 from dba_objects 8 where data_object_id = X.OBJ ) 9 end what 10 from ( 11 select tch, file#, dbablk, obj 12 from x$bh 13 where state <> 0 14 order by tch desc 15 ) x 16 where rownum <= 5 17 / TCH FILE# DBABLK WHAT ---------- ---------- ---------- -----------------------------65 1 2009 (TABLE) SYS.JOB$ 65 1 2008 (TABLE) SYS.JOB$ 11 1 345 (INDEX) SYS.I_OBJ2 11 1 337 (INDEX) SYS.I_OBJ1 10 1 44528 (INDEX) SYS.I_OBJ2

ssrs code 128 barcode font, ssrs code 39, ssrs fixed data matrix, winforms pdf 417 reader, winforms qr code reader, winforms upc-a reader, itextsharp remove text from pdf c#, replace text in pdf using itextsharp in c#, winforms ean 13 reader, c# remove text from pdf,

In a sense you have already seen a good deal of message passing in this chapter. For example: In the BackgroundWorker design pattern, the CancelAsync method is a simple kind of message. Whenever you raise events on a GUI thread from a background thread, you are, under the hood, posting a message to the GUI s event queue. On Windows this event queue is managed by the operating system, and the processing of the events on the GUI thread is called the Windows Event Loop. In this section we cover a simple kind of message processing called mailbox processing. This is popular in languages such as Erlang. A mailbox is a message queue that you can scan for a message particularly relevant to the message-processing agent you are defining. Listing 13-10 shows a concurrent agent that implements a simple counter by processing a mailbox as messages arrive. The type MailboxProcessor is defined in the F# library module Microsoft.FSharp. Control.Mailboxes.

Note The (2^32 - 1) or 4,294,967,295 referred to in the CASE statement is a magic number used to denote

Listing 13-10. Implementing a Counter Using a MailboxProcessor open Microsoft.FSharp.Control.Mailboxes let counter = MailboxProcessor.Create(fun inbox -> let rec loop(n) = async { do printfn "n = %d, waiting..." n let! msg = inbox.Receive() return! loop(n+msg) } loop(0)) The type of counter is MailboxProcessor<int>, where the type argument indicates that this object expects to be sent messages of type int.

"special" blocks. If you d like to understand what the underlying block in that instance is associated with, use the query select * from dba_extents where file_id = <FILE#> and block_id <= <DBABLK> and block_id+blocks-1 >= <DBABLK>.

You might be asking what is meant by the 'maybe!' and the use of MAX() in the preceding scalar subquery. This is due to the fact that DATA_OBJECT_ID is not a "primary key" in the DBA_OBJECTS view, as evidenced by the following: sys%ORA11GR2> select data_object_id, count(*) 2 from dba_objects 3 where data_object_id is not null 4 group by data_object_id 5 having count(*) > 1; DATA_OBJECT_ID COUNT(*) -------------- ---------29 3 6 3 73317 2 2 18 73350 2 8 3 633 3 664 3 73314 2 73318 2 267 2 420 2 503 7 10 3 0 4 15 rows selected. This is due to clusters (discussed in 10 on Tables), which may contain multiple tables. Therefore, when joining from X$BH to DBA_OBJECTS to print out a segment name, we would technically have to list all of the names of all of the objects in the cluster, as a database block does not belong to a single table all of the time. We can even watch as Oracle increments the touch count on a block that we query repeatedly. We will use the magic table DUAL in this example we know it is a one row, one column table.

The The Message Processing and State Machines sidebar describes the general pattern of Listing 13-10 and the other MailboxProcessor examples in this chapter, all of which can be thought of as state machines. With this in mind, let s take a closer look at Listing 13-10. First let s use counter on some simple inputs: > counter.Start();; n = 0, waiting... > counter.Post(1);; n = 1, waiting... > counter.Post(2);; n = 3, waiting... > counter.Post(1);; n = 4, waiting... Looking at Listing 13-10, note calling the MailboxProcessor.Start method causes the processing agent to enter loop with n = 0. The agent then performs an asynchronous Receive request on the inbox for the MailboxProcessor; that is, the agent waits asynchronously until a message has been received. When the message msg is received, the program calls loop(n+msg). As additional messages are received, the internal counter (actually an argument) is incremented further. We post messages to the agent using mailbox.Post. The type of mailbox.Receive is as follows:

Note Prior to Oracle 10g, querying DUAL would incur a full table scan of a real table named DUAL stored in the

   Copyright 2020.