Thursday, 29 March 2012

Thursday Thought - Technical Omniscience

These days when I friends/family ask me for technical support, two things cross my mind
- Tim Hall
- My car mechanic analogy

To elaborate on the car mechanic thing (a story of which my wife is sick of), I propose someone might take their car to a panel beater and say "it's not working, can you fix it?"

By all appearances, a car is a car is a car. Sure it might have a few dents or scratches - but until you see/hear/smell it driving down the road you have no idea what might be wrong with it. And a panel beater might have enthusiasm for cars, but have no idea how to diagnose, let alone replace, say, a cracked head gasket.

Now I'm all up for helping people out where I can, but I'm frank and say while I've been playing/working with computers since I was 10, I don't know everything and I'm actually a database technologist for commercial applications.

So when someone says:
my pc has been crashing alot lately out of the blue. A message comes up with 'the system has recovered from a serious error'
I ask a plethora of questions.

I felt the urge to share some of my questions & responses. Partially because this is a blog and it's what you do, and I also thought I'd put it out there to see if others geeks have any thoughts on how accurate some of my responses and interpretations were. I then had a little rant about the personal computing world as it is today where I made more generalisations, accurate or otherwise.

the question, their response, my feedback
  • how old is your pc? About 7 years whoa, until I saw you replaced hard drive, double whoa! 
  • have you replaced any components? new hard drive and have upgraded to its fullest with ram. Hard drive is the #1 component by far to fail. That doesn't mean that other components in a 7 year old box aren't immune. They're manufactured to a general shelf life. In my experience, the blue screen of death (bsod) is often related to dodgy hardware.
  • installed any new software recently? I don’t think so just looking for change
  • been careful with the email attachments you download? Always, only from who i know even then you can't be sure, always check extensions and addresses. Check this out http://www.google.com/goodtoknow/online-safety/ first two sections (phishing, malware) very layman, good guides from google
  • do you get the "blue screen of death" before it resets and gives you that error? yes just making sure you got bsod
  • what does the error look like? Like the screen above and then just crashed and resets.  Get a message to email Microsoft when it reboots but never do hmm, here is where I don't have the skills to go much further, especially without seeing it. Apparently it's easy to do that remotely now, but there's so many things to keep up with! sorry!
sometimes the pc has been running really really slow so I defrag and virus scan and then it seems to be okay.  Hav ehad to do this twice in about 4 months

Long story - I've still got a tower I bought back in '05, somethings just gone wrong with it, too. I've got a external hard drive case on it's way from ebay, but my recent backup would have got most of my stuff anyway I'd say.   More of an inconvenience, especially with my ipod synced to that itunes.
Anyway, it takes a long time to do anything major (or minor), and it can only do one thing at a time. If that's you now, you've just got a second reason to upgrade. 
Defrag helps, but mainly if your moving files around a lot - creating content can contribute. Give windows time it will get lost in a paper bag.
Viruses these days come from e-mails, not floppy disks. Some through dodgy websites, but you gotta be wondering in bad neighbourhoods for that. Most concentration is on denial of service at a corporate level, and events like stuxnet
Systems like windows bloat over time. Add to that, you may have so many folders with so many items for your work, it has trouble with that, too. Especially if you have lots (thousands) of files in specific folders.
But they mainly bloat, get old, wear out, go slower than they used to. Windows. I put a different operating system on my old tower to try out - ran so much more responsive than windows - on the same pc! 
And as they bloat, they accumulate software, slowly. Patches, updates, new utilities that written to perform with today's pc's, nowhere past the pace of computer progress (double speed every 18 months - "moore's law"). 
Same goes for these new smartphones. When I replaced my iPhone with the Samsung, it felt so much faster in comparison. 2 years on, the extra lag reminds me of the 2y/o iPhone.

I know I went from faults to speed - but does your computer treat you well? Extra ram only goes so far.  
I don't know how to track down general computer faults, I generally look for changes and track backwards from there, uninstalling or whatever.
...
on a side note, the next generation of hard drives (SSD) have no moving parts. They're still fairly expensive, but becoming common-place in laptops. Hybrid models are really good.

No moving parts, less likely to break down. But they do have a life when it comes to read/write - but it's fairly long.

The conversation tapered off from there.

In short, no, I don't really know how to make your computer work again, but I still have an interest and general understanding of how computers tick.

Just because I work with computers, doesn't mean I'm technically omniscient and know how to fix every laptop, printer, fax, phone, watch, elevator, EEG, microcomputer...

Ask me about Oracle. Even then I probably only retain a small fraction of the body of knowledge that's out there, even on something focused like PL/SQL or Apex. With this topics, however, I do know where to start looking and how to start diagnosing.

Thought rant over & out.

To make a title about recursion, you've got to understand recursive titles.

Recursion, that's right, recursion, that's right, recursion. Best I stop that...


This screen shot an example showing one of Google's easter eggs that I found amusing.

In honour of creating a subtle one myself by accident recently, and the inspiration for me to add it as an option in a PL/SQL Challenge quiz question I submitted. If you're not playing, get in there, learn & have fun - who doesn't like quizzes!

The question submission stemmed from testing out a idea from reading Gary's blog post, which I found interesting, concise and thought provoking. Just something simple involving compiler directives.

For those chasing a simple example of recursion, this would create an infinite loop if executed in Oracle.
create function recursive(pc varchar2) 
return varchar2 is
begin
  return recursive(pc);
end;
/

select recursive('me') from dual;
Done!

Wednesday, 28 March 2012

Changing Oracle APEX calendar icon

Sometimes I stumble across little features that after a moment I realise - hey, that wasn't in the last version. It's good to see the APEX team tackling little improvements as well as the big ones, ever maturing product.

Then I stumble on something that I discover is not a new feature after all, just one I never really paid attention to.

When editing a theme, you can select a different icon to use as the date picker.


So instead of the elegant default:




you could use the ugly retro looking #IMAGE_PREFIX#date.gif



And the reason why I know it's from 3.x, Paulo Vale picked it up in green 2008.


Thursday, 22 March 2012

The most astounding fact

Astrophysicist Dr. Neil DeGrasse Tyson (21st century Carl Sagan) was asked by a reader of TIME magazine, "What is the most astounding fact you can share with us about the Universe?" This is his answer

Enough said, watch in wonder


http://www.youtube.com/watch?feature=player_embedded&v=9D05ej8u-gU#!

ps - love the martian sunset finale

Wednesday, 21 March 2012

AUSOUG Perth Event in March


Attention AUSOUG members - come by for a nice breakfast and listen to Sydney based Pythian DBA & Oracle Ace Yuri Velikanov!

If you're on our mailing list, you check your e-mail - if not, please contact us about joining, particularly if you think your corporation has group membership.

Where: Oracle Australia: Level 2, 66 Kings Park Road, West Perth

When: Wednesday, March 28, 2012. Breakfast starts 7:30am. Connor will speak from 8-9am, question time afterwards for those who can stick around.

RSVP: By RSVP Sunday 26th February 5pm by emailing vicepresident.wa@ausoug.org.au

Cost: Free to all AUSOUG members. Ticket parking on Walker St, just off Kings Park Road, or catch the Red CAT, with a short walk from corner of Outram/Ord.

Yury will spend around 30 minutes each on the following topics:

SCAN:
Single Client Access Name is a concept that makes database deployment easy on Oracle Database 11g R2 grids and complete the level of abstraction from the application perspective. Starting with the understanding of why this component is vital in the 11g grid infrastructure, this presentation walks through the main concepts of SCAN. You will learn how to plan and implement SCAN, what areas to be careful with, and how to monitor SCAN infrastructure and make sure it works as expected.
RMAN:
Yuri is called to audit RMAN backup scripts on regular basis for several years now as part of his Day to Day duties. He see the same errors in scripts that Oracle DBAs using to backup critical databases over and over again. Those errors may play a significant role in a recovery process when you working under stress. During that presentation you will be introduced to typical issues and hints how to address those. The author will give away a prize to any Oracle DBA who has a script without any issues mentioned in the presentation.

Yury's Bio:
Yury is a nice person who enjoys meeting and working with people on challenging projects in the Oracle space. He started to work as an Oracle DBA 15 years ago (1997). Yury is an OCP 7,8,9,10g,11g and 9i,10g,11g OCM (Oracle Certified Master). He is a frequent presenter at Oracle related conferences such as Oracle OpenWorld, Collaborate, Hotsos, UKOUG and AUOUG. Yury is a socially active person. Apart from Social Media (Twitter, Blogging, Facebook) he has contributed a lot to the local Oracle community over the years.

Find his blog http://www.pythian.com/news/author/velikanov/ or give him a tweet

I hope to see you there,

Scott

ps - Penny from Sage Computing is still offering to coach anyone with a technical or Oracle product related background with a view to presenting to an audience eg an Oracle User Group monthly meeting or at the Oracle conference.

This is a fantastic opportunity open to anyone wishing increase their profile within the Oracle community.  Just think, the call for papers for the Insync conference has just opened, and the Perth conference call won't be far away.

pps - Are you a student? Are you interested in getting involved and making more contacts in the Oracle community?

The Australian Oracle User Group are proud to announce free student membership for 12 months subject to the student undertaking volunteer work.

The WA student campaign will be managed by Ursula Rogaunig (contact: Ursula.rogaunig@gmail.com for details ) and will have a duration from now until the WA conference in October 2012.

Get involved!

Local DB died, local developer doesn't panic

My database crashed on my dad's birthday.

There's no correlation to be made there, let alone causation.
“The invalid assumption that correlation implies cause is probably among the two or three most serious and common errors of human reasoning.” Steven J Gould.
And if you haven't read it, Tom Kyte has a great Oracle related article on the matter. His old AskTom link is dead, but here is one from Oracle China - I think the transmission is by carrier pigeon, or a 9000 baud modem, but give it a few minutes. Similar to opening a sensis website, really - except it's all text.

Not a DBA!!!
Now my DBA hat is really small. I can't open this like that jeff smith fellow.

Nope, the first thing I did was informed my boss that my laptop blue screened - first time on this sucker, not long after I noticed Glassfish gone and the Oracle DB simmering on the ashes.

After a quick layman's look following a hunch, I found my SYSTEM tablespace was lacking elbow room.

I thought I'd lost the original figures in another crash (opening the lid from hibernation), but I found them in my e-mail to Penny.

SQL> @free sys%

NAME       KBytes         Used         Free   Used      Largest
----------------- ------------ ------------ ------ ------------
SYSAUX    768,000      630,848      137,152   82.1       40,960
SYSTEM  1,249,280    1,244,032        5,248   99.6        5,120

With my uneducated eye, I deduced that SYSTEM Used 99.6% was called a "vital clue".

So in another script I had hidden away, some other little tip Penny gave me one day, was to make a bigger canvas, so to speak
alter tablespace system
add datafile 'C:\app\Scott\oracle\11.2.0\oradata\sw11g\SYSTEM02.dbf'
SIZE 1000M;
And once Penny got back to me with another suggestion:
select owner,segment_name,segment_type
      ,bytes/(1024*1024) size_m
from dba_segments
where tablespace_name = 'SYSTEM'
and    bytes/(1024*1024)> 1
order by size_m desc
/

OWNER SEGMENT_NAME    SEGMENT SIZE_M
----- --------------- ------- ------
SYS   AUD$            TABLE      360
SYS   IDL_UB1$        TABLE      288
SYS   SOURCE$         TABLE      120
SYS   IDL_UB2$        TABLE       40
SYS   C_TOID_VERSION# CLUSTER     23
SYS   C_OBJ#_INTCOL#  CLUSTER     22
SYS   ARGUMENT$       TABLE       16
SYS   I_SOURCE1       INDEX       15
SYS   C_OBJ#          CLUSTER     14  
She palmed me off to the relevant documentation where I could do some trimming. 11.2.0.1 for those watching at home.

Here's what I came up with
BEGIN
  DBMS_AUDIT_MGMT.SET_DEBUG_LEVEL(DBMS_AUDIT_MGMT.TRACE_LEVEL_ERROR); -- didn't work?
  DBMS_AUDIT_MGMT.init_cleanup(
    audit_trail_type         => DBMS_AUDIT_MGMT.AUDIT_TRAIL_ALL,
    default_cleanup_interval => 24*7 /* hours */);
END;
/

BEGIN
  DBMS_AUDIT_MGMT.create_purge_job(
    audit_trail_type           => DBMS_AUDIT_MGMT.AUDIT_TRAIL_ALL,
    audit_trail_purge_interval => 24*30 /* hours */,
    audit_trail_purge_name     => 'PURGE_ALL_AUDIT_TRAILS',
    use_last_arch_timestamp    => FALSE);
END;
/

I was originally having problems with seeing the trace, as I didn't have enough temporary space (or something similar, I lost the actual message) in SYSAUX, so I gave that tablespace another 300M datafile.

Now my free space looks like I have enough room to swing a dinosaur, and I haven't had any velociraptors opening doors since.

SQL> @free sys%


NAME       KBytes         Used         Free   Used      Largest
----------------- ------------ ------------ ------ ------------
SYSAUX  1,075,200    1,015,680       59,520   94.5       43,008
SYSTEM  2,273,280      875,840    1,397,440   38.5    1,022,976
     ------------ ------------ ------------
sum     3,348,480    1,891,520    1,456,960

I saw Jeff Smith's article about his ORA-3113 issue via twitter. After locating my alert log, I couldn't track down anything wrong from where I first saw issues, but I'm not used to reading these logs.

Begin automatic SQL Tuning Advisor run for special tuning task  "SYS_AUTO_SQL_TUNING_TASK"
ERROR: Unable to normalize symbol name for the following short stack (at offset 199):
dbgexProcessError()+193<-dbgeExecuteForError()+65<-dbgePostErrorKGE()+1726<-dbkePostKGE_kgsf()+75<-kgeade()+560<-kgerev()+125<-kgerec5()+60<-sss_xcpt_EvalFilterEx()+1869<-sss_xcpt_EvalFilter()+174<-.1.4_5+59<-00000000775A85A8<-00000000775B9D0D<-00000000775A91AF<-00000000775E1278<-kgllkal()+151<-kglLockCursor()+188<-kxsGetLookupLock()+146<-kkscsCheckCursor()+326<-kkscsSearchChildList()+1067<-kksfbc()+12294<-kkspsc0()+2117<-kksParseCursor()+181<-opiosq0()+2538<-kpooprx()+357<-kpoal8()+940<-opiodr()+1662<-PGOSF523_kpoodrc()+32<-rpiswu2()+2757<-kpoodr()+717<-xupirtrc()+2739<-upirtrc()+124<-kpurcsc()+150<-kpuexec()+9766<-OCIStmtExecute()+70<-kewrose_oci_stmt_exec()+79<-kewrgwxf1_gwrsql_exft_1()+407<-kewrgwxf_gwrsql_exft()+620<-kewrews_execute_wr_sql()+72<-kewrftbs_flush_table_by_sql()+210<-kewrft_flush_table()+150<-kewrftec_flush_table_ehdlcx()+454<-kewrfat_flush_all_tables()+1021<-kewrfos_flush_onesnap()+167<-kewrfsc_flush_snapshot_c()+613<-kewrafs_auto_flush_slave()+548<-kebm_slave_main()+856<-ksvrdp()+2506<-opirip()+965<-opidrv()+909<-sou2o()+98
Sun Feb 26 19:16:53 2012
Errors in file c:\app\scott\diag\rdbms\sw11g\sw11g\trace\sw11g_smon_7520.trc  (incident=73309):
ORA-00600: internal error code, arguments: [25027], [2], [2965385640], [], [], [], [], [], [], [], [], []
Errors in file c:\app\scott\diag\rdbms\sw11g\sw11g\trace\sw11g_m002_7944.trc  (incident=73461):
ORA-07445: exception encountered: core dump [kgllkal()+151] [ACCESS_VIOLATION] [ADDR:0xFFFFFFFFFFFFFFFF] [PC:0x92A2D07] [UNABLE_TO_READ] []
Incident details in: c:\app\scott\diag\rdbms\sw11g\sw11g\incident\incdir_73309\sw11g_smon_7520_i73309.trc
Incident details in: c:\app\scott\diag\rdbms\sw11g\sw11g\incident\incdir_73461\sw11g_m002_7944_i73461.trc
Non-fatal internal error happenned while SMON was doing cursor transient type cleanup.
SMON encountered 1 out of maximum 100 non-fatal internal errors.
Sun Feb 26 19:17:01 2012
Trace dumping is performing id=[cdmp_20120226191701]
Maybe it might help someone on day, or someone can add further detail.

References

Monday, 19 March 2012

New Perth Blogger - Phil Robinson

Are you sick of blogs to focused on technical details or tuning hoo-ha?

Probably not, but you may appreciate a new blog from fellow Perth-ite Phil Robinson.
lonsdalesystems.blogspot.com.au 
His content won't be technical from an Oracle perspective, but he'll probably shed some light on other ideas such as modelling; testing & software quality; and just outside-the-box style ideas.

He's been a trainer for many years throughout Australia & South East Asia; he's well published; and is always a pleasure to talk to.

You'll also find him on Twitter @lonsdalesystems

I look forward to seeing his content as a blogger.

Scott