Mike Ault's Blog

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.

Wednesday, September 25, 2013

How is publishing a successful book like Nuclear Physics?



You are probably looking at this title and wondering what the heck I am talking about. Let me explain. When I was in the Navy I was a Nuke, that meant we attended 2 years of training where a $20K dollar (in 1973 dollars) education was shoved where the sun don’t shine one nickel at a time. In that training we learned nuclear physics, chemistry, electrical theory, fluid dynamics and heat transfer, in short, anything they thought we would need to run a nuclear power plant on a Navy ship.

One of the classes was nuclear physics in this class we learned about the nuclear multiplication formula. Now I don’t have fancy formula rendering software but here is what this formula looked like:

K=N*F*P*e*Pth*Pf

Where:

K is the multiplication factor
N is the thermal neutron production from fission
F is the probability that an absorbed neutron is absorbed in fuel
P is the fraction of neutrons that slow down to thermal energies without getting absorbed
e is the fast fission factor (ratio of total neutrons produced to total neutrons from thermal fission
Pth is the thermal neutron non-leakage factor
Pf is the fast neutron non-leakage factor

If K is less than 1 then the reactor is sub critical and if it equals 1 then the reactor is steady state and critical and if it is greater than 1 then the reactor is super-critical and power is increasing.

So…what the heck does this have to do with selling a book successfully? Well, let’s re name the terms of the equation a bit:

K = Chance that book will succeed
N is the number of books sent out/given away/available to the public
F is the probability a book will reach someone who will read it
P is the percentage of books that never get read
e is the total number of books read in the first week they are purchased over the total number of books read within the first month after they are sold
Pth is the ratio of books read within the last month that result in an additional sale
Pf is the ratio of books read within the last week that result in an additional sale

So, if a lot of books are given away/sent out/sold initially but none of them result in new sales (Pth and Pf are near zero) then the book won’t make it. As long as each book put into someone’s hands generates more than 1 additional sale each the book should be successful. If K=1 then the book will have steady sales, but not spectacular, if it is less than 1 the book is dead and greater than 1 then the sales are accelerating and the book is successful.

Ok, so it has been a slow day, see what happens when you have too many things stuffed in your head and your idle brain starts making connections….

Wednesday, August 07, 2013

DISPATCH the DISPATCHERS Parameter!

As you can tell from the title I have little use of the DISPATCHERS parameter. In the default init.ora provided by Oracle DBCA this value is set, so. Many people leave it set thinking Oracle is saying it is a good idea or best practice to have it set. From the Oracle11g manual:

“Configure the DISPATCHERS parameter if either of the following conditions apply:
You need to configure another protocol other than TCP/IP
Configure a protocol address with one of the following attributes:
  • ADDRESS (ADD or ADDR)
  • DESCRIPTION (DES or DESC)
  • PROTOCOL (PRO or PROT)
You want to configure one or more of the optional dispatcher attributes
  • CONNECTIONS (CON or CONN)
  • DISPATCHERS (DIS or DISP)
  • LISTENER (LIS or LIST)
  • MULTIPLEX (MUL or MULT)
  • POOL (POO)
  • SERVICE (SER or SERV)
  • SESSIONS (SES or SESS)
  • TICKS (TIC or TICK)”

Obviously, the second option is only when you have the DISPATCHERS already set. Most of the time I see DISPATCHERS set to configure the XDB protocol, for example:

dispatchers
(PROTOCOL=TCP) (SERVICE=acmedb1XDB)

Now, the question is, when do you need the XDB protocol? Going again to the Oracle11g
Manual:

“Note:
If you create your Oracle database with Database Configuration Assistant (DBCA), DBCA configures a dispatcher for Oracle XML DB (XDB). This is because XDB protocols like HTTP and FTP require shared server. This results in a SHARED_SERVER value of 1. Although shared server is enabled, this configuration permits only sessions that connect to the XDB service to use shared server. To enable shared server for regular database sessions (for submitting SQL statements), you must add an additional dispatcher configuration, or replace the existing configuration with one that is not specific to XDB. See "Configuring Dispatchers" for instructions.”

So, whether you need it or not, DBCA sets it up, even if you tell it you don’t want shared servers initialized. You will only use XDB if you are doing XML, FTP or HTTP transfers in and out of your database or if you are using APEX you will need the XDB protocol. Now, if you use XDB protocols and need DISPATCHERS set that way, then go no further, you are set correctly (however, you may want to see what this does to your system, so read on!)

So you are probably thinking: “Big deal, so DISPATCHERS is set, so what?” I mean, compared to the myriad other things Oracle creates and runs in the background on our behalf this seems a bit mild, right? Actually, no, let me explain.

Setting DISPATCHERS or setting SHARED_SERVERS turns on shared servers in Oracle. Shared servers are a means to do connection pooling in Oracle with SHARED_SERVERS configuring how many shared processes to have and DISPATCHERS setting up the master DISPATCHER processes which then serves out the connections to the connection processes setup with SHARED_SERVERS. So, if no one connects to the XDB process, shared servers are never used, so what is the big deal?

Well, shared server expects connections to be shared; certain types of shared connections must share memory areas. One example is that some types of memory sharing in PL/SQL will move form the shared pool to the large pool, this can improve PL/SQL performance form some operations, in version 9 of Oracle it was a way to prevent certain out of memory operation from happening in the SQL pool as a result of PL/.SQL. Shared servers also may require processes to share temporary segments.

This is were the rubber meets the road, when the processes must share memory areas (for example temporary segments) then those areas cannot automatically be controlled by automatic memory management and won’t fall under PGA_AGGREGATE_TARGET, MEMORY_MAX_TARGET or SGA_MAX_SIZE  or their related parameters. Processes such as parallel query slaves and RMAN backup processes fall under this set of processes as do some parallel back ground and DDL statements. In addition, if you have STAR_TRANSFORMATION set to TRUE and DISPATCHERS set, then CREATE_BITMAP_AREA_SIZE and BITMAP_MERGE_AREA_SIZE also fall out from under automatic controls.

So, what did I just say? Essentially DISPATCHERS turns off PGA_AGGREGATE_TARGET control for temporary segments for certain parallel and background processes and removes bitmap temporary sizing parameters from AMM control. Under this situation, you must use manual sort/hash area control using the SORT_AREA_SIZE parameter. In the Oracle11g 11.2 manual about SORT_AREA_SIZE, CREATE_BITMAP_AREA_SIZE, BITMAP_MERGE_AREA_SIZE:

“Note:
Oracle does not recommend using the SORT_AREA_SIZE parameter unless the instance is configured with the shared server option. Oracle recommends that you enable automatic sizing of SQL working areas by setting PGA_AGGREGATE_TARGET instead. SORT_AREA_SIZE is retained for backward compatibility.
Note:
Oracle does not recommend using the CREATE_BITMAP_AREA_SIZE parameter unless the instance is configured with the shared server option. Oracle recommends that you enable automatic sizing of SQL working areas by setting PGA_AGGREGATE_TARGET instead. CREATE_BITMAP_AREA_SIZE is retained for backward compatibility.

Note:
Oracle does not recommend using the BITMAP_MERGE_AREA_SIZE parameter unless the instance is configured with the shared server option. Oracle recommends that you enable automatic sizing of SQL working areas by setting PGA_AGGREGATE_TARGET instead. BITMAP_MERGE_AREA_SIZE is retained for backward compatibility.”

And, so far, these are the only places this is mentioned, other than HASH_AREA_SIZE, but since HASH_AREA_SIZE is derived from the sessions SORT_AREA_SIZE I am assuming that if we set SORT_AREA_SIZE, HASH_AREA_SIZE will follow, but that could be a bad assumption.

So how can you tell if this is happening in your system? First, you will get a load of sorts and temporary activities between 64K and 512 mb on your system. Check out the AWR PGA Aggregate Target histogram to see this. Why do I say that? Well, according to the released algorithm details of how PGA_AGGREGATE_TARGET works it uses the undocumented parameter ” _PGA_MAX_SIZE” to determine how much temporary area to give to specific user up to 5% of the total PGA_AGGREGATE_TARGET setting. Now on some systems this defaults to 256 megabytes and on others to 512 megabytes. So in the most current releases the 512 megabyte setting is the default so PGA_AGGREGATE_TARGET should handle most sorts and temporary actions at less than 512 megabytes without resorting to going to disk. The reason for 64k being the minimum is that is the setting for SORT_AREA_SIZE if you haven’t reset it so up to 64K the default SORT_AREA_SIZE should handle any out-of-band sort requests. Here is an example PGA Aggregate Target Histogram showing out-of-band sorts.




PGA Aggr Target Histogram

  • Optimal Executions are purely in-memory operations
Low Optimal
High Optimal
Total Execs
Optimal Execs
1-Pass Execs
M-Pass Execs
2K
4K
2,897,891
2,897,891
0
0
64K
128K
8,659
8,659
0
0
128K
256K
5,303
5,303
0
0
256K
512K
208,918
208,918
0
0
512K
1024K
5,130,286
5,130,286
0
0
1M
2M
350,877
350,877
0
0
2M
4M
6,992
6,904
88
0
4M
8M
2,686
2,632
54
0
8M
16M
4,047
4,022
25
0
16M
32M
614
588
26
0
32M
64M
1,166
1,160
6
0
64M
128M
394
381
13
0
128M
256M
227
215
12
0
256M
512M
153
149
4
0
512M
1024M
35
12
22
1
2G
4G
2
0
2
0

As you can see from the above chart only 24 out of 253 of the temporary executions-to-disk were greater than 512 MB and none were lower than 64 KB. This could indicate out-of-band sorts if the PGA_AGGREGATE_TARGET is set to a sufficient size and DISPATCHERS or SHARED_SERVERS is turned on.

Temporary space requests between 64K and 512MB that generate actual disk IO activity are called (at least by me) out-of-band sorts. The best way to clean these up is to turn off the DISPATCHERS parameter if you aren’t using XML DB and XDB related protocols. Also make sure SHARED_SERVERS isn’t set. If you can’t turn off DISPATCHERS because you are using the XDB service it creates, then set SORT_AREA_SIZE to 512MB.

When should you consider turning off DISPATCHERS?
  1. You are running a 3rd party application which makes no use of HTTP, FTP or APEX
  2. You are running an in house application that makes no use of HTTP, FTP or APEX
  3. You aren’t using XML, HTTP, FTP or APEX in your application.

One thing to remember, if you are only using XDB services for batch processing or only for intermittent connections you can actually set DISPATCHERS dynamically and turn it on and off at will. Leaving DISPATCHERS set 24x7 when you only need it for a 10 minute window at night for a batch process can cause many issues as shown above. Consider only turning on DISPATCHERS or SHARED_SERVERS when you need it.

Friday, January 11, 2013

Brain Washing

With the tragic shootings in Aurora, Colorado and Newtown, Connecticut and almost daily reports of children or young adults using violence or the threat of violence to right perceived or actual wrongs that children are spiraling out of control. What could be the cause?


In experiments with rats in high-density populations the incidents of psychotic and anti-social behavior in the rat populations soared. While the violence and behaviors in the inner-cites of places like Chicago, New York, Los Angeles and London may be explained away through environmental stress due to overcrowding, Aurora, Colorado and Newtown, Connecticut hardly fall into the super-dense population categories. What else can cause people to behave in ways that are considered inhumane and psychotic? One is brain-washing, either deliberate or accidental. In well documented cases using hypnotic suggestion and other techniques subjects, who normally would eschew violence in any form, were made to shoot, stab, blowup or in other ways harm other people, admittedly in a simulated environment, but the subjects didn’t know that it was simulated.

If you look at references about brain washing you will find they all utilize to some extent several key methods:

1. Drugs to make the subject more compliant and open to suggestion

2. Sensory deprivation

3. Sleep deprivation

4. Isolation

5. Utilize a stressor

6. Repetition of key ideas, phases and concepts

One of the most prescribed drugs for pre-and-post adolescent children is arguably Ritilin. Ritilin blocks Dopamine uptake thus increasing the amount available. This blocking of Dopamine leads to enhanced concentration and ability to stay on task, it also makes the subject more compliant and open to suggestion. Of course Ritilin isn’t the only psycho-active drug used to control behavior, Prozac, Adderall, Concerta and several others are also used. This shows we meet the first of the key methods.

In the 1950-1970 timeframe most children played outdoors and spent very little time indoors watching TV or playing video games since video games had yet to be developed. Beginning in the 80s and now coming to full bloom most children spend an inordinate amount of time glued to the TV or video games, with the TV or computer becoming a de-facto electronic babysitter. Unfortunately this use of an electronic babysitter results in sensory deprivation as only sight and hearing are usually engaged depriving the children of the full immersion sensory input that was present in outside playtime. So now we have met the second key method.

With the breakdown of the family unit and most homes requiring both parents to work, rules such as bedtimes and other key constraints on behavior have become lax. Many children are not getting the needed number of hours of sleep because of this. This we have met the third method.

TV and video games (and other computer behaviors) are isolating. Some may argue that social computing such as Facebook, Twitter and other networks are opening communication, however, these technologies lack the honesty of face-to-face communication. The person on the other side of the virtual communication could be who they say they are or someone with an agenda using the virtual communication as a means of manipulation. So rather than providing sincere communication much virtual communication can fall under the heading of propaganda, lies and falsehoods leading to further isolation from reality if that is the primary means of communication. Video games can lead to complete isolation in a made-up world, I can testify the fact that before I recognized them as the time drain they are I would spend hours, isolated and alone, striving to get to the next level of a game. So we can also show we meet item 4 of our list.

Stressors are all around us, usually we are taught to deal with them in non-violent ways. Bullying, verbal abuse and other stressors are all present to some degree in many schools causing further isolation of specific individuals. Individuals are isolated because they are different or refuse to fit in. This of course drives up real isolation and feelings of resentment making that person self-stressing in the brain-washing cycle. The feeling that everyone is against them is reinforced, sometimes over years of time, especially when ill-conceived zero-tolerance policies punish both bullies and victims equally.

Finally, what ideas or concepts are being driven into the conscious and sub-conscious brains of our children, especially those addicted to violent video games? Desensitization to violence and killing and a complete amoral attitude toward the taking of life is what most violent video games teach. Most first-person-shooters involve killing everyone who isn’t a part of your group. Now, as a child I played army, cowboys and Indians, and other “violent” games, but the guns didn’t shoot, there wasn’t splattered gore, severed limbs and carnage over and over again. At the end of the game when I was a child we all were still friends and no one was dead. We knew we were playacting with those army, cowboy, spaceman and other games and we weren’t isolated, drugged, sleep and sensory deprived and didn’t play the games for several hours each day with no other play.

Essentially we are drugging children into a receptive state, allowing them to be sensory and sleep deprived, overloading their visual and auditory senses with images of death and violence and then wondering why they behave like monsters.

Do all children exposed to video games become monsters? No, of course not. However there are a certain percentage of individuals that with the combination of the five factors mentioned will become a killer. Now, it could be argued that even without the five factors some percentage of individuals have a predilection for becoming a psychopath. In many cases, the warning signs were there to tell us the individual needed help, but in our society of political correctness we tend to overlook behaviors that would have thrown up alarm bells before suing each other became the national pastime.

So, what is the fix? For some children who are true psychopaths there is nothing you can do to stop their destructive spiral other than isolating them from the rest of the world. However, by enforcing discipline, teaching self-worth, ensuring children get a majority of their play from interactive sources external to TV and computers and eliminating or restricting TV and video game play are a start. We must also break the narcissistic me-first, entitled behaviors so prevalent in todays society. We should require strict reviews by multiple Doctors before placing children on psycho-active drugs. We need to teach conflict resolution so we can reduce the chances of violence being the only outlet for destructive impulses. In addition in schools and other social settings bullying must be mitigated and inclusion of children from diverse backgrounds taught.

If we don’t get a handle on this violence generating brainwashing I am afraid our society as a whole may face a lost generation of children sacrificed on the altar of political correctness and misguided experiments in child rearing.

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!