Mike Ault's thoughts on various topics, Oracle related and not. Note: I reserve the right to delete comments that are not contributing to the overall theme of the BLOG or are insulting or demeaning to anyone. The posts on this blog are provided “as is” with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my employer.

Monday, June 18, 2012

Father's Day 2012

Well, another Father's day has come and gone. As it falls near my June 9th birthday I usually get a combined gift, and, most times since my girls have a difficult time figuring out what I want they just give me a gift certificate, which is fine! I used my combined certificates to get a load bearing vest with a hydration bladder to go in my survival gear.

I got to spend Father's day canning with my oldest daughter. I like to cook but had never done canning before. Canning is the process of preparing foods for long term storage by boiling them to death. First you prepare what it is you want to can, it should meet certain requirements to be either water bath canned (the easiest) or pressure canned (the hardest). We just did water bath canning. First you prepare the food you want to preserve, such as fruit preserves, vegetables, etc. usually this involves some type of heating for a specific period of time, for example, for the green beans we used for Dillibeans you steamed them for 3 minutes.  You then prepare the brine solution, usually a combination of water, white vinegar and spices (which of course you boil).

Then you boil the jars and lids to sterilize them. You then add the prepared vegetables or fruit to the jar, pour in the brine, a bit of canning salt and crisper, and any additional seasoning, for example the dillibeans had some dill and a clove or two of garlic in each jar. The you seal the jars and pop them into a boiling water bath for 10 minutes or so. The boiling water sterilizes the contents of the jars and forces a bit of the air out by heating it, then when you remove the jars from the bath and they cool, the contraction of the contents and whatever air is left pulls the lid to the jar down tight, sealing it in a germ, mold and bug free environment until you open them.

The Wasabeans (which used Wasabe and red pepper for spaces) and dillibeans described above will be ready in about 2 weeks, I can't wait! I am enjoying the various Strawberry jam, butter and other sweet things right now. All in all a very enjoyable day with my daughter.

Monday, May 21, 2012

Death and Taxes

Death and taxes, we have all heard how they are inevitable. We have also heard several very rich men saying that they should be taxed more. I say, great, tax them more. In fact, why don't they start by writing a check today for the proposed difference they would be paying and send it right in, I am sure the government would be glad to accept their gifts.

It is amazing how when we look at the tax records of some of these very rich people we see that they don't give much to charity. Now, don't get me wrong, many of the ultra-rich give a great deal, but many don't even give the 10% they can claim on income taxes. If they don't want to give the money they say they want to right now to the government, how about giving it to charity?

Maybe from now on the government should immediately impose whatever tax these folks say they should have to pay on 100% of their income regardless of source. I'll bet the canaries would be singing different tunes if this were to happen.

Something tells me these rich folks have already come up with a tax avoidance scheme that would shield their incomes such that they won't pay any more than they do now even if the tax rate was set to 75%. All of a sudden, as soon as their incomes were taxed at 75%, their apparent income would drop to the point where they would not pay any thing more in taxes than they already are.

Call me cynical I guess. As soon as some one says "Go ahead, tax me more" you can bet they have something planned to defeat that tax. 

Monday, May 14, 2012

Creation or Evolution?

I've been debating (as much as you can with people who have no concept of facts) with some people about creationism verses evolutionary theory. I know, you shouldn't get down in the mud and wrestle with pigs, you can't win and the pig enjoys it. But I feel I have to help people see some truth once in a while.

Before I start let me say I am a believing Christian who has been born again and I believe in Jesus. Now with that out of the way, let me say I also believe in evolution, dinosaurs, the earth being 4.5 billion years old and lots of other scientifically proven facts and theories.

The creation myth was told to early man by his elders as a way to explain the universe and how we got here. It was limited by the knowledge available at the time. The myths were handed down for generations before they were written down. Even if they started out as truth, by the time they were codified they became a far different story than when they started.

My great-grandmother boarded a ship in Denmark as a little girl with her mother and sailed across the Atlantic to America, sometime between the time of sailing and the time she (my great-grandmother) arrived in Iowa, her mother passed away leaving her alone except for cousins. Now I have told this story to my children who may tell it to their children, etc. on down the generations. How many of the facts do you think will make it even to the third generation removed from the actual event?

 Now imagine a group of people get ostracized from their tribe who reside in a very fruitful area. Perhaps they were kicked out because they knew something they shouldn't about the leaders or perhaps because they came to a different set of beliefs. So we have a group of people that were kicked out of a paradise for obtaining knowledge. After several re-tellings and answering the inevitable "what were their names Mommy? Who were they daddy?" it becomes a single couple who fled a paradise because they gained knowledge and eventually evolves into a creation myth of a magical garden where they were cast out because they ate the forbidden fruit of knowledge. Maye they were cast out from their tribe because they wanted to wear clothes, who knows? Little things like "Who did Cain and Able marry" and "Where did the people Cain went to live with come from" seem to be glossed over, sorry, either the Bible is the whole truth as some say, or it is only part of the truth and much has been forgotten or left out, it can't be both ways.

The parallels between the universe creation myth and what scientists say really happened only differ by the timeline.

 I believe the entire issue with translation errors has been dealt with ad-nausium and I will refer the interested parties to any number of good websites or books about that subject.

The Bible's truths are the rules given show us how to interact with each other and how to live a Godly life. There are stories, myths and facts in the Bible and we must constantly strive to understand the differences. So many people want to limit God to a description written by sheep herders and fishermen 2000-6000 years ago, something simple people can understand. I prefer my God to be richer, fuller and more mysterious than those simple people could ever understand.

Tuesday, April 10, 2012

Home Schooling

I have to admit, when my daughter first said she was going to home school my grandchildren I was a bit hesitant. After all, she doesn't have a degree and wasn't exactly a motivated student for much of her academic career. But I must say I am very pleased with the results so far.

With home schooling you can spend time with the child when it is convenient to learn, indeed the entire day can be a series of learning events. My 5 year old grandson has read a book to me, does basic math and is on the verge of basic algebra. He and his three year old sister are also learning Spanish and other more complex topics through a CO-OP of other home schooling parents. I even helped a little with a science lesson but I need to do more, I just wish they, or we lived closer, it is a 60 minute drive to go visit. Of course, he is also more computer savvy and likes his learning games that he is allowed to play 30 minutes a day.

At a recent consignment sale Michelle picked up a lap harp and a whole pile of music for it, now Mikie loves to play that as well and does a bang-up job too! Once he develops a bit more hand strength and coordination she plans to start him on guitar and dulcimer, he already loves to sing. I guess I need to dust off the woodworking tools and build him a Dulcimer of his own. Of course I have also seen a place where you can get a kit that has cardboard and wood that you can use build your own Dulcimer, maybe he and I can do that as a project once he is old enough.

With all the troubles we hear about in schools these days, I am really starting to like the home-school option, combined with a good CO-OP with other like-minded parents the kids can be taught more, get socialized and in many places even opt to play on regular school's sports teams should they desire.

With home schooling Mikie and his sisters (Hannah and Lily) get to spend lots of quality time with Michelle, and learn to help with home chores. They help tend the chickens, help with house work, and Mikie really likes helping his Dad with the various maintenance tasks around the house. The kids also get plenty of outdoor playtime. One of their gifts this last year partially from us was a really nice wood play set outside where they can climb, swing and role play to their hearts content.

I am looking forward to helping with science and math as Mikie and his sisters progress. Of course it won't be long I fear before they start asking questions I can't answer!

Thursday, April 05, 2012

A Morning Walk

In an attempt to die at the slowest possible rate I have started walking a mile each morning (that I remember). In order to keep from being bored, I try to keep a count on the squirrel population, with the cost of meat these days I may be cataloging future meals, you never know.

Anyway, the average for my mile walk so far is about 20 squirrels now how that compares to national averages I don't know, but they seem happy and healthy and are enjoying the bumper crop of maple seeds this this year. I also watch for interesting birds and anything interesting my neighbors may or may not be doing. To tell you the truth, so far my neighbors are fairly boring, the usual yapping dogs, odd looking cats and over done yards. With the kids out for spring break (remember before the PC era it was called Easter break?) I don't even get to see the latest clothing fads as I pass them at the bus stop.

On my walk this morning I saw a relative rarity (no, not a teenager up before noon) I saw an albino squirrel in the wild. White fur, pink eyes, pale skin, the entire albino genome in a compact package. Of course small albino animals of any ilk are rare because being different makes them stand out from the rest of the herd (or is that a dray or scurry for squirrels?) and makes it hard to hide from predators.

I am sure there is a cosmically important lesson there but I haven't had enough coffee to decipher it from the background noise. Anyway, the brain may actually be awake enough no face AWR and Statspack report analysis now (for those not aware, Oracle databases use these to tell me what is wrong with them) so I will close for today, time to rejoin the scurry!

Tuesday, April 03, 2012

Civics 101

The founding fathers set up the government with three branches: The Legislative, the Executive and the Judicial. These three branches where set up to provide checks and balances against each other to prevent any one branch form getting too much power. The Legislative consists of the Congress and the Senate, the Executive is the President, Vice President and their various helpers and of course the Judicial is the Supreme Court.

The Legislative creates the laws and sets the budget. The Executive has veto power over the laws made, sets policies, deals with foreign powers, etc. and the Judicial makes sure the other two follows the constitution and sets precedents used by lower courts to judge the constitutionality of the various states laws and other issues.

Now we have a POTUS who feels the the Supreme court shouldn't overturn his favorite law because they aren't elected. He actually said it was unprecedented which means that the Supreme court has never overturned laws passed by the legislative branch. As a point of order over 158 laws passed by the Legislative branch were found unconstitutional. It is the job of the Supreme court to overturn unconstitutional laws. Supposedly the POTUS is a constitutional scholar, I wonder which constitution?

Monday, March 26, 2012

A Tragedy Unfolds

Trayvon Martin was killed by a gunshot from George Zimmerman's handgun. This is an undisputed fact. However, what led up to George feeling he had to shoot Trayvon is what is in doubt.

From what we can piece together Zimmerman is a self appointed neighborhood watch that has made over 40 calls to 911 over the last year. Zimmerman has made so many calls he is almost considered a nuisance to the local police. Needless to say this shows a certain zeal for being a neighbor hood watch almost bordering on obsession. Zimmerman reportedly desired to be a policeman according to some reports.

Trayvon Martin (despite the cute 14 year old he is pictured in the press) was 17 years old and black. He was wearing a gang related item of clothing, a hoodie. Now, I have worn hoodies and I am sure many of you have, there is nothing inherently damning by wearing a hoodie. However, would I wear a known gang related item in an area where it might be misconstrued? Probably not. Anyway, Trayvon, according to testimony, had left his fathers house and was walking to a local convenience store to get a few harmless items (tea and candy of some sort)when the shooting occurred.

From what has been pieced together Zimmerman spotted what he considered to be a suspicious person in an area where crime was on the uptick, someone he didn't recognize as a part of the neighborhood. He called 911 and started to follow Martin in his vehicle. Martin, noticing he was being followed pulled his hood up and started moving faster. At this point Zimmerman was told by the 911 operator not to pursue him. He did anyway, after losing him, he parked his vehicle and looked around on foot. What happens next is still not clear.

Zimmerman apparently pursued for a while, then started back to his truck, at which point he was supposedly attacked by Martin from the left rear. Now, does the act of stopping the pursuit then put Zimmerman back under the protection of the Castle law?

Castle law where Zimmerman resides states that when attacked you have no duty to retreat, that you may defend yourself up to and including lethal force from a concealed weapon. Zimmerman had a concealed weapons permit and carried a pistol.

An eyewitness has stated he saw Trayvon on top of Zimmerman, hitting him in the face and pounding his head into the concrete, pleas for help, identified as either coming from Zimmerman or Trayvon are recorded on 911 tapes. The witness went to a different window to get a better view, when he looked back out, he saw Trayvon laying on the ground and Zimmerman by him with the gun. The police showed up 2 minutes later. Zimmerman was bleeding from his nose and the back of head and the back of his clothes were wet from the grass.

So, what happened? Who knows, what you feel happened will be colored by your viewpoint. Both Zimmerman, and I am sure Trayvon, felt justified in whatever they did. Was Castle law to blame? I assume the detractors would have us all run from any confrontation, giving over anything asked us up to and including our money, health and even life before hurting someone else. However, places where you are required to flee until your back is to the wall and only then can you defend yourself, have a terrible record of fatalities. Those places that have a requirement to flee also have strict gun laws thus insuring an unarmed populace not able to defend themselves.

Zimmerman should have stopped following Trayvon as soon as the 911 operator told him to. Since Trayvon was not presenting a threat Zimmerman should have reported him, then gone on about his business. So in pursuing Trayvon, had Trayvon attacked him, Trayvon would be in the right in accordance with the Castle law as Zimmerman had become the aggressor. However, if it happened as Zimmerman has said, and, the physical evidence as presented thus far seems to support, that while he had been pursuing Treyvon, he lost sight of him and was returning to his truck, thus, no longer the aggressor, when he was attacked by Trayvon, then the Castle law comes back to being on Zimmerman's side. If Zimmerman felt that he had no other recourse, then using his concealed weapon was his right under the law.

At 6 foot and 160 pounds to 5'9" (no weight given) Trayvon had reach and possibly strength on his side. At 17 I was only 150 pounds at 5'10" and I could press 200 pounds, run 5 miles, swim a mile and was pretty fast with my hands. If I had attacked an older, out of shape man, I feel I could have won the day. The picture shown of Trayvon is not of a 6 foot 160 pound teenager, it is apparently of a 14 year old that looks maybe 5' 6" and a little over 100 pounds if that. Let's see a current High school picture. Oh, right, that wouldn't garner the same amount of sympathy.

It will be interesting to see how this tragedy unfolds, I would not want to be on the jury if it comes to that. My prayers go out to Trayvon's and George's families as both will suffer from the consequences of this for years to come.

Tuesday, March 20, 2012

Spring is in the air

Spring is in the air, literally here in Atlanta. Our pollen count is at 9000+ and rising and a yellow haze envelopes everything turning all cars into yellow taxi wantabes. With the warmer weather my thoughts turn toward scuba diving. Of course that means I need to get the regulators in for servicing at $90 a pop, see what tanks need to be inspected and which ones hydroed. I guess there is a cost for everything.

I also think about fishing. Standing hip deep in rushing cold water, flipping the fly out into just the right spot and feeling that sudden tug that shows the trout (or any other fish) has taken the challenge and wants to play. Hmmm...fresh caught trout fried with a little butter, dill and lemon juice.

Of course the barbecue season is already in full swing, had friends over already for hamburgers and hotdogs. Cooked some great pork chops the other day and some barbecue chicken. Maybe this weekend I'll pull out the last venison roast and rubbed with olive oil, seasoned with sage and garlic and wrapped in bacon, cook it over a slow fire until it is falling apart...

Also time to start planting the garden. Tomatoes, peppers, maybe some snow peas (if I can keep the neighborhood deer away) also spinach, maybe strawberries...

Well, time is flying by, so must close for now, spring is calling!

Wednesday, March 14, 2012

Working Hard on New Novel

Well, I have 122 manuscript pages single spaced so far, that is about 220 book pages. I seem to be adding about 5-10 pages a week. Things are reaching the climax as the several threads of the story come together. I plan on submitting this one to a small press my good friend and fellow author (Bottom Dwellers) Shane Etter uses. Shane's next book, titled "Forest Dwellers" is going in to the editor shortly and should be available soon.

My new novel will be entitled "Prelude to Darkness" and details the effects of an EMP on the main character, his wife, their neighbors and of course the antagonist...each is a separate story line woven together to reach a climax that should be great I hope!

If you haven't seen my other attempts at novels they are shown on Scubamage and can be purchased there if you are so inclined! Well, enough catching up, I have some writing to do!

Sunday, March 04, 2012

Pondering on a Saturday Morning

I have been keeping up with old interests lately. Reading about the space program (or lack thereof) and potential consequences of continued space exploration and exploitation. Of course I chose the words consequences and exploitation deliberately, as did the writers of the articles I read, as they have a negative connotation to most people. I chose them to demonstrate deliberate slanting, they chose them to do deliberate slanting of their message. They took articles which could have been encouraging and uplifting and made them deliberately negative by simple word usage, essentially damning them by faint praise.

In one article they worried over what would happen should we mine the moon for He3 (supposedly needed for fusion) and pondered our damaging the eco-system of the moon (please, stop laughing, they were serious!) They also questioned whether we should seek to do even limited terra-forming of the moon or Mars, again sighting fears over damaging geologic or microscopic eco-systems. I guess it is better to leave all our eggs in one basket (Earth) and just hope our good intentions will prevent a super-flare or stray asteroid from ending us.

Another article fussed about “What will future generations due if we use up the fossil fools or natural gas?” well, they will do what future generations have always done, find something better! I have always contended that fossil fuels, natural gas and nuclear fission are bridge technologies to get us to future technologies. Whether those future technologies will be based in fusion (cold or hot) or in zero-point energy or in some heretofore unknown technology I don’t know, but future generations will!

The big problem with many people in the media industry is they can’t see past their limited technological education. With science and technology taking such a low rung on the education ladder these days (after all, it makes little Johnnie feel bad to not be smart enough to understand it, so we will skip it) it is no wonder journalists feel so threatened by it. We are all limited by our horizons. The closer and safer we make those horizons the more limited is our world view and the fewer options we have. Many people need a good dose of science fiction! We used to base our future on doing the impossible, climbing the unclimbed mountain, going where no one has gone before, now we don’t even have a space program to speak of unless we go begging off the Russians (President Kennedy is spinning in his grave while Nixon is dancing a jig in whatever of the nine-hells he is in.)

Unless we rekindle the imaginations and invest in the future of our children by doing so, we are in for a rough ride. I fear we may be on the slide down into obscurity here in the USA. Unless we can revitalize speculative thinking we are doomed.

Friday, March 02, 2012

Using Flash Cache

In this final test series we will compare the best result from the memory only, Keep and Recycle and first rows tests with the best result with a flash cache set. Tests were completed comparing using a slightly faster server mounted PCIe flash cache to a flash based san so the results will not be as dramatic as when testing server mounted PCIe flash cache against disk based storage.

The flash cache was sized at the suggested 2X the database cache size (90 gb) and then a run with the flash cache set to zero was run. Note that for the first run appropriate tables and indexes were assigned to be kept in the flash cache, other tables where set to default. Figure 1 shows the results from use of the Smart Flash Cache with Flash as storage.



Figure 1: TPS verses GB in the Flash cache

At least for our testing with the database on a RamSan630 SSD and the flash cache being placed on a RamSan70 PCIe card, the results are not encouraging towards the use of the flash cache with a flash based SAN. Review of the AWR results showed that the flash cache was indeed being used but, due to the small difference in overall latency between the RS630 with IB interfaces and the RS70 in the PCIe slot, the overall effect of the flash cache was negligible. The next figure shows the AWR Top Five Events listing both with and without Flash Cache set.

AWR Results
AWR Results
Flash Cache set at 90 GB:
Avg
wait % DB
Event Waits Time(s) (ms) time Wait Class
------------------------------ ------------ ----------- ------ ------ ----------
DB CPU 25,339 53.7
log file sync 11,775,317 13,146 1 27.8 Commit
db flash cache single block ph 3,991,869 3,745 1 7.9 User I/O
db file sequential read 6,192,796 3,588 1 7.6 User I/O
latch: cache buffers chains 169,292 251 1 .5 Concurrenc

Flash Cache Set at 0 GB:
Avg
wait % DB
Event Waits Time(s) (ms) time Wait Class
------------------------------ ------------ ----------- ------ ------ ----------
DB CPU 26,414 53.9
log file sync 12,139,355 14,138 1 28.9 Commit
db file sequential read 11,548,371 7,373 1 15.0 User I/O
enq: HW - contention 23,317 859 37 1.8 Configurat
latch free 7,922 402 51 .8 Other

Figure 2: AWR Results with and without Flash cache

Disk with Flash Cache
Since the test with a flash utility against an internal PCIe Flash card proved inconclusive we decided to have the lab hook up some disks and re-run the tests using a disk array containing 24-10k 300gb disks for the tables and indexes. The DB_CACHE_SIZE was increased to 50gb and the DB_FLASH_CACHE_SIZE was set to 300gb. Figure 3 shows the results for a disk array with and without a 300gb flash cache.



Figure 3: Disk verse Disk plus Flash Cache Performance

As you can see from reviewing the graph, the Flash cache definitely helped performance at the all levels of our user range. It also showed that with the same hardware the sustained performance increase could be extrapolated to a larger number of users so in the case of using flash cache with disks, yes, performance is gained.

While running this test I had indication that over 160 gigabytes of data blocks were cached in the flash cache. Figure 4 shows the SQL script used to determine flash usage for a single user and Figure 5 shows an example of its output during test runs.

set lines 132 pages 55
col object format a45
select owner||'.'||object_name object,
sum(case when b.status like 'flash%' then 1 end) flash_blocks,
sum(case when b.status like 'flash%' then 0 else 1 end) cache_blocks,
count(*) total_cached_blocks
from v$bh b join dba_objects o
on (objd=object_id)
where owner = upper('&owner')
group by owner, object_name
order by owner,4 asc;

Figure 4: SQL Script to see cached objects for an owner

OBJECT FLASH_BLOCKS CACHE_BLOCKS TOTAL_CACHED_BLOCKS
------------------------- ------------ ------------ -------------------
TPCC.C_CUSTOMER_I1 15249 0 15249
TPCC.C_STOCK_I1 15863 0 15863
TPCC.C_NEW_ORDER_I1 15875 18108 33983
TPCC.C_ORDER_I1 37838 6308 44146
TPCC.WARECLUSTER 63562 450 64012
TPCC.DISTCLUSTER 59511 4504 64015
TPCC.NORDCLUSTER_QUEUE 45764 56100 101864
TPCC.ORDR_UK 94404 40801 135205
TPCC.C_ORDER 123514 67081 190595
TPCC.C_CUSTOMER_I2 202994 51896 254890
TPCC.C_ORDER_LINE_I1 383833 26284 410117
TPCC.C_ORDER_LINE 873325 64108 937433
TPCC.ORDL_UK 1073711 38760 1112471
TPCC.CUSTCLUSTER 1940874 124103 2064977
TPCC.STOKCLUSTER 5508278 3055117 8563395

Figure 5: Example use of Flash Cache
Just to put things in perspective, let’s put the top pure-Flash database results against these disk and Flash cache results. Look at Figure 6.



Figure 6: Flash only, Disk Only and Disk plus Flash Cache Results

In reviewing Figure 6 you should first note it is a logarithmic plot, which means that for each change on the left axis there is a factor of 10 change. This figure shows that using pure flash far outperforms even the best we can expect from a combination of flash and disk. In this case by nearly a factor of 7. The peak performance we obtained from our disk combined with a Flash cache was 1024 TPS, while the peak we obtained in our flash tests (see next section) was over 7000 TPS. Even in previous testing with larger disk arrays (90+ 10K drives), the peak performance I obtained from disk arrays was only in the 2000 TPS range, again showing that SSD technology is superior to any equivalent disk array.

Tuesday, February 28, 2012

Using KEEP and RECYCLE Pools

We are all familiar with using DB_CACHE_SIZE either directly or by proxy using the SGA* or MEMEORY* automatic memory management settings. We know that generally speaking, adding memory to DB_CACHE_SIZE will improve performance until we have satisfied the memory requirements supporting single block, recursive reads. What happens if we add in KEEP and RECYCLE areas?

To refresh your memories, the KEEP area is a memory cache used to store object blocks that you don’t want to have aged out of the cache. The RECYCLE area is a cache area designed to hold frequently changing or blocks that you don’t want to keep.

In order to effectively use the keep and recycle pool areas, database objects such as tables, indexes and clusters must be assigned to the appropriate pool. The default, understandably, is the DB_CACHE_SIZE controlled (SGA_*, MEMORY_* controlled) pool. For these tests the following objects in a TPC-C schema where assigned as shown:

Cluster: CUSTCLUSTER – RECYCLE
Contains: C_CUSTOMER table
Cluster: DISTCLUSTER – DEFAULT
Contains: C_DISTRICT table
Table: C_HISTORY – RECYCLE (This table is partitioned)
Cluster: ITEMCLUSTER – KEEP
Contains: C_ITEM
Cluster: NORDCLUSTER_QUEUE - DEFAULT
Contains: C_NEW_ORDER table
Table: C_ORDER – DEFAULT
Table: C_ORDER_LINE – DEFAULT
Cluster: STOKCLUSTER – KEEP
Contains: C_STOCK table
Cluster: WARECLUSTER – DEFAULT
Contains: C_WAREHOUSE table

These assignments were made based on how the table was used and if it is frequently changed. Using the cache advisors in the AWR reports from test runs the sizes of the special caches were optimized. Tests were run with the caches turned on and turned off to determine what affects the caches had on performance. With the caches turned off the memory they utilized was returned to the default cache. Using a maximum allocation of 40 gb for Oracle cache areas the basic settings for the memory areas were:

NO_K_R_40:
DB_CACHE_SIZE=40gb
DB_KEEP_CACHE_SIZE=0gb
DB_RECYCLE_CACHE_SIZE=0gb

WITH_K_R:
DB_CACHE_SIZE=30gb
DB_KEEP_CACHE_SIZE=4gb
DB_RECYCLE_CACHE_SIZE=5gb

WITH_K_R_2: (As advised by the cache advisors)
DB_CACHE_SIZE=30gb
DB_KEEP_CACHE_SIZE=7gb
DB_RECYCLE_CACHE_SIZE=3gb

This figure shows the effects of use of the keep and recycle pools on performance.



Figure: TPS verses GB in the Recycle and Keep Caches

NOTE: You cannot use either DB_KEEP_CACHE_SIZE or DB_RECYCLE_CACHE_SIZE with the DB_FLASH_CACHE_SIZE or DB_FLASH_CACHE_FILE settings, if you set up to use both keep and recycle and flash, the flash doesn’t appear to get used.

So, if you have memory available and are in a situation where db file sequential reads are generating waits, assigning appropriate tables and indexes to the KEEP pool can boost performance. If you have large tables that you only want to use a working set from and then discard it, the RECYCLE cache can help.

Friday, February 24, 2012

Don't Forget Optimizer Parameters!

One factor that dramatically affects the processing of Oracle queries is the setting of the OPTIMIZER_MODE initialization parameter. By default this parameter is set to ALL_ROWS which will attempt to optimize the SQL statements to return all rows form the queries in the minimum amount of time. ALL_ROWS will choose full scan options such as sort-merge-join and hash-join over paths that return initial rows the fastest such as a nested-loop. While ALL_ROWS may be a good setting for decision support or data warehouse databases in online transaction processing (OLTP) systems most queries will return very few rows, so one of the settings of the FIRST_ROWS_(n) value for the OPTIMIZER_MODE should be utilized. The (n) settings are 1, 10, 100 and 1000. In my testing using a TPC-C-OLTP type benchmark (using Benchmark Factory), varying the FIRST_ROWS setting from 100 down to 1 changed the results from 4500 up to 6900 tps, nearly a 53% improvement. From ALL_ROWS to a setting of FIRST_ROWS_1 the performance improved from 4200 to 6900 tps, a 64% improvement. This shows that OPTIMIZER_MODE must be set correctly to get the best performance for your system. In this case the TPC-C is a pure OLTP system so a FIRST_ROWS_1 Setting makes sense. The following graph shows the effects of switching the OPTIMIZER_MODE settings.



Figure : Effects of changing OPTIMIZER_MODE

All of these results were generated using a single RamSan630 for all database files. Utilizing a 24-10K rpm disk array the best result obtained was around 600 tps.

Wednesday, February 22, 2012

Basics

A recent problem with the phone company here in Georgia brought to mind that basics are called basics for a reason. I was traveling for a couple of days and the wife was staying with her mother while I was gone. I called to pick up any voice mails that might have been left as I was expecting some important calls. Imagine my shock when I received a message saying “We are sorry, this number has been disconnected” for both the home and home office numbers.

I called the technical support line and after nearly an hour (mostly on hold) I was told the issue would be resolved within 24 hours. Of course you know what happened, in 24 hours I was back on the phone with a different support person who told me the same thing and again the next 24 hours later. On the third call they said there was an order that no one could see that was preventing any further orders from being processed on the account.

In the old days we would have called this order that no one can see a hanging tuple or an orphaned record. This means a record was inserted into the ORDERS table without a corresponding entry in the CUSTOMER table (just taking a swag here). Now when someone tries to insert a new record into the ORDERS table the primary key (probably containing a composite of phone number and something else) keeps them from inserting a new value.

Now, I happen to know this phone company is using Oracle as their support database that logs the support requests and tracks them. In a properly designed database referential integrity between the CUSTOMER and ORDERS would prohibit an entry into the ORDERS table without a corresponding entry residing in the CUSTOMER table. This is if the referential integrity is defined at the database level and enforces with optimized, internalized database triggers.

A few years ago, in tandem with the whole object oriented design paradigm and tied in with the rapid design methodologies and with the “Let’s make it generic so if we have to change databases we can” movement, the referential integrity was moved into the application code. What this did was open the database to the possibility of entering bad data if you didn’t use the application, or, if the application has an error. Now, this is all supposition on my part but it appears either there is a glitch in the application logic (but why would it only effect one customer?) or someone did some manual inserts, updates or deletes on the database bypassing the application logic.

This is what happens when you ignore basics and try to rewrite things into the application layer that should be left to the database engine. So now I am on a full week without home or home office phones. What is that little gizmo you can plug into the computer and get phone service through? I think I have their website here somewhere…