Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> ANNOUNCE: DDL::Oracle v1.05

ANNOUNCE: DDL::Oracle v1.05

From: Richard Sutherland <rvsutherland_at_yahoo.com>
Date: Sun, 11 Mar 2001 13:01:54 -0500
Message-ID: <tanfba1jgur3d6@corp.supernews.com>


                   Release of DDL::Oracle, Version 1.05

===========================================================================

CHANGES In version 1.04, use by users without SELECT privileges on V$ views was facilitated by adding attributes to the 'configure' method. By setting the 'heading' attribute to "0" and supplying values for 'blksize' and 'version' attributes, a non-privileged user could bypass the queries to V$DATABASE, V$PARAMETER and V$VERSION, respectively.

Andy Duncan (author of Perl module Orac) supplied queries which any user could execute to SELECT the values for version and block size. Thus, the configure attributes 'blksize' and 'version' are now deprecated, and privileges on V$PARAMETER and V$VERSION are no longer required. The 'heading' attribute remains in use as previously described. THANKS, Andy.

Added configure method attribute 'prompt'. Set this attribute to "0" to elimate the "PROMPT blah..." syntax normally produced for the benefit of SQL*Plus command scripts.

DESCRIPTION Designed for Oracle DBA's and users, for Oracle versions 7.3, 8.0 and 8i. Reverse engineers database objects (tables, indexes, users, profiles, tablespaces, roles, constraints, etc.). Generates DDL to *resize* tables and indexes to the provided standard or to a user defined standard. Can reorganize/defragment tablespaces.

SYNOPSIS use DBI;
use DDL::Oracle;

my $dbh = DBI->connect(

                        "dbi:Oracle:dbname",
                        "username",
                        "password",
                        {
                         PrintError => 0,
                         RaiseError => 1
                        }
                      );

# Use default resizing and schema options. # query default DBA_xxx tables (could use USER_xxx for non-DBA types) DDL::Oracle->configure(

                        dbh    => $dbh,
                      );

# Create a list of o
ne or more objects
my $sth = $dbh->prepare(

       "SELECT
               owner
             , name
        FROM
               dba_tables
        WHERE
               tablespace_name = 'MY_TBLSP'    -- your millage may vary
       "

    );
$sth->execute;
my $list = $sth->fetchall_arrayref;

my $obj = DDL::Oracle->new(

                            type  => "table",
                            list  => $list,                          );
                          );

my $ddl = $obj->create;      # or $obj->resize;  or $obj->drop;  etc.

print $ddl; # Use STDOUT so user can redirect to desired file.

AUTHOR Richard V. Sutherland
rvsutherland_at_yahoo.com

COPYRIGHT Copyright (c) 2000, 2001 Richard V. Sutherland. All rights reserved. This module is free software. It may be used, redistributed, and/or modified under the same terms as Perl itself. See:

    http://www.perl.com/perl/misc/Artistic.html


                       AVAILABILITY

===========================================================================

DDL::Oracle is available from the CPAN, and from:

    http://sourceforge.net/projects/ddl-oracle/ Received on Sun Mar 11 2001 - 12:01:54 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US