From oracle-l-bounce@freelists.org  Wed Jul  7 17:38:45 2004
Return-Path: <oracle-l-bounce@freelists.org>
Received: from air189.startdedicated.com (root@localhost)
 by orafaq.com (8.11.6/8.11.6) with ESMTP id i67McUA05561
 for <oracle-l@orafaq.com>; Wed, 7 Jul 2004 17:38:40 -0500
X-ClientAddr: 206.53.239.180
Received: from turing.freelists.org (freelists-180.iquest.net [206.53.239.180])
 by air189.startdedicated.com (8.11.6/8.11.6) with ESMTP id i67McK605518
 for <oracle-l@orafaq.com>; Wed, 7 Jul 2004 17:38:30 -0500
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP
 id 99E3272C96D; Wed,  7 Jul 2004 17:19:41 -0500 (EST)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing [127.0.0.1]) (amavisd-new, port 10024) with ESMTP
 id 22248-82; Wed,  7 Jul 2004 17:19:41 -0500 (EST)
Received: from turing (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP
 id C27D572C995; Wed,  7 Jul 2004 17:19:40 -0500 (EST)
Received: with ECARTIS (v1.0.0; list oracle-l); Wed, 07 Jul 2004 17:18:14 -0500 (EST)
X-Original-To: oracle-l@freelists.org
Delivered-To: oracle-l@freelists.org
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 162B772C6F8
 for <oracle-l@freelists.org>; Wed,  7 Jul 2004 17:18:14 -0500 (EST)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing [127.0.0.1]) (amavisd-new, port 10024) with ESMTP
 id 22248-49 for <oracle-l@freelists.org>;
 Wed,  7 Jul 2004 17:18:13 -0500 (EST)
Received: from amber.monochrome.net (unknown [63.247.74.106])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 91A8B72C7D5
 for <oracle-l@freelists.org>; Wed,  7 Jul 2004 17:18:13 -0500 (EST)
Received: from delysid by amber.monochrome.net with local (Exim 4.24)
 id 1BiL79-00087g-Pz
 for oracle-l@freelists.org; Wed, 07 Jul 2004 17:42:07 -0500
Received: from 64.37.153.21 ([64.37.153.21])
        (SquirrelMail authenticated user thump@cosmiccooler.org)
        by www.cosmiccooler.org with HTTP;
        Wed, 7 Jul 2004 15:42:07 -0700 (PDT)
Message-ID: <2157.64.37.153.21.1089240127.squirrel@www.cosmiccooler.org>
In-Reply-To: <1984.64.37.153.21.1089237711.squirrel@www.cosmiccooler.org>
References: <BAY12-F4KIBXEHt3V5g0000070c@hotmail.com> 
     <1984.64.37.153.21.1089237711.squirrel@www.cosmiccooler.org>
Date: Wed, 7 Jul 2004 15:42:07 -0700 (PDT)
Subject: fire off multiple dbms_stats.gather_schema
From: "David" <thump@cosmiccooler.org>
To: oracle-l@freelists.org
User-Agent: SquirrelMail/1.4.0
MIME-Version: 1.0
Content-type: text/plain; charset=iso-8859-1
X-Priority: 3
Importance: Normal
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - amber.monochrome.net
X-AntiAbuse: Original Domain - freelists.org
X-AntiAbuse: Originator/Caller UID/GID - [32014 32014] / [47 12]
X-AntiAbuse: Sender Address Domain - amber.monochrome.net
X-Virus-Scanned: by amavisd-new at freelists.org
Content-Transfer-Encoding: 8bit
X-archive-position: 4608
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-To: oracle-l-bounce@freelists.org
X-original-sender: thump@cosmiccooler.org
Precedence: normal
Reply-To: oracle-l@freelists.org
X-list: oracle-l
X-Virus-Scanned: by amavisd-new at freelists.org

I am using dynamic sql to generate code that will analyze schemas.  I
would just gather_database stats, but the request is that I use
dbms_stats.gather_Schema so that the process can be broken down into
concurrent sets and run concurrently(and with parallel).  Does anyone have
any advice, ideas or tips on how I might accomplish this?

Here is what I'm currently using:
select
'exec dbms_stats.gather_schema_stats(ownname=> ' ||chr(39)||
owner||chr(39)||' ,estimate_percent=> 10 ,cascade=> TRUE , block_sample=>
TRUE ,degree=> 4);'
 FROM   DBA_TABLES
  WHERE OWNER NOT IN ('SYS')
  AND   PARTITIONED = 'NO'
  AND   LAST_ANALYZED < SYSDATE - 14
UNION
select
'exec dbms_stats.gather_schema_stats(ownname=> ' ||chr(39)||
owner||chr(39)||' , estimate_percent=> 10 ,cascade=> TRUE , block_sample=>
TRUE ,degree=> 4);'
 FROM   DBA_TABLES
  WHERE OWNER NOT IN ('SYS')
  AND   LAST_ANALYZED IS NULL;

Yes, I do know that the options clause will take care of some of the
functionality that I am filtering via the predicate and I have plans to
incorporate that feature.
Thanks!
-- 
..
David

----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@freelists.org
put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

