Search

OakieTags

Who's online

There are currently 0 users and 40 guests online.

Recent comments

Affiliations

Oakies Blog Aggregator

Prize Winners : Managing Multimedia and Unstructured Data in the Oracle Database e-book

A couple of weeks ago I started a competition to win 4 copies of Managing Multimedia and Unstructured Data in the Oracle Database byMarcelle Kratochvil. Thanks to Packt for donating the prizes. The competition closed today and the lucky winners are:

  • Kim Berg Hansen
  • Stuart Uren
  • Steve (dnunknown)
  • Bayu Satria Setiadi

Once I’ve published this post I’ll be sending your email address to my contact at Packt, who will contact you to deliver your e-book.

I was severely tempted to award one of the books to Connor McDonald for his ingenious use of death threats in an attempt to sway the judging process. :)

Cheers

Tim…


Prize Winners : Managing Multimedia and Unstructured Data in the Oracle Database e-book was first posted on April 26, 2013 at 10:37 am.
©2012 "The ORACLE-BASE Blog". Use of this feed is for personal non-commercial use only. If you are not reading this article in your feed reader, then the site is guilty of copyright infringement.

Analysis Challenges

April 25, 2013 Roughly 12 years ago I was attempting to analyze customer order changes that were received through electronic document interchange (EDI), specifically X12 830 documents that show order forecasted demand for specific part numbers.  At the time, the EDI data was partially transformed and inserted into an Oracle 8.0.5 database, while that data […]

E4 2013 – Exadata Conference Call for Papers Closing

 

Just a quick note to remind you that the call for papers for E4 is closing in a few days (on April 30).  So if you have anything you think is interesting related to Exadata that you’d like to share we’d love to hear from you. By the way, you don’t have to be a world renowned speaker on Oracle technology to get accepted. You just need to have an interesting story to tell about your experience. Implementations, migrations and consolidation stories are all worthy of consideration. Any interaction between Exadata and Big Data platforms will also be of great interest to the attendees. Of course the more details you can provide the better.

Here’s a link to the submission page:

Submit an Abstract for Enkitec’s Extreme Exadata Expo

Feel free to shoot me an email if you have ideas for a talk that you want to discuss before formally submitting an abstract.

OPT_PARAM Hint saves the day…

One of the developers was performing a delete using a nested subquery, which was throwing out ORA-00600 errors. The ORA-00600 Lookup Tool on MOS suggested it was caused by this bug:

The workaround in the bug suggested running this ALTER SESSION command.

alter session set "_optimizer_unnest_disjunctive_subq"= FALSE;

Rather than alter the whole session, we used the OPT_PARAM hint, making the subquery look something like this.

(SELECT /*+ OPT_PARAM('_optimizer_unnest_disjunctive_subq' 'FALSE') */ ... FROM ...)

Slap in a comment reminding us to remove the hint when we move to 11.2.0.4 or 12c and job’s a good’un! :)

Cheers

Tim…


OPT_PARAM Hint saves the day… was first posted on April 25, 2013 at 3:08 pm.
©2012 "The ORACLE-BASE Blog". Use of this feed is for personal non-commercial use only. If you are not reading this article in your feed reader, then the site is guilty of copyright infringement.

Database Virtualization: Data as a Service in Healthcare

#0056d6;">MH900423022The healthcare sector has a clear opportunity to modernize care delivery by adopting new data interchange standards and EHR systems. But getting there will first require upgrading aging infrastructure, managing data explosion, and ensuring compliance with new regulations. This translates to more projects and greater costs for IT resources that are already stretched thin. There is a clear need for transformative technologies that will enable healthcare IT teams to tackle the unavoidable wave of big projects faster and with greater efficiency.

Organizations like Presbyterian Healthcare Services, Health Dialog, Independence Blue Cross, European Bioformatics Institute and many others are leveraging Data Virtualization for databases to modernize care delivery and execute IT projects:

On Time: 20-50% greater project output with the same staff
On Quality: 30% fewer production errors through early detection
On Budget: 90% lower application testing costs (capex and opex)

During this webinar, you’ll learn:

  • #0056d6;">How Data Virtualization for databases improves application project output, quality, and cost efficiency
  • #0056d6;">How Data Virtualization for databases can impact specific projects in your organization including ICD-10 migration, healthcare exchange related projects, private cloud rollouts, data center migrations and much more
  • #0056d6;">How Presbyterian Health uses Delphix to implement Data Virtualization for databases to drive cost and operational gains in its claims processing environment?

register

 

Performance Monitoring

Updated – just a quick reminder for next week; I’ll be doing a short webinar next Wednesday comparing the performance monitoring tools Oracle and SQL server provide.

I think I may have broken my record with 6 countries in 6 weeks – so I haven’t been very thorough at updating my blog recently. Just time, before I head off to Heathrow once again, to do a quick advert for the next redgate webinar that I’m doing with Grant Fritchey. This time comparing built-in performance monitoring tools. Details and Registrations at this URL.

I’ll see if I can catch up with a couple of answers while I’m in the airport lounge – but no promises, since the simple act of walking into an airport makes me  feel like falling asleep.

Grid Infrastructure And Database High Availability Deep Dive Seminars 2013

So this is a little bit of a plug for myself and Enkitec but I’m running my Grid Infrastructure And Database High Availability Deep Dive Seminars again for Oracle University. This time these events are online, so no need to come to a classroom at all.

Here is the short description of the course:

Providing a highly available database architecture fit for today’s fast changing requirements can be a complex task. Many technologies are available to provide resilience, each with its own advantages and possible disadvantages. This seminar begins with an overview of available HA technologies (hard and soft partitioning of servers, cold failover clusters, RAC and RAC One Node) and complementary tools and techniques to provide recovery from site failure (Data Guard or storage replication).

In the second part of the seminar, we look at Grid Infrastructure in great detail. Oracle Grid Infrastructure is the latest incarnation of the Clusterware HA framework which successfully powers every single 10g and 11g RAC installation. Despite its widespread implementation, many of its features are still not well understood by its users. We focus on Grid Infrastructure, what it is, what it does and how it can be put to best use, including the creation of an active/passive cold failover cluster for web and database resources.

If you are interested I would like to invite you to head over to the Oracle University website here which has a more extensive synopsis and all the detail you need:

http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getCourseDesc?dc=D81641_2043034

UPDATE: I received several emails and comments that the above link does not work. I couldn’t reproduce this until today. It appears to be an issue with the country selection. If you have USA selected in the top right corner the link won’t work, switching to United Kingdom (my preference) will fetch the course detail. I don’t quite understand as to why that is the case since the class is virtual and not depending on a country…

I hope to hear from you during the course!

Fedora 19 Alpha…

For those eager beavers out there, you can now get hold of Fedora 19 Alpha from the pre-release location.

The release notes can be found here. I’m keen to check out the improvements to MATE in version 1.6, as this is now my standard desktop.

Cheers

Tim…

Update: It installs in Oracle VirtualBox and the guest additions install correctly, so it’s looking good so far. :)


Fedora 19 Alpha… was first posted on April 24, 2013 at 11:53 am.
©2012 "The ORACLE-BASE Blog". Use of this feed is for personal non-commercial use only. If you are not reading this article in your feed reader, then the site is guilty of copyright infringement.

Windows PowerShell…

Followers of the blog know I’m a Linux fan, but over the weekend I needed to fix some stuff on a Windows server at work and I took my first tentative steps into the world of Windows PowerShell. It was very much a case of “scripting by Google”, but I managed to get the job done pretty quickly. That episode prompted this tweet.

powershell-tweet-1

That resulted in two little exchanges. The first from Niall Litchfield, who must have been a little under the weather. :)

powershell-tweet-2

powershell-tweet-3

The second from @WindowsServer.

powershell-tweet-4

powershell-tweet-5

powershell-tweet-6

I think that’s my first interaction with Microsoft on any social network. I sense a new website called “Windows-and-SQL-Server-and-PowerShell-base.com” coming on. :)

Cheers

Tim…

 


Windows PowerShell… was first posted on April 23, 2013 at 7:54 pm.
©2012 "The ORACLE-BASE Blog". Use of this feed is for personal non-commercial use only. If you are not reading this article in your feed reader, then the site is guilty of copyright infringement.

Limiting the Degree of Parallelism via Resource Manager and a gotcha

This might be something very obvious for the reader but I had an interesting revelation recently when implementing parallel_degree_limit_p1 in a resource consumer group. My aim was to prevent users mapped to a resource consumer group from executing any query in parallel. The environment is fictional, but let’s assume that it is possible that maintenance operations for example leave indexes and tables decorated with a parallel x attribute. Another common case is the restriction of PQ resource to users to prevent them from using all the machine’s resources.

This can happen when you perform an index rebuild for example in parallel to speed the operation up. However the DOP will stay the same with the index after the maintenance operation, and you have to explicitly set it back:

SQL> alter index I_T1$ID1 rebuild parallel 4;

Index altered.

SQL> select index_name,degree from ind where index_name = 'I_T1$ID1';

INDEX_NAME		       DEGREE
------------------------------ ----------------------------------------
I_T1$ID1		       4

SQL>

Now when you select from the table and the index is involved you can end up with a parallel query (PQ). Admittedly this example is a little contrived but not too far from reality either.

SQL> select count(1) from t1 a, t1 b
 2 where a.object_id = b.object_id;

  COUNT(1)
----------
     74511

Now I’m getting the execution plan for this statement-I expect it to be parallel:

SQL> select * from table(dbms_xplan.display_cursor);

SQL_ID	66xstr294k2f6, child number 0
-------------------------------------
select count(1) from t1 a, t1 b where a.object_id = b.object_id

Plan hash value: 3484396843

----------------------------------------------------------------------------------------------------------------------
| Id  | Operation                    | Name     | Rows	| Bytes | Cost (%CPU)| Time	|    TQ  |IN-OUT| PQ Distrib |
----------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT	     |		|	|	|   127 (100)|		|	 |	|	     |
|   1 |  SORT AGGREGATE 	     |		|     1 |    26 |	     |		|	 |	|	     |
|   2 |   PX COORDINATOR	     |		|	|	|	     |		|	 |	|	     |
|   3 |    PX SEND QC (RANDOM)	     | :TQ10001 |     1 |    26 |	     |		|  Q1,01 | P->S | QC (RAND)  |
|   4 |     SORT AGGREGATE	     |		|     1 |    26 |	     |		|  Q1,01 | PCWP |	     |
|*  5 |      HASH JOIN		     |		|   134K|  3414K|   127   (4)| 00:00:02 |  Q1,01 | PCWP |	     |
|   6 |       PX BLOCK ITERATOR      |		|   134K|  1707K|    61   (0)| 00:00:01 |  Q1,01 | PCWC |	     |
|*  7 |        INDEX FAST FULL SCAN  | I_T1$ID1 |   134K|  1707K|    61   (0)| 00:00:01 |  Q1,01 | PCWP |	     |
|   8 |       PX RECEIVE	     |		|   134K|  1707K|    61   (0)| 00:00:01 |  Q1,01 | PCWP |	     |
|   9 |        PX SEND BROADCAST     | :TQ10000 |   134K|  1707K|    61   (0)| 00:00:01 |  Q1,00 | P->P | BROADCAST  |
|  10 | 	PX BLOCK ITERATOR    |		|   134K|  1707K|    61   (0)| 00:00:01 |  Q1,00 | PCWC |	     |
|* 11 | 	 INDEX FAST FULL SCAN| I_T1$ID1 |   134K|  1707K|    61   (0)| 00:00:01 |  Q1,00 | PCWP |	     |
----------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   5 - access("A"."OBJECT_ID"="B"."OBJECT_ID")
   7 - access(:Z>=:Z AND :Z=:Z AND :Z<=:Z)

OK, that’s been done in parallel. But I don’ want it to run in parallel!

So the task at hand is to explicitly disable PQ for users connecting via service OLTP_SRVC. I spare you the detail of the creation of the consumer group, for this example I have created the group and assigned user martin to it. The mapping to the consumer group is based on the service name. I had to explicitly grant my user the right to switch consumer group as shown here:

BEGIN
 dbms_resource_manager_privs.grant_switch_consumer_group(
  GRANTEE_NAME   => 'MARTIN',
  CONSUMER_GROUP => 'OLTP_GRP',
  GRANT_OPTION   => FALSE);
END;
/

Then it’s time to create the plan and corresponding directives. The relevant piece of code is shown here:

BEGIN
 dbms_resource_manager.clear_pending_area();
 dbms_resource_manager.create_pending_area();

 -- more code

 dbms_resource_manager.create_plan_directive(
 plan => 'someplan',
 group_or_subplan => 'OLTP_GRP',
 mgmt_p2 => 65,
 comment => 'no parallel!',
 parallel_degree_limit_p1 => 0
 );

 -- more code

 dbms_resource_manager.validate_pending_area();
 dbms_resource_manager.submit_pending_area();
end;
/

After the familiar “PL/SQL procedure completed successfully” message I enabled someplan, I was all ready to enjoy the success-but wait!

There’s something strange, at least to me. I connected using the service and executed the query again but NO CHANGE. The optimizer still uses a parallel execution plan:

SQL> select * from table(dbms_xplan.display_cursor);
SQL_ID	66xstr294k2f6, child number 0
-------------------------------------
select count(1) from t1 a, t1 b where a.object_id = b.object_id

Plan hash value: 3484396843

----------------------------------------------------------------------------------------------------------------------
| Id  | Operation		     | Name	| Rows	| Bytes | Cost (%CPU)| Time	|    TQ  |IN-OUT| PQ Distrib |
----------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT	     |		|	|	|   127 (100)|		|	 |	|	     |
|   1 |  SORT AGGREGATE 	     |		|     1 |    26 |	     |		|	 |	|	     |
|   2 |   PX COORDINATOR	     |		|	|	|	     |		|	 |	|	     |
|   3 |    PX SEND QC (RANDOM)	     | :TQ10001 |     1 |    26 |	     |		|  Q1,01 | P->S | QC (RAND)  |
|   4 |     SORT AGGREGATE	     |		|     1 |    26 |	     |		|  Q1,01 | PCWP |	     |
|*  5 |      HASH JOIN		     |		|   134K|  3414K|   127   (4)| 00:00:02 |  Q1,01 | PCWP |	     |
|   6 |       PX BLOCK ITERATOR      |		|   134K|  1707K|    61   (0)| 00:00:01 |  Q1,01 | PCWC |	     |
|*  7 |        INDEX FAST FULL SCAN  | I_T1$ID1 |   134K|  1707K|    61   (0)| 00:00:01 |  Q1,01 | PCWP |	     |
|   8 |       PX RECEIVE	     |		|   134K|  1707K|    61   (0)| 00:00:01 |  Q1,01 | PCWP |	     |
|   9 |        PX SEND BROADCAST     | :TQ10000 |   134K|  1707K|    61   (0)| 00:00:01 |  Q1,00 | P->P | BROADCAST  |
|  10 | 	PX BLOCK ITERATOR    |		|   134K|  1707K|    61   (0)| 00:00:01 |  Q1,00 | PCWC |	     |
|* 11 | 	 INDEX FAST FULL SCAN| I_T1$ID1 |   134K|  1707K|    61   (0)| 00:00:01 |  Q1,00 | PCWP |	     |
----------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   5 - access("A"."OBJECT_ID"="B"."OBJECT_ID")
   7 - access(:Z>=:Z AND :Z=:Z AND :Z<=:Z)

I made sure the consumer group was indeed OLTP_GRP (visible from v$session). I flushed the statement from the shared pool (as described here for example), when that didn’t help I flushed the flushed the whole shared pool (in my lab-don’t just flush the shared pool!) but still no change. I proverbially scratched my head a for moment and then decided to check if there wasn’t any more information about DBRM and its decisions available. Sure enough there is (the Oracle DBMS is really well instrumented)

So whenever you are in doubt you can check the meta information about resource manager: v$resource_consumer_group:

SQL> select name,pqs_completed,pq_servers_used from V$RSRC_CONSUMER_GROUP
  2  where name = 'OLTP_GRP'
  3  /

NAME                             PQS_COMPLETED PQ_SERVERS_USED
-------------------------------- ------------- ---------------
OLT_GRP                                      1               0

SQL>

Aha! So it appears that there is a parallel execution plan even though it doesn’t execute in parallel. I would have expected a “parallel force serial” in the plan but there is no such thing. Also, when using Real Time SQL Monitor you won’t see any information about a DOP (requested/used) so there is additional proof that the execution was performed in serial. What initially left me puzzled though is that there was no serial execution plan.

Conclusion

The observed behaviour makes complete sense once you think about it for a moment. The optimizer does not know about the DBRM restriction, and it won’t kick in until run-time. When the optimizer hard-parses a statement it believes it has all the required resources available in form of the parallel% parameters, but that is not the case. I assume that their implementation allowed the Oracle engineers to use a more generic code to implement DOP restrictions, out of which DOP=0 really only is an edge case. I will test a little more if there is an overhead with the approach. In the meantime, if you really need this you could use the following login trigger for example (if you have no control over the code of course!)

SQL> get trigger
  1  create or replace trigger force_serial
  2  after logon on database
  3  declare
  4   v_service_name varchar2(100);
  5  begin
  6   v_service_name := sys_context('userenv','service_name');
  7
  8   if v_service_name = 'OLTP_SRV' then
  9    execute immediate 'alter session disable parallel query';
 10
 11   end if;
 12
 13* end;
SQL>

This is an example only and must complement the DBRM settings shown above. Admittedly it is not the most elegant way of forcing a truly serial execution and it doesn’t prevent a user from overriding the settings in his session but if your users cannot execute “alter session” than it helps a little.