Wednesday, February 29, 2012

Another year flushed down the toilet

Wow. Exactly one year has passed since I last posted to this blog. What does that say?

Not much, really.

With the rise of Facebook, Twitter and Google+ (well, the first two) blogging for the normal schmuck has decreased leaving only folks who have something lengthy to say, spammers, and political knobs that probably have too much time on their hands. I will say that this blog came in handy today.

It was one of those scenarios where I remembered a piece of code was blogged here at some point. My employer blocks most blogger blogs (malware delivery systems) including this one so I used my mobile device that also makes phone calls to look my post up. The old blog looked pretty neat on that mobile device; formatted for the smaller display.

I took that mobile device into the bathroom stall to do some light reading while I took a dump. I went back through my old posts. I was proud of most, embarrassed by others. I began pondering if it was worth the time to go back, clean up the good posts, remove the crap, and maybe start blogging again. Then I flushed, put some music on and went back to work.

Long story short; I'll likely clean up some stuff then put this blog to rest.

It's been fun. Sort of.

There are plenty of other people on this planet to do Oracle stuff and rant about things.


Monday, February 28, 2011

I hate it when I am wrong

I recently learned that one of my blog posts about the Oracle MERGE statement has one not one-hundred percent correct statement.

"This means the DELETE does not use column data in the USING clause sub-query; very important. Some column in the UPDATE must be updated for the DELETE to work. To handle this set one or more columns to values that would never appear (in combination) in the data and use those values as a delete trigger."

From Oracle 10g 2 and higher SQL Guide: "Specify the DELETE where_clause to clean up data in a table while populating or updating it. The only rows affected by this clause are those rows in the destination table that are updated by the merge operation. That is, the DELETE WHERE condition evaluates the updated value, not the original value that was evaluated by the UPDATE SET ... WHERE condition. If a row of the destination table meets the DELETE condition but is not included in the join defined by the ON clause, then it is not deleted. Any delete triggers defined on the target table will be activated for each row deletion."

To clarify:

The DELETE WHERE condition can reference a column from the USING (the source) but the row table in the MERGE INTO (the target) must be have a column updated.

I need to do more experimentation before I correct previous posts and the best way to code for this. I am guessing that a "transaction" column can be in the source (USING) and then that can be tested on the DELETE WHERE and is part of a DECODE(u.indicator,'DELETE','i.column,u.column) so false data are not needed for columns with a NOT NULL constraint.

Wednesday, February 02, 2011

PCI compliance

Why do searches for PCI compliance on the database return only links to people selling software and or consulting services?

Thursday, January 27, 2011

New mobos and 16GB memory

So I'm going through Newegg looking at motherboard plus AMD processor combo deals, tempting myself to spend money. I want a system with 16GB of memory so I can do virtualization (as in Windows DC, SQL Server, Oracle Database all running at the same time). The first five motherboards I look at support 16GB of DDR3 memory in their specifications at Newegg and at the manufacturer website but when you look at the memory compatibility list NONE of them have verified configurations with 16GB of memory. NONE of them. How can you claim support without verification? The most common verified configuration was 2GB of memory. Who the FRAK buys a high end motherboard with the intent of having only 2GB of memory. That will barely run Windows 7 Ultra Professionasupercalifrakkinfantastic 64bit turbo while watching Blue-Ray movies and playing Crysis 2 full screen at 2 billion frames per second.

Friday, January 21, 2011

VMWare teams, part one

I'm fartin' around with Teams in VMWare Workstation and publishing steps I have used.

Team

What you will need:

  • Windows Server 2008
  • VMWare Workstation
  • hardware with at least 4 GB of memory and 200 GB of disk
  • patience
  • some beer or alcohol of choice helps too

Steps:

  1. Create a Team
  2. New Team; named SewerSystem
  3. Don't add VMs yet
  4. Add one LAN segment
  5. Finish

VM1 - Domain Controller

Steps:

  1. Add new VM; Typical for Windows 2008 Server Core (easy install) SepticTank located in the SewerSystem directory
  2. Modify VM configuration to have a single NIC on the LAN segment
  3. Let easy install do the OS and VMware tools, create a user called sadmin
  4. Log in as sadmin after installation completes and reboots a couple times; there should be a command window:
  5. netdom renamecomputer %USERDOMAIN% /NewName:DC1
  6. netsh interface ip set address "Local Area Connection" static 192.168.0.1 255.255.255.0 192.168.0.1 1
  7. net user Administrator Passw0rd1234
  8. shutdown /r /f /t 0 /d p:2:3 /c "STFU"
  9. start /w ocsetup DNS-Server-Core-Role
  10. dcpromo /unattend /AutoConfigDNS=Yes /DomainNetBiosName=grouchnet /NewDomainDNSName=grouch.net /ReplicaOrNewDomain=Domain /NewDomain=Forest /ForestLevel=3 /DomainLevel=3 /SafeModeAdminPassword="Passw0rd1234"
  11. net user a-grouchy "Passw0rd1234" /add /fullname:"A Grouch" /domain
  12. net group "Domain Admins" "a-grouchy" /add /domain
  13. net user e-grouchy "Passw0rd1234" /add /fullname:"A Grouch" /domain
  14. net group "Enterprise Admins" "e-grouchy" /add /domain

Step descriptions:

  1. duh
  2. duh
  3. duh, the easy install can't log in as Administrator so create one
  4. duh, I had to log in once or twice and reboot
  5. rename computer
  6. set NIC to static IP
  7. set Administrator password (was blank)
  8. reboot
  9. configure DNS
  10. configure domain controller (reboots)
  11. add a domain admin user
  12. add to the domain admin group
  13. add an enterprise admin user
  14. add to the enterprise admin group

References:

Thursday, January 20, 2011

VMWare host-only network, part one

I'm fartin' around with host-only networking in VMWare Workstation and publishing steps I have used.

VM1 – domain controller with DNS

What you will need:

  • Windows Server 2008
  • VMWare Workstation (will differ for other virtualization products)
  • hardware with at least 4 GB of memory and 200 GB of disk
  • patience
  • some beer or alcohol of choice helps too

Steps:

  1. Create a VM for Windows 2008 Server (easy install)
  2. Modify VM configuration to have a single NIC, host-only network
  3. Let easy install do the OS and VMware tools
  4. Log in as Administrator then set up the NIC with a static IP address (usually 192.168.xxx.yyy with yyy usually 128, subnet 255.255.255.0 default gateway 192.168.xxx.001)
  5. Personal preference: change the computer name and description from the default WIN-K7AATU-BARADA-N1KT08 to something reasonable and easy to remember
  6. Reboot
  7. Log in as Administrator
  8. Run dcpromo.exe; Active Directory Domain Services will begin installing
  9. At the Active Directory Domain Services Installation Wizard leave "Use Advanced mode installation"; Next
  10. Next
  11. Create a new domain in a new forest; Next
  12. Enter a Fully Qualified Domain Name of the forest root domain (grouch.net, b.org, example.com, ...); Next
  13. Select Windows Server 2008 as the Forest Functional Level; Next
  14. In Additional Domain Controller Options page, select DNS server; Next
  15. Click Continue for the manual delegation message
  16. Accept the defaults for database, log files and SYSVOL folders; Next
  17. Enter a Directory Services Restore Mode Administrator Password (DSRM); Next
  18. Summary; Next
  19. Check Reboot on completion then go get a beer or five
  20. Log in as Administrator of your new domain controller and finish your beers

References

Wednesday, January 19, 2011

Throw some server at it

From one developer to another; use as much memory and resources as possible because the servers can handle it and we need to make our lives easier.

There are a few vomit inducing things that pop into my mind when I hear things like that.

I fully comprehend and realize that the days of C.I.C.S. and nitpicking over kilobytes of memory are over in favor of get it done now and throw resources at it world of today. We have scalable clouds now, right? Why bother doing something efficiently when you can just do it, get it done and make yourself look good (or save your job, or make your resource manager look good). Just add another node.

Something has to give somewhere though.

As noted in a previous post, adding a millisecond to each transaction might seem like nothing in the long run but when millions of transactions are taking place and those milliseconds multiplying like those bunnies from that Monty Python movie; there will be performance issues.

Then the developers complain to the system administrators and users complain to the help desk (who also complain to the system administrators) and web users complain or simply take their business elsewhere which causes the business units to complain to their managers who meet over lunch at a bistro with IT managers who then order the system administrators to fix it.

Resources are finite, even in a cloud.

Resources are finite on the client, too. Many in the younger generation would rather do things on their phones than sit in front of a computer and not every phone has Flash, Silverlight, etc. or enough display space to handle the additional burden of poorly conceived code.

I just thought of a business model. I'll ask your managers if they are having performance problems and then charge by the hour to point out issues that will cause a crap-ton of meetings, lots of paper to be printed, and inner turmoil to increase between the development staff and administrators while users think I'm a minor god (or something).

Monday, December 13, 2010

Another crapplication

It never ceases to amaze me how software that sells for five figures or more can contain so much shit code. My most recent example: I noticed a CPU hogging process running on our Oracle server and was astonished at two things. First thing was a SELECT * in a static query containing eight inner joins. The second item was that same statement (and over 3000 almost identical statements) was not using a bind variable in the WHERE clause for the primary key (a VARCHAR2(254) containing a GUID).

There is no excuse for production code containing a SELECT * from any number of tables. What made this example even more inexcusable was the table contained a BLOB and judging by the pattern of other SQL statements these queries were pulling back a description and last updated by date.

There is only one excuse that I know of to NOT use bind variables in prepared statements. To be honest, I do not know if this is one hundred percent true of Oracle or other databases, but if the query is selecting by status or other column where the difference between the counts of the values is extreme then it would be best to not use a bind variable on that status. If a table contains a billion orders where status is filled and a couple hundred with a status of cancelled and the query is selecting only by status then using a bind variable might not provide an optimal plan for both situations (it might use a full table scan on filled and index for cancelled). In the above example, the software was creating, parsing, opening, fetching then closing the same logic SQL thousands of times when it should have created, parsed once then bound and executed (reused) thousands of times. It was a single row select by primary key (a GUID even) and that should always be done using a bind variable.

The developers might not be at fault here. The above scenario reeks of poor, generated, object oriented code. Get the primary keys for all of your data objects then read them one by one to display on some dumb-ass web page. More likely: read incoming XML data stream into business logic tier then instantiate all the needed business and data turds then have the business turds use the data turds to retrieve data using the exact opposite of a single, bound, efficient SQL statement, then convert the results of all the turds to XML so the rendering engine can puke it out to a web browser, iDroid, dumb phone, really dumb phone, tablet, pad, tampon, car dashboard, HAM radio or intelligent kitchen appliance.

What frustrates me is that I am seeing this crap in a pricey application. I would be tolerant it were coming from some schmuck trying to write an application to pay his (or her, no wait, probably his) way through college. This application has numerous customers, all of which are suffering with this crapplication and the unlucky system administrators are stuck between the bean counters and the vendor when attempting to tune the piece of weasel poop.

A good Ask Tom article

Tuesday, November 23, 2010

HTC EVO the first month

I have had my HTC EVO for over a month now. The experience has been good so far.

I have a couple of nitpicks. The message indicator light should flash while the device is connected to a charger or USB. SMS messages and mail messages should have the option of repeating the notification tone until responded to (like a pager).

Battery life is poor but what can anyone expect. Does anyone really believe they will be watching HD video over 4G without sucking that wafer-thin battery dry in less than an hour? If I rarely use the device the battery will be around 53 percent charged by the end of the day; with no Wi-Fi, 4G, Bluetooth or GPS services active. The wife uses Pandora all day at work so she leaves the phone attached via USB all day. Anyone texting, talking and Facebarfing and Twitching all day will likely not have a charge at the end of the day.

The 4G service is now available around my house out in the middle of nowhere but does not appear to be available in downtown Columbus where I work (strange). When I ran speed tests using 4G I was getting very mixed results depending upon where I was and what destination I was hitting. The down speed was comparable with Wi-Fi but the up-speed was much faster about half the time. The whole 4G experience is going to need a year or two before it is widely usable and stable and firmware for phones with that service is stable.

I have also paid my first bill. The initial shock took a few beers to get through.

Tuesday, November 16, 2010

Bye to Schelotto, Hejduk, more

It is definitely a sad day for the Crew organization but in the long run it is just a day. We all knew that good guys like Oughton and Hejduk that have put a face on this team would no longer be able to contribute toward the common goal of the organization and most fans; hardware. Legends like Schelotto that brought class and talent would eventually either move on or be pushed out. Even Padula, the pirate at left back, who just a season or two ago was considered the key component of the Crew championship run, would fade away.

I think what makes today really hard to deal with is the sudden harshness of the events. Our season was over in an instant with a missed penalty and most of the heart, soul and leadership is likely gone just as abruptly. As the shock of the playoff loss set in maybe only a handful of people realized that would be the last time they would see those four players in a Crew uniform; it sure did not for me.

As mentioned in my previous blog post, I was hoping Schelotto was going to be retained one more season to help teach and shape the attacking midfield and his successor. That is what he should have been doing this 2010 season; getting his replacement ready and perhaps even using his last season as a rallying point to will the rest of the team back into the finals. Instead it is an abrupt end that will leave a bitter taste.

It is easy to feel like twice shat feces about this but it is now up to the Crew organization to deliver. They want to go young, fine. Fans have survived youth movements with each coach before Bob. 

The most important priority now is to get that skilled player and face for the Crew. My wife knows little about soccer but she knew who Schelotto and Hejduk (the surfer dude with the long hair, no!) were and more importantly what they brought to the team: he was their best player and he was one of the favorite players (big fan favorite, remember the pictures of him in the north end). 

We still need a finisher up top. I like Renteria but seriously, it is about time we invested a little more at the position beyond what we have done before.

I also am willing to hold off on judgment until we get some results. It will be months and a couple of drafts before the Crew will know where they need to throw their money. That is going to be a long, suck-ass couple of months, too. We were fortunate to have Schelotto and Hejduk while they were here and should be thankful for it. It is now up to the Crew to find the next group of players for us to be thankful for.

Also, just read on the forums: Barley's Christmas Ale Guest Tapper: Columbus Crew captain Frankie Hejduk