Interview with Tom Kyte

September 26, 2006

This is an interview which I made with Tom Kyte in Zurich in September 2006

L.H.: Mr. Kyte, you are Vice President of the world’s largest database software company and you also are the man behind the http://asktom.oracle.com/ website.

Since more than 6 year you have provided kind of support to the Oracle community for their every day problems in your forum.
Judging from your experience, what are the most common mistakes made about database applications?

T.K.: This is a timely question, I just finished my “Worst Practices” material for some upcoming conferences (Oracle Open World included).

The worst practices I see out in the field are:

1) Blindly believing everything just because it is printed. I cannot even guess what percentage of technical material about Oracle published on the Internet is wrong. During the construction of my material for this Worst Practices talk – it took me about 10 minutes to find 10 really “good” (meaning really bad) examples of technically incorrect information. I used http://www.google.com/ to search for “Oracle Tuning Tips” and found some really bad material quickly.

2) Not using bind variables! Developers for whatever reason make this common mistake time and time and time again. Not using bind variables in most applications will cause 4 things to happen:
a) they will run slower in single user mode, a large percentage of the program run time will be spent parsing SQL, not executing it.
b) they will use memory entirely inefficiently, the shared pool will be a point of contention.
c) their applications will not scale as users are added – hard parsing is a point of much serialization in the database.
d) their application will be subject to SQL injection issues (put SQL Injection into the search box on http://www.google.com/ and see how many articles you get back on that).

So, by not using bind variables – the developers help to ensure they will have a slow running program that creates memory issues in the shared pool, that cannot scale and will be a huge security risk.

3) Implementing very generic data base designs. Generic code can be useful, in some rare cases – however, if you want something maintainable, understandable and performant – you will actually design your system, from day one.

4) Not having a credible test environment. For example – not testing to scale (if you are going to support 100 concurrent transactions, you need to be able to test that you can do that – and then test it!). Or – testing against an empty database; that will not give you any indication that your developed application will actually perform in real life.

L.H.: After 14 year of work with Oracle Database, what is the feature to your mind today which makes Oracle Database unique among other database providers?

T.K.:http://www.oracle.com/technology/oramag/oracle/05-may/o35asktom.html

My favorite feature – Oracle’s concurrency model.

L.H.: The average database of today is by far larger than what has been considered a Very Large Database only a few years ago.
What are the most challenging task for a database administrator today?

T.K.: Keeping up with the technology! Many of the things we used to spend a lot of time doing manually are much more automated than they were a decade ago. And there are hundreds of new features to learn about. In the last decade we’ve gone from having a 1 Terabyte database be considered “huge” to being considered just “average” in size. Many things we did not use or need to use a decade ago – such as partitioning (did not exist) – are things we need to have mastery over today. Therefore, the working set of knowledge a DBA needs today is very much different from the working set of knowledge they had to have 10 years ago. We need to “forget” about some of the things that were automated (such as undo management – I’m glad I don’t have to figure out exactly how many rollback segments of what size I need anymore) and keep up with all of the new tools we have to manage data such as partitioning, data guard, streams and so on.

L.H.: The trend of the Oracle Database Server goes clearly into the direction of self management and self maintenance.
Will there be a need for database administrators for the database of the future and what will be their main tasks?

T.K.: Absolutely – see the points above. Every time we automate something – 3 or 4 other “new things” are added. Sure – we automated PGA memory management in 9i, but we added Streams and Change Data Capture. The list of things DBAs do is not necessarily shrinking, but it is ever changing.

L.H.: Will the database server of the future be able to also kind of auto-tune the application?

T.K.: This is why I say “tuning is not dead”, but how we tune has to change. In the past – we would tune by tuning SQL. Nowadays the database is pretty good at tuning SQL – with SQL profiles, an ever smarter optimizer, the index advisor, the materialized view advisor, the SQL advisor and so on – tuning SQL is something we spend less and less time on.

What we have to focus on is how we do things – our algorithms. Maybe far far out in the future, the database can detect what an application is doing and “fix it”, but for the time being – only we can.

For example, the datab ase will not turn logic such as:

for x in (select * from t1)
loop
insert into t2 values X;
end loop;
into
insert /*+ APPEND */
into t2 select * from t1;

That is our job and will be for the immediate future.

L.H.: Oracle already has its own logical volume manager (Automatic Storage Management) its own cluster file system and since March 2006 also its own media management server (Oracle Secure Backup), which can be used to not only backup the database but also the entire Oracle software stack including application servers, the collaboration suite as well as OS-files.
Will Oracle be kind of an operating system some day?

T.K.: We tried that once before actually, a thing called “Raw Iron” http://news.com.com/2100-1001-219075.html

It was not widely adopted – maybe it was before its time. I can certainly see the usefulness of such a thing – I personally already consider Oracle to be my operating system in many cases. I’m not saying Oracle is working on it (I have no knowledge to that effect), just that I could see it happening sometime in the future. A database appliance, much like you have network attached storage.

L.H.: Thank you very much Mr. Kyte.


STATISTICS_LEVEL in Oracle 10gR2

September 24, 2006

The initialization parameter STATISTICS_LEVEL controls quite a number of functionalities in the Oracle 10g database.
Its default value is TYPICAL.

By setting it to BASIC you switch off functionalities like automatic statistics collection for performance baselines, statistics sampeling for the active session history, table monitoring and a lot of more functionalities. If the parameter is set to BASIC it is still possible to manually set the parameters DB_CACHE_ADVICE, TIMED_STATISTICS and TIMED_OS_STATISTICS.

The parameter can also be set to ALL which causes the collection of additional statistics for timed operating system statistics and for the row source executions.
Oracle strongly recommends to collect the statistics at least at TYPICAL level.

STATISTICS_LEVEL can be set at system as well as at session level. If set on session level the following advisories or statistics get turned on or off, but their systemwide setting is not changed:
- Timed Statistics
- Timed OS Statistics
- Plan Excution Statistics

In order to find out which functionalities are controlled by STATISTICS_LEVEL you can query the dynamic performance view v$statistics_level which displays the status of the statistics/advisories controlled by STATISTICS_LEVEL:

SYS @10gR2 SQL > show parameter statistics_l
NAME TYPE VALUE
————————- ———-
statistics_level string TYPICAL

SYS @10gR2 SQL > DESC v$statistics_level
Name Null? Type
—————————————– ——– —————————-
STATISTICS_NAME VARCHAR2(64)
DESCRIPTION VARCHAR2(4000)
SESSION_STATUS VARCHAR2(8)
SYSTEM_STATUS VARCHAR2(8)
ACTIVATION_LEVEL VARCHAR2(7)
STATISTICS_VIEW_NAME VARCHAR2(64)
SESSION_SETTABLE VARCHAR2(3)

SYS @10gR2 SQL > SELECT STATISTICS_NAME, ACTIVATION_LEVEL, SYSTEM_STATUS, STATISTICS_VIEW_NAME, SESSION_SETTABLE
2 FROM v$statistics_level;
STATISTICS_NAME ACTIVAT SYSTEM_S STATISTICS_VIEW_NAME SES
———————— ———— —————————————————- —
Buffer Cache Advice TYPICAL ENABLED V$DB_CACHE_ADVICE NO
MTTR Advice TYPICAL ENABLED V$MTTR_TARGET_ADVICE NO
Timed Statistics TYPICAL ENABLED YES
Timed OS Statistics ALL DISABLED YES
Segment Level Statistics TYPICAL ENABLED V$SEGSTAT NO
PGA Advice TYPICAL ENABLED V$PGA_TARGET_ADVICE NO
Plan Execution Statistics ALL DISABLED V$SQL_PLAN_STATISTICS YES
Shared Pool Advice TYPICAL ENABLED V$SHARED_POOL_ADVICE NO
Modification Monitoring TYPICAL ENABLED NO
Longops Statistics TYPICAL ENABLED V$SESSION_LONGOPS NO
Bind Data Capture TYPICAL ENABLED V$SQL_BIND_CAPTURE NO
Ultrafast Latch Statistics TYPICAL ENABLED NO
Threshold-based Alerts TYPICAL ENABLED NO
Global Cache Statistics TYPICAL ENABLED NO
Active Session History TYPICAL ENABLED V$ACTIVE_SESSION_HISTORY NO
Undo Advisor, Alerts and Fast
Ramp up TYPICAL ENABLED V$UNDOSTAT NO
16 rows selected.


bits and bites with Tom Kyte

September 22, 2006


I had organized a little dinner for Tom Kyte and some special guests yesterday evening.
We went to a nice Spanish restaurant in the Old City of Zurich.
It was a relaxing evening with lots of fun, paella and good Spanish wine.


Tom Kyte @ Oracle Education Switzerland

September 21, 2006

Yesterday Tom Kyte flew into Zurich from Paris.
He will stay for three days to deliver a number of special trainings and lectures.
After a Q&A-session at the UBS bank in Zurich I took him over to Baden where he delivered a lecture about the importance of “instrumentation” of code and the possible methods of instrumenting your code in an Oracle environment both in the database (stored procedures) as well as outside the database (java, C, VB and the like).
The demo I liked best yesterday was about the usage of the package dbms_monitor. With this demo he pointed out how important it is that the devleopers use the possible instruments to hand over client information (through all middle tiers) into the database in order to enable the DBA to trace back (through all middle tiers) who exactely did what (in the browser). This a package I also show in my “Oracle 10g New Features For Administrators” classes.

Today and tomorrow Tom Kyte will
deliver a number of lectures
at a special event of Oracle Education
at the Zurich Development Center.


10 weeks => 10000 hits

September 14, 2006

Yesterday my blog encountered its 20000th. pageload since I launched it in November of last year.
There were 10000 visitors since June 30th. !
Thank you very much to all of you blog-readers!


Page Loads Unique Visitors First Time Visitors Returning Visitors
Total 19,816 13,768 11,224 2,544
Average 2,202 1,530 1,247 283
Month Page Loads Unique Visitors First Time Visitors Returning Visitors
Sep 2006 1,498 1,092 891 201
Aug 2006 4,709 3,320 2,784 536
Jul 2006 3,770 2,766 2,211 555
Jun 2006 3,459 2,376 1,870 506
May 2006 3,504 2,355 1,913 442
Apr 2006 1,713 1,234 1,066 168
Mar 2006 704 431 360 71
Feb 2006 160 86 66 20
Jan 2006 299 108 63 45

crs_stat Utility

September 7, 2006

I am in Geneva this week, teaching part of a RAC 10g class at the World Trade Center togehter with Tamás Kerepes from Budapest. He is an enormously skilled collegue of mine and I am happy to get to know him.

I have demonstrated the migration of an entire cluster database from OCFS to ASM life in the class yesterday, including all datafiles, redologs, controlfiles, spfile and backups. This was a really thrilling and a little tricky process, but I succeeded at the end!
I will post about the procedure soon.

I came across a nice little option for the crs_stat utility which I was not aware of and which Tamás pointed out to me:
crs_stat -t
gives a short listing of the contents of the cluster registry rather than the long listing of the simply scr_stat without the -f.
This can come in very handy with a large cluster registry!
Look at the difference!
Here is a demo:
[oracle@ed-toraclin9a oracle]$ crs_stat –help
Usage: crs_stat [resource_name [...]] [-v] [-l] [-q] [-c cluster_member]
crs_stat [resource_name [...]] -t [-v] [-q] [-c cluster_member]
crs_stat -p [resource_name [...]] [-q]
crs_stat [-a] application -g
crs_stat [-a] application -r [-c cluster_member]
crs_stat -f [resource_name [...]] [-q] [-c cluster_member]
crs_stat -ls [resource_name [...]] [-q]
[oracle@ed-toraclin9a oracle]$ crs_stat
NAME=ora.RDBB.RDBB1.inst
TYPE=application
TARGET=ONLINE
STATE=ONLINE on ed-toraclin9a

NAME=ora.RDBB.RDBB2.inst
TYPE=application
TARGET=ONLINE
STATE=ONLINE on ed-toraclin9b

NAME=ora.RDBB.db
TYPE=application
TARGET=ONLINE
STATE=ONLINE on ed-toraclin9b

NAME=ora.ed-toraclin9a.ASM1.asm
TYPE=application
TARGET=ONLINE
STATE=ONLINE on ed-toraclin9a

NAME=ora.ed-toraclin9a.LISTENER_ED-TORACLIN9A.lsnr
TYPE=application
TARGET=ONLINE
STATE=OFFLINE

NAME=ora.ed-toraclin9a.gsd
TYPE=application
TARGET=ONLINE
STATE=ONLINE on ed-toraclin9a

NAME=ora.ed-toraclin9a.ons
TYPE=application
TARGET=ONLINE
STATE=ONLINE on ed-toraclin9a

NAME=ora.ed-toraclin9a.vip
TYPE=application
TARGET=ONLINE
STATE=ONLINE on ed-toraclin9a

NAME=ora.ed-toraclin9b.ASM2.asm
TYPE=application
TARGET=ONLINE
STATE=ONLINE on ed-toraclin9b

NAME=ora.ed-toraclin9b.LISTENER_ED-TORACLIN9B.lsnr
TYPE=application
TARGET=ONLINE
STATE=ONLINE on ed-toraclin9b

NAME=ora.ed-toraclin9b.gsd
TYPE=application
TARGET=ONLINE
STATE=ONLINE on ed-toraclin9b

NAME=ora.ed-toraclin9b.ons
TYPE=application
TARGET=ONLINE
STATE=ONLINE on ed-toraclin9b

NAME=ora.ed-toraclin9b.vip
TYPE=application
TARGET=ONLINE
STATE=ONLINE on ed-toraclin9b

[oracle@ed-toraclin9a oracle]$ crs_stat -t
Name Type Target State Host
————————————————————
ora….B1.inst application ONLINE ONLINE ed-t…in9a
ora….B2.inst application ONLINE ONLINE ed-t…in9b
ora.RDBB.db application ONLINE ONLINE ed-t…in9b
ora….SM1.asm application ONLINE ONLINE ed-t…in9a
ora….9A.lsnr application ONLINE OFFLINE
ora….n9a.gsd application ONLINE ONLINE ed-t…in9a
ora….n9a.ons application ONLINE ONLINE ed-t…in9a
ora….n9a.vip application ONLINE ONLINE ed-t…in9a
ora….SM2.asm application ONLINE ONLINE ed-t…in9b
ora….9B.lsnr application ONLINE ONLINE ed-t…in9b
ora….n9b.gsd application ONLINE ONLINE ed-t…in9b
ora….n9b.ons application ONLINE ONLINE ed-t…in9b
ora….n9b.vip application ONLINE ONLINE ed-t…in9b


Follow

Get every new post delivered to your Inbox.