Re: Details needed on using the parallel query option
Date: 1996/09/26
Message-ID: <324AA3DA.8E9_at_teldta.com>#1/1
Brian M. Biggs wrote:
> The way I understand the parallel query option, it can be invoked
> primarily in 2 ways:
> (1) by ALTERing a table and indicating that it is a parallel table
> (2) putting hints in your SQL code to indicate that a certain SQL
> statement should be executed in parallel.-SNIP-
> Is there a way to tell Oracle "only execute this query in parallel if
> you have more than 1 processor"? Or, rather than being that specific,
> is there a better way to control when your application does and does not
> use the parallel query option? What is the best way to manage this
> feature?
What you need is a PRO*C program that calls the sysconf() system call. With the "_SC_NPROCESSORS_CONF" argument it will return the number of cpu's (processors) the system has. Then the PRO*C program could do the proper "alter table schema.table_name parallel(degree n)" or "alter table schema.table_name noparallel" based on the tables overall size as returned with a query against dba_segments.
Looking at the man pages for sysconf() on AIX 3.2.5 I see it doesn't return the number of cpu's (assume 1), AIX 4.1 should work fine, as does SUN Solaris 2+. I didn't see anything on our HP9 and we don't have a HP10 so I don't know what to do in the HP environment.
Also, don't forget the required init.ora parameters for parallel query.
-- \\|// (0-0) +-----oOO----(_)-----------+ | Brian P. Mac Lean | | Database Analyst | | brian.maclean_at_teldta.com | | http://www.teldta.com | +-------------------oOO----+ |__|__| || || ooO OooReceived on Thu Sep 26 1996 - 00:00:00 CEST