This blog contains experience gained over the years of implementing (and de-implementing) large scale IT applications/software.

Oracle Core: Essential Internals for Troubleshooting

Whilst shopping on Amazon this morning I noticed that Jonathan’s book is up for pre-order.
The price gurantee from Amazon is very reasonable, so I’ve pre-ordered.

Should be a good read and more importantly a good weapon in any DBAs problem analysis methodology (is “weapon” the best way to describe it? Wouldn’t that make Jonathan an arms dealer?).
Of course it doesn’t mean I can possibly absorb everything from the book, but most of the time I find that it’s not that you know how to do it, it’s that you know it can be done.

https://www.amazon.co.uk/gp/product/1430239549

Oracle Documentation Is a Moving Target

I appreciate that internet content is better when it’s dynamic, but sometimes there’s a need for static content; or should I say more accurately, static links to content.

I’m right in the middle of compiling a new tutorial on installing Oracle 11gR2 on Oracle Enterprise Linux 6.1.
The Oracle docs in HTML format have been on-line for years now, but I’ve never really referenced them over a period of time with such specific requirements.
I’ve been using the software pre-requisites section of the Oracle 11gR2 docs and have bookmarked them in my browser of choice.  At least I thought I had.  Until today, when I click the link I get an Oracle web page stating “404 not found”.
What happened?  What caused the move of the actual URL?
Here’s what I was using before:
https://download.oracle.com/docs/cd/E11882_01/install.112/e16763/pre_install.htm#CIHIDJAH

Here’s the same content today:
https://download.oracle.com/docs/cd/E11882_01/install.112/e24321/pre_install.htm#CIHFICFD

Looks like the e16763 has been replaced with e24321 and the internal bookmark (anchor) in the page (CIHIDJAH) has been changed to (CIHFICFD).

All links internally on the page are relative links and not absolute, and when you try and navigate up the path, you get a 404.  So I guess that Oracle themselves don’t want you to bookmark the links.

Lesson learned, always capture what you need elsewhere and duplicate everything in case you can’t find it or it gets removed…

Oracle Storage Sub-system Load Stress Testing

Whilst looking around for an Oracle equivalent stress testing freebie (like SQLIO for SQL Server), I found out about ORION (ORacle I/O Numbers).
It’s been about for a while and can be used to stress test storage systems.
It’s a simple single binary file that generates I/O load on a storage system using Oracle’s I/O call stack.
No need to install Oracle at all!

Unfortunately for me, it only works with file systems that have Async I/O enabled.
I did not, and therefore could not use ORION.
When I finally get time to install Oracle on my new Oracle Enterprise Linux 6.1 environment, I’ll give it a go.

Flushing Cursor SQL Plan Out of Library Cache

I can never remember how to do this.

I wanted to flush a specific SQL execution plan out of the Oracle 11g SQL Library Cache so that I could try and compare a before and after SQL execution scenario using SQL trace and then tkprof’ing it.
Here’s the link to the blog that helped me remember again:

https://prutser.wordpress.com/2009/04/19/flushing-a-cursor-out-of-the-library-cache/


Thanks.

Monitoring Index Usage In Oracle 10G Using V$OBJECT_USAGE

Have you got some large indexes creeping around?
Some of my systems have 10GB indexes.
These take valuable resources away from the Oracle database:
– DML time (INSERT, UPDATE etc).
– Stats generation time.
– Segment space (hard disk).
– Structure validation time.
– Recovery time.

Removing the index may not be an option.  But what if it’s not actually used!!

How can we tell if it’s used?
Well you could monitor all SQL in the shared pool using the AWR capture script https://www.remote-dba.net/oracle_10g_tuning/t_oracle_index_usage_tracking.htm, or you could use Jonathan’s script https://jonathanlewis.wordpress.com/segment-scans/ to see if the index segment(s) has been scanned (full scan).  But these don’t comprehensively give you a definitive answer.
There could be holes in your monitoring.

Instead, you could use the V$OBJECT_USAGE view to monitor index usage.
Although a very basic method, if you only want to know definitively if an index has been used or not, then it gives you the answer.
It is described in great detail here: https://wiki.oracle.com/page/Monitor+Index+Usage

Turn on:
alter index <INDEX> monitoring usage;

ALTER INDEX SAPSR3."JCDS~Z01" monitoring usage;

Turn off:
alter index <INDEX> nomonitoring usage;

ALTER INDEX SAPSR3."JCDS~Z01" nomonitoring usage;

Check usage (must be as owner of monitored objects):
select count(1) from v$object_usage;

Or use query below to see all monitored objects:

SELECT
u.name owner ,
io.name index_name ,
t.name table_name ,
DECODE(bitand(i.flags, 65536), 0, 'NO', 'YES') monitoring ,
DECODE(bitand(ou.flags, 1), 0, 'NO', 'YES') used ,
ou.start_monitoring start_monitoring ,
ou.end_monitoring END_MONITORING
FROM
sys.user$ u ,
sys.obj$ io ,
sys.obj$ t ,
sys.ind$ i ,
sys.object_usage ou
WHERE
i.obj# = ou.obj#
AND io.obj# = ou.obj#
AND t.obj# = i.bo#
AND u.user# = io.owner#;