Wednesday, November 24, 2010

Biology Lab Manual A Answers

How to perform update / delete mass effectively


In this note I will show an effective method to modify or eliminate a large number of rows on a large table. In general, the voluminous tables are partitioned for scalability naturally. Partitioning mainly provides 3 types of benefits: 1) improves performance, 2) facilitates the management and maintenance and 3) increasing the availability of data. Resolve a query using as underlying table can be partitioned in the same way to solve a problem dividing it into parts. The familiar premise: divide and conquer is the main objective behind the partition.

Since the introduction of the feature of partitioning (Oracle 8) has greatly expanded the set of possible operations on tables and indexes to support and manage the tables / indices partitioned. With each new release options were added, and partitioning methods for handling operations segments. The various features introduced in each release are:





Oracle 8 (1997)




Partition Pruning (*)

Range Partitioning (includes operations ADD, DROP, RENAME, TRUNCATE, MODIFY, MOVE, SPLIT and EXCHANGE)




Oracle 8i ( 1999)



 
Hash Partitioning Composite Partitioning


: range / hash


Added

MERGE operation




Oracle 9i R2 (2002)






List Partitioning Partitioning Composite: Range / List


Clause UPDATE GLOBAL INDEXES








Oracle 10g R1 (2004)






Oracle 10g R2 (2005)

It increased the limit of partitions / subpartitions 65k to 4M
    Oracle 11g R1 (2007)
composite partitioning: range-range, list-range, list-list and list-hash.
 
 Added partitioning interval, reference and system. 
Oracle 11g R2 (2009)
    virtual and primary key columns for partitioned tables referenced. Indices

  • system partitioned by list-partitioned tables.

  • As you can see, almost every new release there was any new functionality added. However, in my opinion, the main feature has existed since the first release with partitioning (1997). I mean the partition pruning and partition pruning, which allows the optimizer (CBO always talking about) choice in automatic, accurate and transparent partition or partitions where the required data. This allows you to segment the data and process only that interest us, without adding any additional intelligence in the application code.
With respect to operations, the vast majority are from Oracle 8, only be added after the MERGE. An operation is very interensante EXCHANGE, with which you can share a table with a partition unpartitioned. It is precisely this operation that I use to propose an alternative fast to change or delete many rows of partitioned tables. Then somo usually do, I will show the steps in detail and compare the times and use of resources:
I will create a table T partitioned 3 partitions list create table t (c1 int, c2 varchar2 (10),
date c3, c4
    char (1))
  • partition by list (c4)
  • (
  • t_a partition values \u200b\u200b('A'), partition
    T_B values \u200b\u200b('B'), partition
  • T_C values \u200b\u200b('C')
  • )
 
 I'm going to insert rows 10M arbitrarily distributed on the partitions:   
insert into t select rownum, dbms_random.string ('a', 10), sysdate-dbms_random
. value (-100.100),
chr (trunc (dbms_random.value (65.68)))
from dual connect by rownum

5M Insert rows on the partition on which I will work to have more rows :

insert into t select rownum +10000000,
    dbms_random.string ('a', 10), sysdate-dbms_random.value
  • (-100.100),
  • 'A' from dual connect by rownum


After all values \u200b\u200bare loaded confirm (commit) and then collect statistics.
Consider the plan for a query that counts rows on partition 1 (t_a):
Explain plan for select count (1)
from t WHERE c2> 'R' and c4 = 'A'; select * from table (dbms_xplan.display) ------------------------------------

PLAN_TABLE_OUTPUT
    -------------------------------------------------- -------------
  • Plan hash value: 2901716037
  • -----------------------------------------------------------------------------------------------
  • ACCESS FULL from t
WHERE c4 = 'A';

COUNT (1) ----------

8333946



At this point, we already have a partition with more than 8.3M of rows which we will modify 5.6M, which is more than 67%.
 First I'll test a regular update on the table T and then make the comparison with the same change but using another approach more efficient. 

 


September update
t c3 = c3 +1
WHERE c4 = 'A'
and c2> 'R'

5610297 rows updated. After

: 00:04:45.37

 
 
The amendment took 4 ' 45 ". We think that the database must maintain consistency to ensure consistent read (using the UNDO) and persist the changes to be able to recover if a failure event occurs during the modification (REDO). These mechanisms cause the times increase and generate additional information.

review how much UNDO and REDO space is needed to perform the update:



<= 10000000;

select 'REDO_SIZE'
round (ms.value/1024/1024) value from v $
MYSTAT ms, v $ statname
WHERE sn = sn.STATISTIC ms.STATISTIC # #
 and sn.NAME = 'redo size' 
 
union all SELECT 'UNDO_SIZE'
t.used_ublk * 8 / 1024 value
FROM v $ transaction t, v $ session s WHERE
t.addr = s.taddr
AND s.audsid = userenv ('sessionid')
<= 5000000;

REDO_SIZE


2489 Mb 885 Mb
 UNDO_SIZE 
 



5.3m is needed to modify 2489Mb 885Mb redo and undo!. In the example, the table has no indices. If you have indexes and the modified column is part of the indexing columns generate more redo and undo, and also the sentence would have to update the indexes for each row modified which will cause the update takes a while longer. If it were a bulk processing instead of a delete update will generate more undo (the delete is dml operation that generates more undo) and will be balanced to keep the indices, which means more processing time.


there a simpler way to perform the update operation using partitioning star: EXCHANGE. Before using the exchange we need to create an auxiliary table (T_A) and to speed up the table as NOLOGGING set up and inserted directly using the APPEND hint.



create table t_a_aux
NOLOGGING as select / * + APPEND * /
c1, c2
,
case when (c2> 'R') then c3 else c3 end
+1 c3, c4

from t WHERE
c4 = 'A'

Elapsed: 00:00:22.04

 
 Only needed 22 "to insert the rows in the auxiliary table. With DECODE or CASE function to make a change to simulate the update. Now only remains to make the exchange between the auxiliary and the partition table with the operation t_a EXCHANGE: 






ALTER TABLE t EXCHANGE PARTITION WITH t_a
t_a_aux table;

After: 00:00:11.46

 
 The exchange took place almost 12. " Adding the auxiliary table creation and exchange, all took only 44 "!!!, ie more than 6 times faster than the traditional update. 
Running the query space for the redo and undo generated is obtained:


REDO_SIZE 1 Mb


UNDO_SIZE 0 Mb

Virtually no allocation for undo / redo. Therefore, for certain cases it is very useful to use this method to update since the processing times are significantly reduced and also the requirements of undo and redo are minimized almost completely.


 
 To remove (delete) en masse, creating the auxiliary table should only be filled with rows that do not fade. If you need to delete many rows from a non-partitioned table can use the same approach, ie replacing delete an insert into a new table, recreate the indexes and rename. 







Monday, November 22, 2010

Buy Flamin Hot Cheetos In London

CATHEDRAL OF GUATEMALA. Source

Catedral

The Cathedral is located in the heart of the historic center east of the Plaza de la Constitution, previously known as Plaza Mayor. To the north is the Palacio Nacional of Culture, built in 1943 during the government of Jorge Ubico, toward the south, Trade Portal, built in 1924. The cathedral complex includes three buildings: the Cathedral, the center, the Archbishop's Palace to the north and the old Infant School to the south. The facade of the three buildings is oriented towards the west. There is, however, a fourth building that completes the entire block, this is the rectory or parish house, the first building completed and occupied in this complex. Of the four buildings, the larger is the Cathedral, followed by the Archbishop's Palace. All are one unit and are made in the same style, becoming the only buildings block or block Historical Center which remains unchanged for almost 200 years.


Sunday, November 21, 2010

Very Old Goodnites Commercial]




Wednesday, November 17, 2010

Order Bulk Dietz & Watson Landjaeger Sausages

Reports Metrics Load and Response Times Database (10g +)

From 10g added dynamic views and historical information to understand better and faster activity database. Although Statspack and AWR reports have the information, they are based on snapshots as a reference for analyzing a range. Intervals are usually 1 hour (automatic and default in 10g +) and often have to wait for the next snapshot to get an idea of \u200b\u200bthe current activity.
With the new dynamic views can know almost in real time which is the core activity referring to the following dynamic view:
V $ SYSMETRIC
: Metrics more recent and less recent
last minute (one sample every 15 ").
V $ SYSMETRIC_HISTORY
: Last time all samples (choose one sample per 
 minute) . 
$ SYSMETRIC_SUMMARY
 
V: Summary of the activity of the last hour (maximum, minimum, average and standard deviation
).


stories and views remain part of the information of the dynamic view of the last hour
(mmon process is responsible for copy some of the most important information of the view V $ a disc) and externalize result with the following views:


DBA_HIST_SYSMETRIC_HISTORY


DBA_HIST_SYSMETRIC_SUMMARY

With this information available gives a very detailed idea of \u200b\u200bthe activity and the load profile. Here is a query that uses the view summarized and returns among others, the same data found in the reports Statspack / AWR in the "Load Profile" in the column I tabbed a second:
select metric_name, case (metric_id)
Then when to round 2016 (minval/1024/1024, 2) When 2058
Then round (minval/1024/1024, 2)
else round (minval, 2) end Min,
case (metric_id) 2016
Then when to round (maxval / 1024/1024, 2)
when 2058 then round(maxval/1024/1024,2)
else round(maxval,2) end Max,
case (metric_id)
when 2016 then round(average/1024/1024,2)
when 2058 then round(average/1024/1024,2)
else round(average,2) end Avg,
   case (metric_id) 
   when 2016 then round(standard_deviation/1024/1024,2) 
when 2058 then round(standard_deviation/1024/1024,2)
else round(standard_deviation,2) end STDDEV,
case (metric_id)
when 2016 then 'Mbytes Per Second'
when 2058 then 'Mbytes Per Second'
else metric_unit end metric_unit
from v$sysmetric_summary
where metric_id in (2003,2026.2004,2006,2016,2018,2030,
2044,2046,2058,2071,2075,2081,2123)
order by metric_id

METRIC_NAME MIN MAX AVG STDDEV METRIC_UNIT
---------------------------------------------------------------- ---------- ---------- ---------- ---------- ----------------------------------------------------------------
User Transaction Per Sec 0 28.75 24.4 1.64 Transactions Per Second
 Physical Writes Per Sec                                                   0      29.63      21.91       2.25 Writes Per Second 
 Redo Generated Per Sec                                                     0        .06        .05          0 Mbytes Per Second 
 Logons Per Sec                                                            0       1.18        .93        .08 Logons Per Second 
Logical Reads Per Sec 0 1015.72 592.05 75.19 Reads Per Second
Total Parse Count Per Sec 0 52.75 28.29 4.33 Parses Per Second
Hard Parse Count Per Sec 0 7.24 1.29 .88 Parses Per Second
Network Traffic Volume Per Sec 0 .03 .02 0 Mbytes Per Second
DB Block Changes Per Sec 0 339.75 287.39 19.15 Blocks Per Second CPU Usage Per Sec 0 11.27 9.88 51 Second centiseconds Per User Rollback UndoRec Applied Per Sec 0 3 03 07 Records Per Second
Database Time Per Sec 0 72.48 26.67 08.01 Per Second
centiseconds
previous data are available per transaction if you need it.

Now I will show how to obtain the metric based on percentiles, with ratios and percentages of the last two samples the last minute. The most newest of at most 15 seconds and the oldest is at most 60 seconds.
   
select metric_name, round (value, 2) value, metric_unit
from v $ SYSMETRIC
WHERE metric_name like '% \\%%' escape '\\'
or metric_name like '% Percent%' or metric_name like
'% Ratio%'
 
 
METRIC_NAME METRIC_UNIT
VALUE ------------------------------------- --------------------------- ---------- ------------- -------------------------------------------------- - Buffer Cache Hit Ratio
95.75% (their - PhyRead) / Achievements
Memory Sorts Ratio 100 % MemSort/(MemSort + DiskSort)
Redo Allocation Hit Ratio 100 % (#Redo - RedoSpaceReq)/#Redo
 User Commits Percentage                                                 100 % (UserCommit/TotalUserTxn) 
 User Rollbacks Percentage                                                 0 % (UserRollback/TotalUserTxn) 
Cursor Cache Hit Ratio 232.71 % CursorCacheHit/SoftParse
Execute Without Parse Ratio 63.74 % (ExecWOParse/TotalExec)
Soft Parse Ratio 96.05 % SoftParses/TotalParses PX downgraded 1 to 25% Per Sec 0 PX Operations Per Second
PX downgraded 25 to 50% Per Sec 0 PX Operations Per Second
PX downgraded 50 to 75% Per Sec 0 PX Operations Per Second
PX downgraded 75 to 99% Per Sec 0 PX Operations Per Second
User Limit % 0 % Sessions/License_Limit Database Wait Time Ratio 42.12 % Wait/DB_Time Database CPU Time Ratio 57.88 % Cpu/DB_Time
Row Cache Hit Ratio 99.75 % Hits/Gets
Row Cache Miss Ratio .25 % Misses/Gets Library Cache Hit Ratio 98.1 % Hits/Pins Library Cache Miss Ratio 1.9 % Misses/Gets
Shared Pool Free % 91.27 % Free/Total
PGA Cache Hit % 99.89 % Bytes/TotalBytes Process Limit % 24.7 % Processes/Limit Session Limit % 16.86 % Sessions/Limit
Streams Pool Usage Percentage 0 % Memory allocated / Size of Streams pool
Buffer Cache Hit Ratio 96.18 % (LogRead - PhyRead)/LogRead
Memory Sorts Ratio 100 % MemSort/(MemSort + DiskSort)
Execute Without Parse Ratio 64.59 % (ExecWOParse/TotalExec)
Soft Parse Ratio 95.72 % SoftParses/TotalParses
Host CPU Utilization (%) 4.39% Busy / (Idle + Busy)
Database CPU Time Ratio 15.8% Cpu / DB_Time Library Cache Hit Ratio 97.64% Hits / Pins Shared Pool Free% 91.28% Free / Total

Another query that I use is more simple and I just returned the overall response time and response time per transaction, both in seconds, so you can quickly analyze and detect if something is happening with the base. I have a reasonable idea of \u200b\u200bthe times for each base and if I see something that triggers me realize looking at only those two values. Below is the query I show how I use and output it.

select end_time,
 round (max (decode (metric_id, 2106, value/100, null)), 4) "SQLRTime" 
round (max (decode (metric_id, 2109, value/100, null)), 4 ) "IMRT / Trx" from v $ sysmetric_history

WHERE metric_id in (2106.2109)
and end_time> sysdate-10/24/60

group by order by end_time end_time desc



END_TIME SQLRTime IMRT / Trx
18/11/2010 12:15:34 PM 0.0013 0.0172 0.0063
18/11/2010 12:14:33 pm 18/11/2010 12:13:33 pm
0.0843 0.1101 0.0087
18/11/2010 12:12:33 pm
0.1147 0.0039 0.009 0.1214 18/11/2010 12:11:34 pm 11/18/2010 12:10:34 pm

11/18/2010 12:09 0.0062 0.1145 : 34 pm
0.1102 0.0079 0.0081 0.1167 11/18/2010 12:08:34 pm 11/18/2010 12:07:34 pm

0.1112 0.0085 0.0078 0.1141 11/18/2010 12:06:34 pm



If you would like to see more ancient history or you are building a report summarizing historical and / or grouped by hour, day, week or month can use a historical view (DBA_HIST_xxx).

Poultice For Skin Infections

Patching 11.2.0.2 (not so patch)

Last week I had to apply the patch 11.2.0.2 on a development team. When I entered and searched metalink the patch applied to my OS (Solaris SPARC) I was struck by the size of the patch. The last patches installed memory that will not weigh much more than 1Gb. 11.2.0.2 patch on the platform weighs 5.1Gb needed!, And AIX over 6Gb. Recently when I read the documentation I understood why. The issue is that Oracle changed the policy of patching from 11.2.0.2. Now there are more incremental, but also total and contain all the bundle, ie server, client, gateway, grid, etc.

9i remember that everything came together, if a customer wanted to install only need to download 3 files that contained everything, which was cumbersome. Facilities in their independence 10g client, server, grid, etc. Now it seems that you have to download everything again and then choose to install what we need.
 is mandatory to use a separate home for the installation, the total can not be patched on the current home. In my case this new requirement does not bother me because I always consider as a good practice to install patches on a copy in a new home, to minimize risks if the patch fails partway through the installation and requires backtracking support binaries above. If you are very short of space, is a bit complicated to create a separate home so in that case you must download the bases, support binaries, remove them and install the new home. 
Installation on Solaris SPARC had no setbacks. I had to upgrader an Oracle 11g R1 (11.1.0.7) and Oracle 11g R2 (11.2.0.1). Both updates were made perfectly and without any mishap.


Tuesday, November 16, 2010

Laminating Cost At Staples

FACEBOOK Email

recently, I wondered if Facebook, you could send files as email, and today 16 November 2010. a story is to spread around the Internet, that has already FACEBOOK with e ( @facebook.com ).

These are some of the features of facebook mail:


  • text messages, chat and email together in a simple conversation

  • On, obtain and use your e-mail address optional Facebook .

  • control who can and who not to contact us through these messages Facebook using privacy settings.

  • Observe everything you've talked to a contact or number in the same conversation.

  • e-mail messages from people who do not know and mass emails are automatically placed in another folder.

  • The spam is automatically hide.


  • I'll leave the address for you to explore: www.facebook.com/about/messages/

    Monday, November 8, 2010

    Messages Write Christening Card



    guerrilla advertising.
    Recall that l a guerrilla advertising campaign is that unconventional attempts to obtain the highest degree of public response to the minimum possible resources.

    Can Woolite Be Used In Front Load Washer



    Friday, November 5, 2010

    Recipe For Popcorn Like Garretts'

    FREE ADVERTISING Snake, the snake game video

    When it comes to classic video games, Snake is one of those who has the first place, this game was born around the late 70, and till today has survived and been seen around the world despite new generations remember the Super Mario Bros. or Pac-man.

    Snake is so simple to play, and a snake is that we must feed, collecting objects that make it increase in length. The problem is that if we run into our own body or against the edges. of the screen, we die. And to prevent this, we find it more difficult as the snake grows in size.



    incredible thing to occupy the first place.