Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Extracting full DDL from

2 views
Skip to first unread message

Altus

unread,
May 15, 2008, 1:04:30 PM5/15/08
to
I need to generate the DDL for all packages in one schema. It has to
be an executable file so it can be run with one command.
SQL> @allpackage.sql

Problems:
select from dba_source... ;
is lacking the final “/” and the beginning “CREATE OR REPLACE”

Using DBMS_METADATA causes failures when the output is split across
two chunks.
... from XYZ where pri_key_v <end of chunk>
<start of chunk>alue = 5;

Does anybody have a clean way to produce this code?

Oracle Enterprise 9.2.0.8 on solaris 8. (yes, this box is old. We do
have better for other apps.)

sybr...@hccnet.nl

unread,
May 15, 2008, 4:33:09 PM5/15/08
to


In my experience it boils down the classical settings for single
column output

set heading off newpage 0 pagesize 0 feedback off
-- for dbms_metadata
set long 100000000000000 (whatever big number)
set linesize 132


hth
--
Sybrand Bakker
Senior Oracle DBA

Terry Dykstra

unread,
May 15, 2008, 5:15:05 PM5/15/08
to
<sybr...@hccnet.nl> wrote in message
news:mc7p24tja3s0vfitj...@4ax.com...

A great tool to generate this kind of stuff is the freeware DDLWizard, which
uses an export file created with rows=n.
http://www.ddlwizard.com/

--
Terry Dykstra


Michael Austin

unread,
May 15, 2008, 9:43:57 PM5/15/08
to


10g and 11g have a few more tools akin to the Oracle/Rdb (formerly
DEC/Rdb) command : rmu/extract/item=database or item=all... you could
do the database, tables, procedures, etc... or just let it create the
whole thing...

Alas, Oracle/Rdb is where Oracle RDBMS got most all of it's new features
like partioned and locally managed, autoextend autoallocate tablespaces
not to mention the CBO.

Mark D Powell

unread,
May 16, 2008, 10:12:54 AM5/16/08
to
On May 15, 9:43 pm, Michael Austin <maus...@firstdbasource.com> wrote:
> not to mention the CBO.- Hide quoted text -
>
> - Show quoted text -

Oracle has definitely picked up some features and/or methods from RDB
but Oracle had a CBO before it purchased RDB. It really came from
Ingres since Oracle hired the person behind the Ingres CBO to help
develop the CBO for version 7.0. Also Oracle ported some of the
features of Oracle into RDB. Oracle and DEC go way back so knowing
where any feature really came from is iffy at best.

IMHO -- Mark D Powell --

neil kodner

unread,
May 16, 2008, 1:18:22 PM5/16/08
to

Have you tried using datapump?

use
INCLUDE=PACKAGE
INCLUDE=PACKAGE_BODY

in your parameter file, and then use impdp and the sqlfile parameter.
It produces nicely formatted output.

doh! I just realized that you're using 9i. Hopefully someone else
will find this useful :D

0 new messages