In the post "one Cursor:pin S wait on X event tracking" (http://blog.csdn.net/msdnchina/article/details/45372011), there is a knowledge point where the original author did not write the calculation process:
Sql> SELECT DISTINCT SESSION_ID,SESSION_SERIAL#,P1,P2 2 from temp_hist_active_sess_history 3 where event = ' Cursor:pin S wait on X ' 4 and rownum<=50; query results, we analyze p2=21333102559232, the first two bytes data is 4967 Note: temp_ Hist_active_sess_history's build statement is:sql> CREATE TABLE Temp_hist_active_sess_history nologging as 2 SELECT * FROM dba_hist_active_sess_history 3 where to_char (sample_time, ' yyyymmddhh24 ') between ' 2011030717 ' and ' 2011030722 ';
Let's analyze p2=21333102559232 (P2 is 10 binary), the first two bytes of data is 4967--the calculation process is as follows:
--Convert to 16 binary select To_char (21333102559232, ' xxxxxxxxxxxxxxxxxxxxxxxxxxxx ') from dual; ------return 136700000000, high-fill 4 0:0000136700000000 take high 8bytes:00001367select to_number (' 00001367 ', ' Xxxxxxxxxxxxxxxxxxxxxxxxxxxxx ') from dual; ------returns 4967
Another point of knowledge:
In the Dba_hist_active_sess_history view:
No P1raw column (for 16 binary), only P1 column, p1 column number type, 10 binary,
No P2raw column (for 16 binary), only P2 column, p2 column number type, 10 binary;
No P3raw column (for 16 binary), only P3 column, p3 column number type, 10 binary;
In the V$session and v$session_wait views:
There are p1raw columns (for 16 binary), P1 columns, p1 column number type, 10 binary,
There are p2raw columns (for 16 binary), p2 column, p2 column number type, 10 binary;
P3raw column (16 binary), p3 column, p3 column number type, 10 binary
To convert P2 column column values in Dba_hist_active_sess_history to SIDs