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.06

ANNOUNCE: DDL::Oracle v1.06

From: Richard Sutherland <rvsutherland_at_yahoo.com>
Date: Mon, 19 Mar 2001 21:19:41 -0500
Message-ID: <tbdfg9fm12ee57@corp.supernews.com>


                   Release of DDL::Oracle, Version 1.06

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

CHANGES Added a new instance method -- 'show_space' -- which displays a report such as the following:

   Space analysis for: [schema.]<object name>

                                                    BYTES     BLOCKS
                                             ============  =========
   Used BELOW the high water mark                 1325056        647
   Free ABOVE the high water mark                  716800        350
   Free BELOW the high water mark                    6144          3
                                             ------------  ---------
                 TOTAL in segment                 2048000       1000

                                        FILE_ID  BLOCK_ID  BLOCK_NBR
                                        =======  ========  =========
   Last extent having data                    9     10287        150

For partitioned tables, it displays a section for each partition, followed by totals for the table/index. The user must have EXECUTE privileges on package sys.DBMS_SPACE for this method to respond.

Fixed bug #408724, by upgrading CREATE TRIGGER statements to distinguish between Oracle8i and earlier versions. THANKS to Martin Drautzburg for reporting this error!

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 one or more ob
jects
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 Mon Mar 19 2001 - 20:19:41 CST

Original text of this message

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