Oracle Training Oracle Tips Oracle Forum Class Catalog Remote DBA Oracle Tuning Emergency 911 RAC Support Apps Support Analysis Design Implementation Oracle Support
SQL Tuning Security Oracle UNIX Oracle Linux Monitoring Remote support Remote plans Remote services Application Server Applications Oracle Forms Oracle Portal App Upgrades SQL Server Oracle Concepts Software Support Remote Support
Consulting Staff Consulting Prices Help Wanted!
Oracle Posters Oracle Books Oracle Scripts Ion Excel-DB
Optimizing performance with Oracle parallel query Feb 15, 2001 Donald Burleson
In "Using parallel Oracle for high-speed e-commerce systems," I explained how Oracle's parallel query and Parallel Server features can help you build a better e-commerce system. Now it's time to turn our attention to some additional approaches for achieving that speedy e-commerce system.
Oracle parallel query is very important as Oracle database move onto SMP servers with 8, 16, 32 and 64 CPU processors. On these servers, the speed of full-table scans and index fast-full scans can be greatly improved:
Invoking Parallelism
There are several ways to invoke Oracle parallel query, and some of them are very dangerous because they influence the costs assigned to full-table scans.
select /*+ parallel (c, 31) (e, 31) */ . . . .
Parallel DBA operations With 24/7 e-commerce databases on the Web, the Oracle DBA is challenged to perform maintenance duties as fast as possible. Oracle has several tools that can implement the parallelization approach to improve manageability and speed up the processing performance of Oracle database administration. There are several areas where the DBA can use parallel operations to speed Oracle maintenance.
Parallelization promises to become even more popular with the increased use of Oracle parallel server (OPS). Oracle8i's new parallel IDML features are also expected to improve the parallel capabilities of database administration. These features are the PARALLEL CREATE TABLE AS SELECT (PCTAS) statement and parallel index rebuilding, which I'll describe briefly in the following sections. PARALLEL CREATE TABLE AS SELECT (PCTAS) The PARALLEL CREATE TABLE AS SELECT (PCTAS) statement can be useful in an Oracle environment where tables are reorganized by copying them to another tablespace. For example, you could specify the number of parallel processes to compute the monthly summary values from your fact table. In the following example, we assign five processes to simultaneously read the blocks from a fact table in a warehouse that was populated from operational data: CREATE TABLE SALESPERSON_SUMMARY_03_00 PARALLEL (degree 5) AS SELECT region, salesperson, sum(sale_amount) FROM
Parallel index builds
Parallelized Oracle queries The parallelized query technique allows a single program to make multiple requests to the Oracle database in parallel. It is not a feature of the Oracle database, but a method that is very popular with programmers who need to perform many simultaneous queries against a database. To illustrate how parallelized queries work, consider the following example. Assume that we have an Oracle database that contains electronic books. In addition to the book text, we also have another table that contains notes about the text. At page retrieval time, we need the following information:
As we see below, instead of waiting for each query to complete independently for a total elapsed time of six seconds, each query is submitted to Oracle at the same instant for a total elapsed time of three seconds.
While the C or Java program is waiting for the Oracle queries to complete, it is free to do other work. For example, since the page text is returned in only one second, the program can map out the text to the end user while waiting for the illustration and notes queries to complete. Basic Web server multithreading of parallelized Oracle queries Within the Web server code, multithreading can be implemented by using POSIX extensions that allow for multithreading within the same program address space. Internally to the C++ program, the multithreading is done with a function call, where multiple copies of the function may simultaneously exist within the address space of the C++ program. To make concurrent database requests from C++ programs, some programmers choose to set a semaphore or use an interrupt to manage the simultaneous external requests. However, this approach requires that the programmer create a listener thread to determine when the simultaneous requests have completed. A more popular solution to multiple simultaneous database requests is to use the POSIX library. POSIX offers the pthread_create function, which can be used to create a new thread within the program. POSIX also offers a pthread_join function that will signal the program when the external function has completed. Using these methods, the programmer can write Web server code that will submit and manage multiple simultaneous requests to Oracle. Summary The four components of Oracle parallelism can be used together to create an e-commerce database that runs very fast and can be quickly maintained. To recap, here are the basic features:
Burleson is the American Team
Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals. Feel free to ask questions on our Oracle forum.
Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.
Errata? Oracle technology is changing and we strive to update our BC Oracle support information. If you find an error or have a suggestion for improving our content, we would appreciate your feedback. Just e-mail: and include the URL for the page.
Burleson Consulting The Oracle of Database Support Oracle Performance Tuning Remote DBA Services Copyright © 1996 - 2011 by Burleson Enterprises All rights reserved. Oracle © is the registered trademark of Oracle Corporation.
Burleson Consulting The Oracle of Database Support Oracle Performance Tuning
Oracle Performance Tuning
Remote DBA Services
Copyright © 1996 - 2011 by Burleson Enterprises
All rights reserved.
Oracle