Wednesday, March 28, 2007

XPLAN PLANS Made Easy

Found this on David Aldridge's blog ... http://oraclesponge.wordpress.com

he DBMS_XPLAN supplied package gives results that are so much more usable than the old "set autotrace traceonly explain", or any manual method of reading the plan_table, that the only thing holding me back from using it more often was the lengthy syntax.

No more: I have created views to save my aching fingers. Feel free to use them, modify them, whatever for your own purposes -- just don't blame me if they break something ;)

create or replace view xplan_basic as
select * from table(dbms_xplan.display('plan_table',null,'BASIC'));*

create or replace view xplan_typical as
select * from table(dbms_xplan.display('plan_table',null,'TYPICAL'));

create or replace view xplan_parallel as
select * from table(dbms_xplan.display('plan_table',null,'ALL'));

create or replace view xplan_serial as
select * from table(dbms_xplan.display('plan_table',null,'SERIAL'));

I am now a mere "select * from xplan_parallel" away from my execution plans.

Thanks David.

Thursday, March 22, 2007

wireless keyboard

Brought a wireless keyboard and mouse a few days ago. It works a treat. On the mac it asked me to configure before I logged in and away it went.

To my delight, most of the special keys on the keyboard work on the mac. pretty good work from microsoft. The only problem is that it is black !!!

Tuesday, March 20, 2007

Keyboards

Purchased a new keyboard and mouse (of the wireless variety) today. My lovely wife spilt water over the old keyboard and now it doesn't work. boo hoo.

As I have a mac at home, the keyboard was a mac. Seems to me as though apple design some really nice hardware, but ofter they don't think about the practacality of things (like building a keyboard that still works after some water is thrown on it).

snapshot too old errors ...

There is a bug with oracle 9i and materialized views whereby there are numerous snapshot too old errors. This bug is around the source database whereby the optimizer is giving an incorrect execution plan, when the parameter star_transformation_enabled is set to TRUE.

This bug is fixed in oracle 10.0. The workaround is to change the parameter to temp_disable.

Direct Path Write wait

The 'direct path write' wait seems to occur when the disk the database is writing to can't keep up with requests. It is normally an indicator that there is something amiss with the disk, or possibly the DR sync is working as expected.

SIZING Tables

TABLES

To work out the sizings of x number of records then need to be added to a table, use the following ...

Analyze the table or partition. Find the avg_row_len, from either dba_tables or tab_tab_partitions. Then calculate the space required by ...

space_required = avg_row_len * number_of_rows

This formula is really simple and is not perfect as it doesn't take block headers, pct_free etc into consideration, but should be good as a guide.

Thursday, March 15, 2007