Changeset 4445:9ef98d8d2703 in livinglogic.python.xist

Show
Ignore:
Timestamp:
04/05/11 15:33:19 (8 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Add docstring for oracreate.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/ll/orasql/scripts/oracreate.py

    r4422 r4445  
    1010 
    1111 
     12""" 
     13Purpose 
     14------- 
     15 
     16``oracreate`` prints the DDL of all objects in an Oracle database schema it a 
     17way that can be used to recreate the schema (i.e. objects will be ordered so 
     18that no errors happen for non-existant objects during script execution). 
     19``oracreate`` can also be used to actually recreate the schema. 
     20 
     21 
     22Options 
     23------- 
     24 
     25``oracreate`` supports the following options: 
     26 
     27    ``connectstring`` 
     28        An Oracle connectstring. 
     29 
     30    ``-v``, ``--verbose`` : ``false``, ``no``, ``0``, ``true``, ``yes`` or ``1`` 
     31        Produces output (on stderr) while to datebase is read or written. 
     32 
     33    ``-c``, ``--color`` : ``yes``, ``no`` or ``auto`` 
     34        Should the output (when the ``-v`` option is used) be colored. If ``auto`` 
     35        is specified (the default) then the output is colored if stderr is a 
     36        terminal. 
     37 
     38    ``-s``, ``--seqcopy`` : ``false``, ``no``, ``0``, ``true``, ``yes`` or ``1`` 
     39        Outputs ``CREATE SEQUENCE`` statements for the existing sequences that have 
     40        the current value of the sequence as the starting value. (Otherwise the 
     41        sequences will restart with their initial value) 
     42 
     43    ``-x``, ``--execute`` : connectstring 
     44        When the ``-x`` argument is given the SQL script isn't printed on stdout, 
     45        but executed in the database specfied as the ``-x`` argument. 
     46 
     47    ``-k``, ``--keepjunk`` : ``false``, ``no``, ``0``, ``true``, ``yes`` or ``1`` 
     48        If given, database objects that have ``$`` or ``SYS_EXPORT_SCHEMA_`` in 
     49        their name will be skipped (otherwise these objects will be included). 
     50 
     51    ``-i``, ``--ignore`` : ``false``, ``no``, ``0``, ``true``, ``yes`` or ``1`` 
     52        If given, errors occuring while it database is read or written will be 
     53        ignored. 
     54 
     55    ``-e``, ``--encoding`` : encoding 
     56        The encoding of the output (if ``-x`` is not given; default is ``utf-8``). 
     57 
     58 
     59Examples 
     60-------- 
     61 
     62Print the content of the database schema ``user@db``:: 
     63 
     64    $ oracreate user/pwd@db >db.sql 
     65 
     66Copy the database schema ``user@db`` to ``user2@db2``:: 
     67 
     68    $ oracreate user/pwd@db -x user2/pwd2@db2 -v 
     69""" 
     70 
     71 
    1272import sys, os, argparse 
    1373 
    1474from ll import misc, astyle, orasql 
     75 
     76 
     77__docformat__ = "reStructuredText" 
    1578 
    1679