Oracle Observations

December 10, 2012

ukoug conference report: Dave Ensor

Filed under: Uncategorized — bigdaveroberts @ 9:53 pm

I only became aware of Mr Ensor when I read his chapter in the book: Oracle insights – tales of the Oak table.(

Oracle Insights: Tales of the Oaktable

Oracle Insights: Tales of the Oaktable

Buy from Amazon

 

The chapter lists and explains the significance of the major new features in each release of Oracle.

I was at the time working on the support of two oracle based applications, which at the time presented me with baffling architectural eccentricities.

One was a document management system where the client application didn’t access the database directly, but rather made calls to an API implemented on the middle tier that had several daemon processes that would execute the required SQL on your behalf. I suspected that the application had been designed in that manner to better facilitate working with multiple database back ends.

The other held large chunks of PL/SQL in Long columns in the database. It then included an OCI*C daemon process that was passed messages via a DBMS_PIPE would then extract the appropriate PL/SQL code, perform parameter substitution, execute the PL/SQL and return the results via a table. This was again baffling to me, why not use stored procedures?

Both of these architectural mysteries were resolved by Dave Ensors chapter. While both applications ran on Oracle8i, it was apparent that their architecture was much older.

In Oracle 5, due to memory address limitations it was only possible to have 40 concurrent contentions to the database. Thus to support more users, the user SQL had to be multiplexed across a limited number of connections.

Similarly in Oracle 6 PL/SQL was introduced, but without a standard way of storing PL/SQL in the database. (Procedures and functions wouldn’t come till Oracle 7.)

Thus Mr Ensor explained to me the architecture of the applications I was supporting.

Dave Ensor attended last years Oak table Sunday at the UKOUG conference and participated in a panel discussion there. He also visited All bar One afterwords, but only briefly, and I missed my opportunity to thank him for the insight he had given me.

This year he didn’t attend either the conference or the Pre-conference OAK table Sunday event.

However he did visit All bar One and I had my opportunity to thank him for his contribution to TFTOT.

From his recollection, I was the first person to ever thank him for that specific piece of work, he had been asked to produce 20 pages, produced 120 and was then negotiated down to 70ish.

I suppose writing about older versions of Oracle isn’t necessarily sexy and on that basis this commensurate piece of work hasn’t received due recognition however if you support an application with a long history, you may do well by getting hold of a copy of this book and reading his chapter!

NB. the book also includes other excellent contributions and chapters!

November 18, 2012

11g forms error

Filed under: 11g,Oracle forms — bigdaveroberts @ 1:21 pm

After migrating to 11g we encountered the following error in 2 of our forms after migration to 11g:

Error 801 at line 0, line 0
internal error [phd_get_defn:DI_U_NAM_RHS]
Error 908 at line 0, column 0
The stored format of <schema name>.<Procedure name> is not supported by this release.

I believe that the issue related to compiling in form code that called database packages that had dependencies in other databases.

But that isn’t important, there was one hit on the OTN forum that correctly pointed me at the correct Metalink article and patch:

https://forums.oracle.com/forums/thread.jspa?threadID=1038775

So the problem is described in article 1058803.1 and resolved by 7708340.

So ultimately the problem doesn’t seem to require a blog post.

There was however one anomaly  the patch is a database patch and the read-me implied that the patch needed to be applied to the Weblogic server also the patch was relatively speaking large.

I have to admit I was highly dubious about applying a database patch to the middle tier so I went ahead and applied the patch to my development PC, and to my great surprise, it worked.

It also appears that technically you don’t need to apply it to the middle tier, it simply needs to be applied to the PC on which the forms are compiled, although obviously it would be good practice to keep the development PCs and server environments in sync with the live environment.
So sometimes, however unlikely it sounds, Oracle instructions are sometimes accurate straight out of the tin!

November 17, 2012

Oracle forms 11g, OLE2, Windows 2008 R2 64bit issue. (Possibly.)

Filed under: 11g,OLE,Oracle forms,Uncategorized — bigdaveroberts @ 10:12 pm

For clarity, its definitely a forms issue and It’s definitely an OLE2 issue.

But the rest is speculative.

The application was developed to produce reports as Excel spreadsheets using OLE2 to to populate the cells with data.

This was originally developed under Forms 6i and was successfully migrated to Forms 10g using the middle tier to generate the spreadsheets and then pass it back to the user using the same mechanism (WEB.SHOW_DOCUMENT) as used to pass oracle reports back.

Upon migration to Forms 11g this implementation still worked using 32bit windows server 2003 for the middle tier, but when we moved to 64bit Windows Server 2008 R2 the process failed.

We could see Excel being invoked, but it ran only briefly and then terminated without generating a spreadsheet or logging any form of error that we could find.

I tested using my development environment under windows 7 64 bit and the functionality worked fine.

So, it was back to Sysinternals process monitor (http://technet.microsoft.com/en-us/sysinternals/bb896645) to try and work out the difference in behavior.

My expectation was that it would be some obscure registry setting that would be the cause, in fact the behavior diverged after an attempt to read the following directory:

c:\windows\system32\config\systemprofile\desktop

Strangely this directory was also missing on my windows 7 PC but it was present on windows server 2003.

I copied the desktop directory and its contents from the windows 2003 server to the windows 2008 server and the problem disappeared.

I then deleted the contents of the desktop directory and the Excel spreadsheet was still successfully generated.

So in conclusion, I guess, that when Oracle implemented it’s forms OLE2 interface, they based it on configuration information that is no longer present on 64 bit Windows Server 2008 R2.

However I am uncertain as to when that directory disappeared.

There is also the issue that on my development machine the problem didn’t manifest itself, indicating that the problem may be more complex than this initial investigation has exposed.

As a last observation, the closest I’ve come to an official document that hints at being related on Metalink is:

Bug 11704826 : PROPOSAL FAILS IN 8.1.1.3 WITH WINDOWS 2008 AND OFFICE 2007

Although there is no explicit reference to OLE2 and the bug appears unresolved.

Not quite the conclusive conclusion that I like, but interesting enough for a blog post.

(Possibly.)

October 9, 2012

Possibly useful information for attendees of UKOUG TEBS 2012. (And Oracle Beer!)

Filed under: Uncategorized — bigdaveroberts @ 4:14 pm

Venue Plans.

When I first attended UKOUG, I did struggle to find my way to some of the halls, especially with regard the fact that some routes have been closed off.

So if this is the first time you are attending you might want to look at the new floor plans on the ICC website located here:

http://www.theicc.co.uk/the-venue/venue-plans/

and

http://www.theicc.co.uk/media/45064/cpc_map.pdf
Parking.

If you are going to park on the street at any time during the conference, note that new zones are now in operation since last year.

The map of the new zones is here:

http://www.birmingham.gov.uk/cs/Satellite/cpz?packedargs=website%3D4&rendermode=live

But in short, some of the roads closest to the ICC now require a ticket on all days (including Sundays) between the hours of 8am to 7:30pm.

Beer.

While All Bar One and Pitcher and piano in Brindley place (
http://www.brindleyplace.com/leisure/bars/
) provide convenient locations for acquiring beer may I suggest that the more adventurous try:

http://www.tapandspilebirmingham.co.uk/location.html

http://www.thewellingtonrealale.co.uk/

or

http://www.postofficevaults.co.uk/

Which actually serves:

 

Baas? Beer as a service?

UKOUG TEBS conference 2012 agenda (Wednesday).

Filed under: Uncategorized — bigdaveroberts @ 4:10 pm

09:00 – 09:45 David Peake – Oracle Co-presenter(s): Anthony Rayner – Oracle

Application Express Roundtable

10:00 – 10:45 Simon Haslam, Oracle ACE Director – Veriton Limited

Application Server & Middleware Round Table

11:15 – 12:00 Tony Hasler – Anvil Computer Services

The MODEL clause explained

12:10 – 13:10 Joze Senegacnik, Oracle ACE Director – DbProf d.o.o.

PGA Memory Management Revisited

13:55 – 14:55 Maria Colgan – Oracle

Exadata and the Oracle Optimizer: The Untold Story

15:15 – 16:00 Tanel Poder, Oracle ACE Director – Enkitec

Troubleshooting the Most Complex Performance Issues I’ve seen

UKOUG TEBS conference 2012 agenda (Tuesday).

Filed under: Uncategorized — bigdaveroberts @ 3:18 pm

 09:00 – 09:45 Andrew Clarke – Logica

Development Tools Roundtable

On the other hand this session sounds mischievous and potentially entertaining:

09:00 – 09:45 Jonathan Lewis, Oracle ACE Director – JL Computer Consultancy

Are You Sure You Need Exadata?

09:55 – 10:55 Maria Colgan – Oracle

Oracle Optimizer: Harnessing The Power Of Optimizer Hints

11:15 – 12:00 Graham Wood – Oracle

A Deep Dive Into the SQL Monitor Report

12:10 – 13:10 Kerry Osborne, Oracle ACE Director – Enkitec

Controlling Execution Plans (Without Touching the Code)

13:55 – 14:40 Tom Kyte – Oracle

5 SQL and PL/SQL Things in the Latest Generation of Database Technology

15:10 – 15:55 Peter Finnigan – PeteFinnigan.com

Oracle Security Round Table

16:20 – 17:05 Alex De Vergori – Betfair

Extreme Online Transaction Processing Using Oracle PL/SQL

17:15 – 18:00 Tom Kyte – Oracle

What’s New in Oracle Database Application Development

October 3, 2012

UKOUG TEBS conference 2012 agenda.

Filed under: Uncategorized — bigdaveroberts @ 3:58 pm

With the arrival of the online agenda, comes the difficult task of planning my conference.

This year is more difficult than most as I’m changing jobs between now and the conference, this means that I may have new imperatives thrust upon me in the next few weeks that might change my priorities.

There are also suggestions on the internet that sessions hinting at latest oracle technologies might be referring to Oracle version 12c! Obviously if that is true that might again change my priorities.

Last year the OAK table Sunday sessions mostly duplicated other sessions, allowing flexibility with 2 bites of the cherry at some of the best sessions.

Finally in the past, I have had the strong expectation that the most popular sessions will also be repeated at SIGs meetings so that I don’t need to attend them at the UKOUG conference. In fact I suspect that many people use SIGs as practice runs for the conference, a practice that seems to be unfortunately in decline.

So to my goals and methods.

I have been a developer and a DBA, in general I have a bias towards DBA technology sessions as I tend to believe that they are beneficial to both disciplines.

I do have a bias towards roundtables, obviously there are no roundtable slides to download and if you don’t attend then you will gain zero benefit from them. However in some areas Round tables often seem to replicate themselves from previous years. For example I wouldn’t feel the need to attend the security roundtable every year. stuff changes but not so often to make attending the session mandatory every year.

So, to Monday:

With the expectation that the session will have 12c content I plan to attend:10:30-11:!5 Tom Kyte – Oracle

KEYNOTE: Oracle’s Latest Generation of Database Technology

If I suspect that there will be little 12c content I might defect to:

10:30 – 11:15 Duncan Mills – Oracle

KEYNOTE: The Future of Development for Oracle Fusion—From Desktop to Mobile to Cloud

11:50 – 12:35 Steve Millidge – C2B2 Consulting

Real Life WebLogic Performance Tuning: Tales and Techniques from the Field

I have personally experienced the obscure methods required to tune Weblogic on Windows and hope that there will be good specific information of use in this session.

Alternatively, I would also love to attend:

11:50 – 12:35 Jonathan Lewis, Oracle ACE Director – JL Computer Consultancy

Creating Test Cases

I think that it is also worth noting that I have already attended this session during the Northern technology day and found it worthwhile:

11:50 – 12:35 Peter Homes – Interoute Application Management

Oracle 10g & 11g Automatic SGA/Memory Management Cautionary tales.

13:00 – 13:45 Tim Hall, Oracle ACE Director – ORACLE-BASE.com

PL/SQL : Stop Making The Same Performance Mistakes

However in case of cancellation it would be:

12:45 – 13:45 Carl Dudley, Oracle ACE Director – University of Wolverhampton

SQL Tips, Techniques and Traps to Avoid

Based largely on the excellent information on the AMIS website:

14:40 – 15:25 Luc Bors – AMIS Services

Survival of the Fittest: How to Evolve Your Oracle Forms to the 21st Century

15:40 – 17:30 Jonathan Lewis, Oracle ACE Director – JL Computer Consultancy

B-Tree Indexes

Although I’ll wonder if I really should have been at:

15:50 – 16:35 Carlos Sierra – Oracle

How to Create in 5 Minutes a SQL Tuning Test Case Using SQLTXPLAIN

And

16:45 – 17:30 John King, Oracle ACE – King Training Resources

What’s Old is New Again: Oracle Forms 11gR2 New Features

17:40 – 18:40

Sport not being my thing, I’ll be looking to fill this time with a trip to:

The Post Office Vaults | Birmingham’s Premier Foreign Bottled Beer 

www.postofficevaults.co.uk/

April 20, 2012

Keep calm and Gather stats!

Filed under: Uncategorized — bigdaveroberts @ 12:53 am

Everything already exists!

Or at least everything exists on the Internet before I’ve thought of it!

The topic of #optimizerbumperstickers hit twitter courtesy of @SQLMaria.

Someone suggested: Keep calm and gather stats!

Short pause, google: ‘keep calm poster generator’, finds: http://www.keepcalm-o-matic.co.uk

A short while later, a mug and a tea-shirt are on their way!

April 17, 2012

Oracle forms application slow when opening new forms with menu role security enabled.

Filed under: 8i,Oracle forms,Performance — bigdaveroberts @ 9:07 pm

I encountered this problem several years ago on an old Oracle 8i/Forms 6i system. After increasing the number of application users from about 250 to 280, the application had become unacceptably slow opening new forms, taking about 5 seconds to open each new form. When a large number of LOVs were actually implemented as new forms this was unacceptable.

I had recently been learning how to interpret statspack reports and I attempted to drill down from the top 5 waits to a suspect Query. Ultimately having identified the problem wait and the suspect hot block I proposed a solution.

Possibly with more experience, I’d have spotted the fact that in the section for most expensive SQL (in terms of buffer gets) one apparently simple SQL statement generated more than 70% of buffer gets:


-> Note that resources reported for PL/SQL includes the resources used by
   all SQL statements called within the PL/SQL code.  As individual SQL
   statements are also reported, it is possible and valid for the summed
   total % to exceed 100

  Buffer Gets    Executions  Gets per Exec  % Total  Hash Value
--------------- ------------ -------------- ------- ------------
     99,955,919          593      168,559.7    71.5   2686798499
select ROLE GRPNAME ,FLAG GRPFLG  from FRM50_ENABLED_ROLES  orde
r by ROLE desc

The question is, why should such a simple query be so resource intensive?

Part of the answer to that question is that the query wasn’t as simple as it appeared in the statspack report. The FRM50_ENABLED_ROLES view is a view installed to support menu security in oracle forms and it is a view created by the script frmsec.sql  and based on other pre-existing views:


create or replace view FRM50_ENABLED_ROLES as
select urp.granted_role role,
sum(distinct decode(rrp.granted_role,
   'ORAFORMS$OSC',2,
   'ORAFORMS$BGM',4,
   'ORAFORMS$DBG',1,0)) flag
from  sys.user_role_privs urp, role_role_privs rrp
where urp.granted_role = rrp.role (+)
  and urp.granted_role not like 'ORAFORMS$%'
group by urp.granted_role;

If you analyse the query it becomes evident that the query isn’t as simple as first anticipated.


Execution Plan
----------------------------------------------------------
0      SELECT STATEMENT Optimizer=CHOOSE (Cost=31373358 Card=2157584180 Bytes=64727525400)
1    0   SORT (ORDER BY) (Cost=31373358 Card=2157584180 Bytes=64727525400)
2    1     VIEW OF 'FRM50_ENABLED_ROLES' (Cost=7471144 Card=2157584180 Bytes=64727525400)
3    2       SORT (GROUP BY) (Cost=7471144 Card=2157584180 Bytes=110036793180)
4    3         MERGE JOIN (OUTER) (Cost=7471144 Card=2157584180 Bytes=110036793180)
5    4           SORT (JOIN) (Cost=61 Card=1010 Bytes=17170)
6    5             VIEW OF 'USER_ROLE_PRIVS' (Cost=53 Card=1010 Bytes=17170)
7    6               SORT (UNIQUE) (Cost=53 Card=1010 Bytes=102161)
8    7                 UNION-ALL
9    8                   SORT (GROUP BY) (Cost=38 Card=601 Bytes=82938)
10    9                     NESTED LOOPS (OUTER) (Cost=6 Card=601 Bytes=82938)
11   10                       NESTED LOOPS (Cost=6 Card=601 Bytes=67312)
12   11                         NESTED LOOPS (Cost=6 Card=147 Bytes=12054)
13   12                           INLIST ITERATOR
14   13                             TABLE ACCESS (BY INDEX ROWID) OF 'SYSAUTH$' (Cost=6 Card=179 Bytes=6981)
15   14                               INDEX (RANGE SCAN) OF 'I_SYSAUTH1' (UNIQUE) (Cost=2 Card=179)
16   12                           INLIST ITERATOR
17   16                             TABLE ACCESS (CLUSTER) OF 'USER$'
18   17                               INDEX (UNIQUE SCAN) OF 'I_USER#' (NON-UNIQUE)
19   11                         TABLE ACCESS (CLUSTER) OF 'USER$'
20   19                           INDEX (UNIQUE SCAN) OF 'I_USER#' (NON-UNIQUE)
21   10                       INDEX (UNIQUE SCAN) OF 'I_DEFROLE1' (UNIQUE)
22    8                   NESTED LOOPS (Cost=7 Card=409 Bytes=19223)
23   22                     FIXED TABLE (FULL) OF 'X$KZDOS' (Cost=7 Card=100 Bytes=1700)
24   22                     TABLE ACCESS (CLUSTER) OF 'USER$'
25   24                       INDEX (UNIQUE SCAN) OF 'I_USER#' (NON-UNIQUE)
26    4           SORT (JOIN) (Cost=7471083 Card=213622196 Bytes=7263154664)
27   26             VIEW OF 'ROLE_ROLE_PRIVS' (Cost=5500690 Card=213622196 Bytes=7263154664)
28   27               SORT (GROUP BY) (Cost=5500690 Card=213622196 Bytes=23925685952)
29   28                 NESTED LOOPS (Cost=26 Card=213622196 Bytes=23925685952)
30   29                   HASH JOIN (Cost=26 Card=2615355 Bytes=214459110)
31   30                     VIEW OF 'VW_NSO_1' (Cost=7 Card=179 Bytes=2327)
32   31                       SORT (UNIQUE) (Cost=7 Card=179 Bytes=4654)
33   32                         FILTER
34   33                           CONNECT BY
35   34                             FILTER
36   35                               INDEX (FAST FULL SCAN) OF 'I_SYSAUTH1' (UNIQUE) (Cost=2 Card=1065 Bytes=13845)
37   35                               FIXED TABLE (FULL) OF 'X$KZDOS' (Cost=7 Card=1 Bytes=13)
38   34                             TABLE ACCESS (BY USER ROWID) OF 'SYSAUTH$'
39   34                             INDEX (RANGE SCAN) OF 'I_SYSAUTH1' (UNIQUE) (Cost=2 Card=179 Bytes=4654)
40   30                     NESTED LOOPS (Cost=14 Card=1461092 Bytes=100815348)
41   40                       TABLE ACCESS (FULL) OF 'SYSAUTH$' (Cost=14 Card=17888 Bytes=697632)
42   40                       TABLE ACCESS (CLUSTER) OF 'USER$'
43   42                         INDEX (UNIQUE SCAN) OF 'I_USER#' (NON-UNIQUE)
44   29                   TABLE ACCESS (CLUSTER) OF 'USER$'
45   44                     INDEX (UNIQUE SCAN) OF 'I_USER#' (NON-UNIQUE)

Ultimately, I believe that the problem was a combination of application design and business process.

Firstly an overly granular security model resulted in up to 59 roles being granted to each user and secondly an absolute refusal to delete expired user accounts and only lock them when they became defunct led to a combination of over 2000 user accounts and over 80000 granted roles.

However without a change in corporate policy, could the problem be resolved in an acceptable manner?

Luckily Metalink has a couple of documents that propose alternative definitions of the FRM50_ENABLED_ROLES view: 107761.1 & 256561.1

While not intended primarily to increase performance, in testing the alternative implementations looked promising.

I raised an SR with Oracle to see what their approach would be and to confirm that they would support these alternative implementations of the view.

Oracle responded with the response that both Forms 6i and the view were unsupported.

The customer might have misunderstood when I explained that the level of support for the new version of the view was the same as that for Forms 6i.

Ultimately the new view definition was implemented and resolved the problem up till the decommissioning of the application earlier this year.

The essential lesson is that when you over-engineer a solution (and by the time I arrived, no one actually really had any understanding as to what the roles actually granted access to!) then even the oracle supplied views can fail!

The chances are that none of the developers at oracle working on Oracle 8i envisioned a system where only 20% of the created users were active and the total number of granted roles reached 80,000, so the issue can’t realistically been seen as foreseeable.

Ultimately I’m confident that the changes since Oracle 8i, where the cost base optimiser is now used to access the data dictionary, are likely to have resolved this issue for later versions, but if you do pick-up a long established Forms application where the back end technology hasn’t been brought up to date then as the number of users grows then this might become a problem for you.

March 16, 2012

New statement of direction for Oracle Reports

Filed under: Uncategorized — bigdaveroberts @ 1:31 am
Tags:

It was my intention, when I attended the last UKOUG development SIG and Grant Ronald gave advanced warning that there was going to be a new “Statement of Direction” for Forms and Reports and that he was going to be working on it that evening, I was hoping to be the first person to blog about it!

However, I’ve been busy, the SOD was delayed and I was beaten to the goal by www.grassroots-oracle.com.

So I have chosen to add my observations to his post:
http://www.grassroots-oracle.com/2012/03/on-oracles-statement-of-direction-for.html
 

Enjoy!

p.s. In the context of this post, SOD is an abbreviation for Statement of Direction rather than a derogatory reference to Mr Ronald!

Next Page »

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.