Giter Site home page Giter Site logo

scheme2ddl's Introduction

Latest version of 'scheme2ddl' @ Cloudsmith   Build Status   Coverage Status

scheme2ddl is command line util for export oracle schema to set of ddl scripts. Provide a lot of configurations via basic command line options or advanced XML configuartion.

scheme2ddl is part of oracle-ddl2svn project.

Benefits

scheme2ddl give ability to filter undesirable information, separate DDL in different files, pretty format output.

Download

Use link above or

wget https://dl.cloudsmith.io/public/qwazer/repo/maven/com/googlecode/scheme2ddl/2.4.4/scheme2ddl-2.4.4.jar

How to start with minimal configuration

Java must be installed on your computer.

For exporting oracle scheme you must provide

  • DB connection string
  • output directory

Usage example. Command

java -jar scheme2ddl.jar -url scott/tiger@localhost:1521:ORCL -o C:/temp/oracle-ddl2svn/

will produce directory tree

 views/
       view1.sql
       view2.sql
 tables/
       table1.sql
 functions
      /f1.sql  

More command line options

java -jar scheme2ddl.jar -help
...
    Options: 
      -help, -h                  print this message
      -url,                      DB connection URL
                                 example: scott/tiger@localhost:1521:ORCL
      -o, --output,              output dir
      -p, --parallel,            number of parallel thread (default 4)
      -s, --schemas,             a comma separated list of schemas for processing
                                 (works only if connected to oracle as sysdba)
      -c, --config,              path to scheme2ddl config file (xml)
      -f, --filter,              filter for specific DDL objects
                                 every LIKE wildcard can be used
      -tf, --type-filter,        filter for specific DDL object types
      -tfm, --type-filtermode,   mode for type filter: include(default) or exclude
      --stop-on-warning,         stop on getting DDL error (skip by default)
      -rsv,                      replace actual sequence values with 1 
      --replace-sequence-values, 
      -tc,--test-connection,     test db connection available
      -version,                  print version info and exit

On Unix platform you can run scheme2ddl.jar as executable file:

chmod +x scheme2ddl.jar
./scheme2ddl.jar 

How it is work inside?

  1. First, get list of all user_object to export
select * from user_objects
  1. then applying dbms_metadata.set_transform_param
  2. for every user object invoke dbms_metadata.get_ddl and dbms_metadata.get_dependent_ddl
  3. print every ddl to separate file grouped in folders like tables, views, procedures etc

scheme2ddl build on top of spring-batch framework.

scheme2ddl's People

Contributors

chenzhang22 avatar dependabot[bot] avatar gquerret avatar qwazer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scheme2ddl's Issues

cannot get DLL for object type QUEUE

What steps will reproduce the problem?
I execute the command line jar file to process an Oracle database schema with 
objects of type QUEUE.

What is the expected output? What do you see instead?
I see the error message ORA-31600 : invalid input value QUEUE for parameter 
OBJECT_TYPE in function GET_DDL.  I tested the GET_DDL oracle function in SQL 
DEVELOPER and sure enough QUEUE is an invalid object type input parameter.  I 
googled for valid Oracle object types for GET_DDL and found two object types 
that are related to the queue type. AQ_QUEUE(for queues) and AQ_QUEUE_TABLE(for 
table queues).  I am not sure how to determine queue type to help you fix this. 
 I am new to Oracle. 

What version of the product are you using? On what operating system?
Oracle 11g 11.2.0.3.0 - 64 bit, Windows Server 2008 R2 Standard


Original issue reported on code.google.com by [email protected] on 2 Oct 2014 at 9:14

Enhancement - Export grants and received grants

I added a functionality that allows us to export all grants into a separate directory. The old behaviour of putting the grants to the parent DDL object is not affected by my change.
Additionally I added a function that exports all grants I receive from other schemes!

So I get every grant that my scheme/application needs and everything i grant to others as well.
I named the new objects/folders "GRANTS" and "RECEIVED_GRANTS".

If someone is interested I could commit my changes, or simply provide a patch file here.

Let me know.

JOB in sysdba mode

Error during select dbms_metadata.get_ddl('PROCOBJ', 'AUTO_SPACE_ADVISOR_JOB') 
from dual
Try to exclude type 'JOB' in advanced config excludes section

Sample:

 <util:map id="excludes">
...
         <entry key="JOB">
            <set>
                <value>AUTO_SPACE_ADVISOR_JOB</value>
            </set>
        </entry>
...
</util:map>
Saved sequence cache_stats_seq_0 to file 
D:\projects\GoogleCode_SVN\scheme2ddl_spring_batch\buildserver\SYS\sequences\cac
he_stats_seq_0.sql
Saved package dbms_pitr to file 
D:\projects\GoogleCode_SVN\scheme2ddl_spring_batch\buildserver\SYS\packages\dbms
_pitr.sql
Encountered an error executing the step
org.springframework.jdbc.UncategorizedSQLException: ConnectionCallback; 
uncategorized SQLException for SQL []; SQL state [99999]; error code [31603]; 
ORA-31603: object "AUTO_SPACE_ADVISOR_JOB" of type PROCOBJ not found in schema 
"SYS"
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
ORA-06512: at "SYS.DBMS_METADATA", line 2805
ORA-06512: at "SYS.DBMS_METADATA", line 4333
ORA-06512: at line 1
; nested exception is java.sql.SQLException: ORA-31603: object 
"AUTO_SPACE_ADVISOR_JOB" of type PROCOBJ not found in schema "SYS"
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
ORA-06512: at "SYS.DBMS_METADATA", line 2805
ORA-06512: at "SYS.DBMS_METADATA", line 4333
ORA-06512: at line 1

    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:349)
    at com.googlecode.scheme2ddl.dao.UserObjectDaoImpl.executeDbmsMetadataGetDdl(UserObjectDaoImpl.java:85)
    at com.googlecode.scheme2ddl.dao.UserObjectDaoImpl.findPrimaryDDL(UserObjectDaoImpl.java:79)
    at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)

Original issue reported on code.google.com by [email protected] on 1 May 2013 at 11:48

Exclude generated SQL collection types in default/sample config.

When you create a pipelined function that returns a PL/SQL collection type 
Oracle will automagically generate a compatible SQL collection type.
The names of these types are prefixed with "sys_plsql_[object_id]".
Where [object_id] is the object_id (as found in all_objects) of the package the 
PL/SQL type is declared in.
As these types where auto generated by Oracle and should (probably) not be 
(re-)created manually it's safe(r) to not include them in de ddl export.

So I suggest to add
    <value>sys_plsql_*</value>
to the exlusion list for "TYPE"

Regards,
Mark.

Original issue reported on code.google.com by [email protected] on 10 May 2013 at 9:39

Windows private names

What steps will reproduce the problem?
1.Create a table with the name "PRN"
2.Execute the scheme2ddl command
3.When the script tries to create prn.sql it crashes 
  because prn.sql is a reserved name on windows platform.

What is the expected output? What do you see instead?
I see " java.io.FileNotFoundException: c:\PIORPI\alfa2\ALFA\tables\prn.sql (El 
sistema no puede encontrar el archivo especificado)"

What version of the product are you using? On what operating system?
Windows, the latest version.

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 18 Mar 2015 at 11:25

Dependency on connect as SYS AS SYSDBA extract DDL for all schemas

Do you think connect as SYS AS SYSDBA required to extract DDL for all schemas. 
Can't we connect as any normal user who has SELECT_CATALOG_ROLE to extract DDL 
of all schemas from database.

In that case, we need to remove the dependency on connect as SYS as SYSDBA to 
extract DDLs for other schemas.

Original issue reported on code.google.com by [email protected] on 20 May 2013 at 9:41

applyTransformParameters not set for jobs and dblinks

applyTransformParameters() is not called before running an export for Jobs or DB links.
If a scheme only has DB Links the transformParams_for_dbms_metadata from the xml file, are not set!
If you are lucky and have regular objects like tables, views, etc first, than also jobs and dblinks get this params implicit.

Worse than all this was my scenario where I had one table and only db links in a schema:

The program opens 4 threads by default and the first one had the table and some db links, and the other only had db links.
The result was that some db link export files had an ; at the end (as defined in the xml) and others didn't. And this was mixed randomly with every export!

I found a solution for this, so ask me if you need a patch. I cannot provide it here, because it is mixed with another feature issue (#37 Export grants and received grants) of mine which has to be accepted yet.

Support for Oracle 19c

Hi,

after upgrade to Oracle 19c, scheme2ddl freeze at execute sql (without errors, no exception).

Problem is caused by old jdbc driver.

I am not in java, but after some attempts i upgraded pom.xml and it working well (i added lib for our db charset - orai18n):

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.googlecode</groupId>
    <artifactId>scheme2ddl</artifactId>
    <version>2.4.2</version>
    <packaging>jar</packaging>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.4.2.RELEASE</version>
    </parent>

    <url>https://github.com/qwazer/scheme2ddl</url>

    <scm>
        <connection>scm:git:[email protected]:qwazer/scheme2ddl.git</connection>
        <url>scm:git:[email protected]:qwazer/scheme2ddl.git</url>
        <developerConnection>scm:git:[email protected]:qwazer/scheme2ddl.git</developerConnection>
        <tag>v2.4.2</tag>
    </scm>


    <repositories>
        <repository>
            <id>otn-maven-repo</id>
            <name>Maven repo with artifacts from Oracle Technology Network for private usage</name>
            <url>https://subversion.assembla.com/svn/otn-maven-repo/m2/</url>
        </repository>
    </repositories>

    <distributionManagement>
        <repository>
            <id>bintray-qwazer-maven</id>
            <name>qwazer-maven</name>
            <url>https://api.bintray.com/maven/${bintray.repo}/${bintray.package}/;publish=1</url>
        </repository>
    </distributionManagement>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <bintray.repo>qwazer/maven</bintray.repo>
        <bintray.package>scheme2ddl</bintray.package>
        <coveralls.repoToken>yourcoverallsprojectrepositorytoken</coveralls.repoToken>
    </properties>


    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <executable>true</executable>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                    <verbose>true</verbose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.4</version>
                <executions>
                    <execution>
                        <id>default-prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-report</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <!-- implementation is needed only for Maven 2 -->
                                <rule implementation="org.jacoco.maven.RuleConfiguration">
                                    <element>BUNDLE</element>
                                    <limits>
                                        <!-- implementation is needed only for Maven 2 -->
                                        <limit implementation="org.jacoco.report.check.Limit">
                                            <counter>COMPLEXITY</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.50</minimum>
                                        </limit>
                                    </limits>
                                </rule>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.eluder.coveralls</groupId>
                <artifactId>coveralls-maven-plugin</artifactId>
                <version>4.3.0</version>
                <configuration>
                    <repoToken>${coveralls.repoToken}</repoToken>
                </configuration>
            </plugin>
        </plugins>

         <extensions>
            <!-- Prevents this error, with JDK 13: -->
            <!-- NoSuchMethodError: 'java.lang.String javax.annotation.Resource.lookup()' -->
            <extension>
                <groupId>javax.annotation</groupId>
                <artifactId>javax.annotation-api</artifactId>
                <version>1.3.2</version>
            </extension>
            <extension>
                <groupId>javax.annotation</groupId>
                <artifactId>jsr250-api</artifactId>
                <version>1.0</version>
            </extension>
        </extensions>
    </build>

    <dependencies>
        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
            <version>1.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-batch</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>tomcat-jdbc</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-aop</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-logging</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.5</version>
        </dependency>
        <!--Unfortunately due the binary license there is no public repository with the Oracle Driver JAR.
        Will try to download it from otn-maven-repo

 Download latest jar from http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html.
 mvn install:install-file -Dfile=ojdbc5.jar -DgroupId=com.oracle -DartifactId=ojdbc5 -Dversion=11.2.0.3.0 -Dpackaging=jar -DgeneratePom=true
-->
        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc10</artifactId>
            <version>19.11.0.0</version>
        </dependency>

        <dependency>
            <groupId>com.oracle.ojdbc</groupId>
            <artifactId>orai18n</artifactId>
            <version>19.11.0.0</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.8</version>
            <scope>test</scope>
        </dependency>

    </dependencies>


    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>

I added/changed (from version 2.4.2):

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                    <verbose>true</verbose>
                </configuration>
            </plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.4</version>
         <extensions>
            <!-- Prevents this error, with JDK 13: -->
            <!-- NoSuchMethodError: 'java.lang.String javax.annotation.Resource.lookup()' -->
            <extension>
                <groupId>javax.annotation</groupId>
                <artifactId>javax.annotation-api</artifactId>
                <version>1.3.2</version>
            </extension>
            <extension>
                <groupId>javax.annotation</groupId>
                <artifactId>jsr250-api</artifactId>
                <version>1.0</version>
            </extension>
        </extensions>
        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
            <version>1.3.1</version>
        </dependency>
        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc10</artifactId>
            <version>19.11.0.0</version>
        </dependency>

        <dependency>
            <groupId>com.oracle.ojdbc</groupId>
            <artifactId>orai18n</artifactId>
            <version>19.11.0.0</version>
            <scope>runtime</scope>
        </dependency>

Getting ";" in output scripts

What steps will reproduce the problem?
1. Run java -jar scheme2ddl.jar -c scheme2ddl.config.xml
2. java version "1.6.0_11"
3. Solaris 10 9/10 (Update 9) 

What is the expected output? 
CREATE TABLE "ABC"."TEST"    (  "ID" NUMBER(12,0) NOT NULL ENABLE,  "NAME" 
VARCHAR2(128) NOT NULL ENABLE, ...

What do you see instead?

CREATE TABLE "ABC"."TEST" ;   ( "ID" NUMBER(12,0) NOT NULL ENABLE, ;    "NAME" 
VARCHAR2(128) NOT NULL ENABLE, ;...

What version of the product are you using? On what operating system?

2.2.2

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 16 May 2013 at 5:08

List skipped objects. (feature req.)

Could you add an option to also output a list of skipped objects?
Perhaps (optionally) with the reason they where skipped.

Every time I see a large number of skipped objects I find myself wondering if 
maybe there is something missing I want included... Which would be much easier 
to verify if there was a list available.

As an extension to to this, perhaps it would be a nice feature to output a 
"report" file (along with all the dll files) which includes lists of 
included/excluded objects.

Regards,
Mark.

Original issue reported on code.google.com by [email protected] on 10 May 2013 at 9:39

Reduce distributive size

After switching to Spring Boot
scheme2ddl-2.3.13.jar Size: 9.34 MB
scheme2ddl-2.4.0.jar Size: 16.74 MB

Bad version number in .class file for 2.3.1 and java 1.5

Exception in thread "main" 
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: 
Configuration problem: Failed to import bean definitions from URL location 
[classpath:applicationContext.xml]
Offending resource: class path resource [scheme2ddl.config.xml]; nested 
exception is org.springframework.beans.factory.BeanDefinitionStoreException: 
Unexpected
exception parsing XML document from class path resource 
[applicationContext.xml]; nested exception is 
org.springframework.beans.FatalBeanException: Invalid NamespaceHandler class 
[org.springframework.batch.core.configuration.xml.CoreNamespaceHandler] for 
namespace [http://www.springframework.org/schema/batch]: problem
with handler class file or dependent class; nested exception is 
java.lang.UnsupportedClassVersionError: Bad version number in .class file
        at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
        at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
        at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76)
        at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:245)
        at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:196)
        at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:181)
        at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140)
        at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:243)
        at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:127)
        at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:93)
        at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131)
        at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
        at com.googlecode.scheme2ddl.Main.loadApplicationContext(Main.java:310)
        at com.googlecode.scheme2ddl.Main.main(Main.java:54)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: 
Unexpected exception parsing XML document from class path resource 
[applicationContext.xml]; nested exception is 
org.springframework.beans.FatalBeanException: Invalid NamespaceHandler class 
[org.springframework.batch.core.configuration.xml.CoreNamespaceHandler] for 
namespace [http://www.springframework.org/schema/batch]: problem with handler 
class file or dependent class; nested exception is 
java.lang.UnsupportedClassVersionError: Bad version number in .class file
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
        at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:239)
        ... 21 more
Caused by: org.springframework.beans.FatalBeanException: Invalid 
NamespaceHandler class 
[org.springframework.batch.core.configuration.xml.CoreNamespaceHandler]
for namespace [http://www.s


Original issue reported on code.google.com by [email protected] on 13 Aug 2013 at 1:40

org.springframework.beans.factory.NoSuchBeanDefinitionException

new version with old config

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'step1': Cannot resolve reference to bean 'processor' while setting bean property 'itemProcessor'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'processor' defined in class path resource [applicationContext.xml]: Unsatisfied dependency expressed through bean property 'fileNameConstructor': : Error creating bean with name 'fileNameConstructor': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [java.lang.String] found for dependency [map with value type java.lang.String]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(mappedName=, shareable=true, description=, name=, type=class java.lang.Object, authenticationType=CONTAINER, lookup=)}; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fileNameConstructor': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [java.lang.String] found for dependency [map with value type java.lang.String]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(mappedName=, shareable=true, description=, name=, type=class java.lang.Object, authenticationType=CONTAINER, lookup=)}
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:334)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1417)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1158)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:615)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.context.support.FileSystemXmlApplicationContext.(FileSystemXmlApplicationContext.java:140)
at org.springframework.context.support.FileSystemXmlApplicationContext.(FileSystemXmlApplicationContext.java:84)
at com.googlecode.scheme2ddl.Main.loadApplicationContext(Main.java:341)
at com.googlecode.scheme2ddl.Main.main(Main.java:59)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'processor' defined in class path resource [applicationContext.xml]: Unsatisfied dependency expressed through bean property 'fileNameConstructor': : Error creating bean with name 'fileNameConstructor': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [java.lang.String] found for dependency [map with value type java.lang.String]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(mappedName=, shareable=true, description=, name=, type=class java.lang.Object, authenticationType=CONTAINER, lookup=)}; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fileNameConstructor': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [java.lang.String] found for dependency [map with value type java.lang.String]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(mappedName=, shareable=true, description=, name=, type=class java.lang.Object, authenticationType=CONTAINER, lookup=)}
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1239)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1131)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
... 16 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fileNameConstructor': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [java.lang.String] found for dependency [map with value type java.lang.String]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(mappedName=, shareable=true, description=, name=, type=class java.lang.Object, authenticationType=CONTAINER, lookup=)}
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:307)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1146)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:917)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:860)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:775)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1224)
... 24 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [java.lang.String] found for dependency [map with value type java.lang.String]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(mappedName=, shareable=true, description=, name=, type=class java.lang.Object, authenticationType=CONTAINER, lookup=)}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:993)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:850)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:775)
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:441)
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:419)
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:547)
at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:155)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:304)
... 35 more

filter-sequence-values option

replace actual values with START WITH 1

CREATE SEQUENCE  "t"."SQ_DOC"  MINVALUE 1000 MAXVALUE 1.00000000000000E+27 INCREMENT BY 1 START WITH 1061827 CACHE 20 NOORDER  NOCYCLE ;

Wrong -rsv option

Documentation says

   -rsv,                      replace actual sequence values with 1 
  --replace-sequence-values,

but the correct options are -fsv and --filter-sequence-values

Main.java line 308

        }   else if ((arg.equals("-fsv") || arg.equals("--filter-sequence-values"))) {
            replaceSequenceValues = true;

add skip logic

add CLI param for change skip logic

--stop-on-warning

by default
if error in get_ddl, then continue processing with warning messages

but 
--stop-on-warning
change this behaviour


Original issue reported on code.google.com by [email protected] on 10 May 2013 at 8:04

Refactor process data tables feature implementation

Patches from xorader (svn revision 178, svn revision 180) brings new feature: 
process data tables.

This feature implemented in complex way. I think, need to refactor.
  # add new TableDataProcessor (DataTableProcessor)?
  # add new optional custom config `tabledata2sql.xml` move data tables options to this config

May be release new tool tabledata2sql (?) based on scheme2ddl and include to 
oracle-ddl2svn suit?


Scheduled for release 3.0

Original issue reported on code.google.com by [email protected] on 25 Jun 2013 at 8:00

Use of Programmatic Interface of DBMS_METADATA

Need to enhance the feature of tool to use Programmatic Interface of 
DBMS_METADATA package.

e.g. REMAP_SCHEMA, it will help us to generate the script with different schema 
prefix or no schema prefix.

http://docs.oracle.com/cd/B28359_01/server.111/b28319/metadata_api.htm#i1010762
DBMS_METADATA.SET_REMAP_PARAM(th,'REMAP_SCHEMA','HR','SCOTT');
DBMS_METADATA.SET_REMAP_PARAM(th,'REMAP_SCHEMA','HR','');

We can map the schema names or tablespace names , use remap parameters and the 
SET_REMAP_PARAM procedure.

Original issue reported on code.google.com by [email protected] on 8 Jun 2013 at 2:57

Error exporting dblink object

Trying to export scheme got error on dblink object:

Encountered an error executing the step
org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [select db_link as object_name, 'PUBLIC DATABASE LINK' as object_type from DBA_DB_LINKS where owner='PUBLIC']; nested exception is java.sql.SQLException: ORA-00942: table or view does not exist

        at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:220)
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:407)
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:458)
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:466)
        at com.googlecode.scheme2ddl.dao.UserObjectDaoImpl.findPublicDbLinks(UserObjectDaoImpl.java:37)
        at com.googlecode.scheme2ddl.UserObjectReader.fillList(UserObjectReader.java:41)
        at com.googlecode.scheme2ddl.UserObjectReader.read(UserObjectReader.java:28)
        at com.googlecode.scheme2ddl.UserObjectReader.read(UserObjectReader.java:18)
        at org.springframework.batch.core.step.item.SimpleChunkProvider.doRead(SimpleChunkProvider.java:90)
        at org.springframework.batch.core.step.item.SimpleChunkProvider.read(SimpleChunkProvider.java:150)
        at org.springframework.batch.core.step.item.SimpleChunkProvider$1.doInIteration(SimpleChunkProvider.java:110)
        at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:367)
        at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:214)
        at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:143)
        at org.springframework.batch.core.step.item.SimpleChunkProvider.provide(SimpleChunkProvider.java:105)
        at org.springframework.batch.core.step.item.ChunkOrientedTasklet.execute(ChunkOrientedTasklet.java:68)
        at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:386)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
        at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:264)
        at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:76)
        at org.springframework.batch.repeat.support.TaskExecutorRepeatTemplate$ExecutingRunnable.run(TaskExecutorRepeatTemplate.java:258)
        at org.springframework.core.task.SimpleAsyncTaskExecutor$ConcurrencyThrottlingRunnable.run(SimpleAsyncTaskExecutor.java:192)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: ORA-00942: table or view does not exist

        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
        at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
        at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
        at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193)
        at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:866)
        at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1167)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1289)
        at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1491)
        at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:406)
        at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:443)
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:396)
        ... 21 more

How to workaround or handle that?

Avoid EDITIONABLE keyword on package definition extraction

Hi all,
I found a little issue that annoys me.
When I extract the definition of packages from the db, I always get the keyword EDITIONABLE:
CREATE OR REPLACE EDITIONABLE PACKAGE xx.yy IS ...

Since the code has been written long time ago, before the keyword EDITIONABLE was introduced, this word it's never present in the package definitions and I was expecting the extracted code to be the same.

Is there a way to avoid this behaviour in order to match exactly the db's code? Maybe a configuration somewhere?
The default value when nothing is specified is EDITIONABLE, so it shouldn't change anything.

Regards

Mauro

Last modified timestamp


Please, add configuration parameter to insert last modified timestamp in 
generated ddl.

for example:
-- TIMESTAMP: 01.04.2014 23:15:48
CREATE OR REPLACE PACKAGE "USER"."TEST" AS
...

it's usefull then you do initial schema import.

Original issue reported on code.google.com by [email protected] on 8 Mar 2014 at 7:24

Please add EOL before EOF

Output files currently lack an EOL character at the end of the last line. Aside 
from the visual annoyance when casually catting a file, there are also a lot of 
programs/processes that fail to correctly handle files without EOL at the end 
of the last line.

What is the expected output? 

me@xps:/tmp/output/sandbox/tables$ cat dummy.sql 
CREATE TABLE "SANDBOX"."DUMMY" 
   (    "DUMMY" VARCHAR2(1)
   ) ;
me@xps:/tmp/output/sandbox/tables$ 

What do you see instead?

me@xps:/tmp/output/sandbox/tables$ cat dummy.sql 
CREATE TABLE "SANDBOX"."DUMMY" 
   (    "DUMMY" VARCHAR2(1)
   ) ;me@xps:/tmp/output/sandbox/tables$ 


What version of the product are you using? On what operating system?

scheme2ddl version 2.2.1
java version "1.7.0_17"
Linux

Regards,
Mark.

Original issue reported on code.google.com by [email protected] on 10 May 2013 at 7:34

Unify command line parameter quoting

Parameter -f, --filter does not allow single quotes and parameter -tf, --type-filter needs single quotes to work.

Example to get only the ddl for table filter: -f tickets -tf 'table'

-tc option. Error creating bean with name 'scopedTarget.userObjectDao': Scope 'step' is not active for the current thread

java -jar scheme2ddl-2.3.jar -tc 1/1@1:1:1
Exception in thread "main" 
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'scopedTarget.userObjectDao': Scope 'step' is not active for the 
current thread; consider defining a scoped proxy for this bean if you intend to 
refer to it from a singleton; nested exception is 
java.lang.IllegalStateException: No context holder available for step scope
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:343)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:34)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:184)
    at $Proxy10.isConnectionAvailable(Unknown Source)
    at com.googlecode.scheme2ddl.Main.testDBConnection(Main.java:69)
    at com.googlecode.scheme2ddl.Main.main(Main.java:60)
Caused by: java.lang.IllegalStateException: No context holder available for 
step scope
    at org.springframework.batch.core.scope.StepScope.getContext(StepScope.java:208)
    at org.springframework.batch.core.scope.StepScope.get(StepScope.java:147)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:329)
    ... 6 more


Original issue reported on code.google.com by [email protected] on 4 Jul 2013 at 5:19

Project still active ? Accepting PR ?

I was looking for a way to dump an oracle schema (to store it in Git) and found this project which seems to do what I'm looking for. It seems there are no commits and new releases since 2018 so I was wondering if the project was still active or not. Or if it was superseded by another project or technology to manage Oracle DB schema ? I'm new in the Oracle world so learning new things every day...
And do you accept pull requests ? I'd like to change a thing or two, so wondering if I do that in an internal repository, or if I open a PR.

File extension like "TOAD" or "PL/SQL Developer"

Add ability to configure file extensions by object types.

Fill 3 predefined map of extensions

1) constant sql for all types
2) like TOAD
 .prc for Procedures
 .fnc for Functions
 .vw for Views
 .pkb for Package Bodies
 .pks for Package Specs
The rest gets .sql
3) Like PL/SQL developer
...

Tnanks to arnoreinhofer82 from resheto for idea and sample patch.

Original issue reported on code.google.com by [email protected] on 21 Apr 2013 at 6:57

Patch with three new features

I prepared patch for three new features:

1)
Add supporting multi-schemas exporting with "-s" option (or "processSchemas" 
option in xml-config).
For example:
$ java -jar scheme2ddl-2.0.2-SNAPSHOT.jar -url "sys as 
sysdba/[email protected]/SID" -o export-dir --config 
scheme2ddl.config.xml -s "SCOTT,TEST_SCHEMA"

Execute as SYSDBA user...
[1/2] Start getting of user object list for processing for 'SCOTT' schema.
[2/2] Start getting of user object list for processing for 'TEST_SCHEMA' schema.
Found 118 items for processing
Saved [SCOTT] TABLE BONUS to file 
/home/xor/tmp/oracle-ddl2svn-tests/export-dir/SCOTT/TABLES/BONUS.sql
Saved [SCOTT] TABLE SALGRADE to file 
/home/xor/tmp/oracle-ddl2svn-tests/export-dir/SCOTT/TABLES/SALGRADE.sql
Saved [SCOTT] TABLE EMP to file 
/home/xor/tmp/oracle-ddl2svn-tests/export-dir/SCOTT/TABLES/EMP.sql
...
Written 55 ddls with user objects from total 118
Skip processing 63 user objects from total 118
scheme2ddl completed in 20 seconds

2)
Add "isFilenameToLowerCase" option to xml-config with default "true" value.
In my case i don't need the changing letters case in filenames, and now i can 
off it by changing the "isFilenameToLowerCase" option.

3)
Add "isMorePrettyFormat" option to xml-config with default "false" value.
This option enables the more pretty DDL formating (in my opinion).

---
I also made ​​a small cosmetic changes.
Backward compatibility observed.
I carefully tested the patch (on linux OS). Everything works.




Original issue reported on code.google.com by [email protected] on 14 Dec 2012 at 7:59

Attachments:

Exported file contains CRLF as line endings

Hi all,
I run scheme2ddl on a machine with Unix and I noticed that the exported files contains the Windows line endings (CRLF).
Can please someone tell if I'm doing something wrong or if there is a option to avoid this behaviour?

I would prefer not to refactor all the files after the export, if it's possible.

Have a nice day

--
Mauro

Advanced queue export error

ORA-06512: at "SYS.DBMS_METADATA", line 4018
ORA-06512: at "SYS.DBMS_METADATA", line 5843
ORA-06512: at line 1
; nested exception is java.sql.SQLException: ORA-31600: invalid input value QUEUE for parameter OBJECT_TYPE in function GET_DDL
ORA-06512: at "SYS.DBMS_METADATA", line 4018
ORA-06512: at "SYS.DBMS_METADATA", line 5843
ORA-06512: at line 1

Patch with filename case

I created a patch which refines the 'isFilenameToLowerCase' feature from 
[email protected]

I added a new xml property 'filenameCase' which substitutes the 
'isFilenameToLowerCase' property.
This property holds a string which can be set to 'lower' (that's the default, 
like it was before) or 'upper'.
Every file and folder will be upper or lower case then.

I excluded the .sql file extension from this mechanism. The extension is alway 
lowercase.
====
I tested the patch on Windows 7. A missing property is no problem, it defaults 
to 'lower'.
Please test this feature and put it to your project if you find it useful.

Original issue reported on code.google.com by [email protected] on 23 Jan 2013 at 9:40

Attachments:

Issue with depedent ddl statement , getting overlapped after tremination character

What steps will reproduce the problem?
1.java -jar scheme2ddl.jar -c scheme2ddl.config.xml
2.noFormat = false, statementOnNewLine = false , morePrettyFormat=false
3.

What is the expected output? 
............
;
GRANT SELECT 

...............
/
GRANT EXECUTE


....ENABLE;
CREATE UNIQUE INDEX ........


What do you see instead?


............
;GRANT SELECT 


...............
/GRANT EXECUTE

....ENABLE;CREATE UNIQUE INDEX ........



What version of the product are you using? On what operating system?
2.2.3

Please provide any additional information below.

In UserObjectDaoImpl.java
Changing the statement from return rs.getString(1).trim() to return 
rs.getString(1) can solve the issue.

In DDLFormatter.java
Perform 
ddl = ddl.replaceAll("/GRANT", "/" + newline + "GRANT") before return ddl

Original issue reported on code.google.com by [email protected] on 17 May 2013 at 3:51

Bad version number in .class file

Using version 2.2 whether I use a config file like this:

java -jar scheme2ddl.jar --config 
"C:\_System\DropBox\Programs\DDL2SVN\scheme2ddl.config.xml"

or directly like this:

java -jar scheme2ddl.jar -url lriffel/xxx@cyborg2:1521:LABDEV_2 -o 
C:\temp\oracle-ddl2svn\

I get the same error stack below.  This is on Windows 7 using a batch file to 
call it.

C:\_System\DropBox\Programs\DDL2SVN>CreateDDL.bat
=========  start of scheme2ddl Tue 05/07/2013  9:27:55.02 ==============
Will try to process schema  [LRIFFEL]
Start getting of user object list in schema LRIFFEL for processing
Found 3991 items for processing in schema LRIFFEL
Exception in thread "SimpleAsyncTaskExecutor-4" 
java.lang.UnsupportedClassVersionError: Bad version number in .class file
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
        at com.googlecode.scheme2ddl.UserObjectWriter.writeUserObject(UserObjectWriter.java:32)
        at com.googlecode.scheme2ddl.UserObjectWriter.write(UserObjectWriter.java:26)
        at org.springframework.batch.core.step.item.SimpleChunkProcessor.writeItems(SimpleChunkProcessor.java:174)
        at org.springframework.batch.core.step.item.SimpleChunkProcessor.doWrite(SimpleChunkProcessor.java:150)
        at org.springframework.batch.core.step.item.SimpleChunkProcessor.write(SimpleChunkProcessor.java:272)
        at org.springframework.batch.core.step.item.SimpleChunkProcessor.process(SimpleChunkProcessor.java:197)
        at org.springframework.batch.core.step.item.ChunkOrientedTasklet.execute(ChunkOrientedTasklet.java:74)
        at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:386)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
        at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:264)
        at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:76)
        at org.springframework.batch.repeat.support.TaskExecutorRepeatTemplate$ExecutingRunnable.run(TaskExecutorRepeatTemplate.java:258)
        at org.springframework.core.task.SimpleAsyncTaskExecutor$ConcurrencyThrottlingRunnable.run(SimpleAsyncTaskExecutor.java:192)
        at java.lang.Thread.run(Unknown Source)
Exception in thread "SimpleAsyncTaskExecutor-3" 
java.lang.UnsupportedClassVersionError: Bad version number in .class file
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
        at com.googlecode.scheme2ddl.UserObjectWriter.writeUserObject(UserObjectWriter.java:32)
        at com.googlecode.scheme2ddl.UserObjectWriter.write(UserObjectWriter.java:26)
        at org.springframework.batch.core.step.item.SimpleChunkProcessor.writeItems(SimpleChunkProcessor.java:174)
        at org.springframework.batch.core.step.item.SimpleChunkProcessor.doWrite(SimpleChunkProcessor.java:150)
        at org.springframework.batch.core.step.item.SimpleChunkProcessor.write(SimpleChunkProcessor.java:272)
        at org.springframework.batch.core.step.item.SimpleChunkProcessor.process(SimpleChunkProcessor.java:197)
        at org.springframework.batch.core.step.item.ChunkOrientedTasklet.execute(ChunkOrientedTasklet.java:74)
        at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:386)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
        at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:264)
        at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:76)
        at org.springframework.batch.repeat.support.TaskExecutorRepeatTemplate$ExecutingRunnable.run(TaskExecutorRepeatTemplate.java:258)
        at org.springframework.core.task.SimpleAsyncTaskExecutor$ConcurrencyThrottlingRunnable.run(SimpleAsyncTaskExecutor.java:192)
        at java.lang.Thread.run(Unknown Source)
Exception in thread "SimpleAsyncTaskExecutor-1" Exception in thread 
"SimpleAsyncTaskExecutor-2" java.lang.UnsupportedClassVersionError: Bad version 
number in .class file
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
        at com.googlecode.scheme2ddl.UserObjectWriter.writeUserObject(UserObjectWriter.java:32)
        at com.googlecode.scheme2ddl.UserObjectWriter.write(UserObjectWriter.java:26)
        at org.springframework.batch.core.step.item.SimpleChunkProcessor.writeItems(SimpleChunkProcessor.java:174)
        at org.springframework.batch.core.step.item.SimpleChunkProcessor.doWrite(SimpleChunkProcessor.java:150)
        at org.springframework.batch.core.step.item.SimpleChunkProcessor.write(SimpleChunkProcessor.java:272)
        at org.springframework.batch.core.step.item.SimpleChunkProcessor.process(SimpleChunkProcessor.java:197)
        at org.springframework.batch.core.step.item.ChunkOrientedTasklet.execute(ChunkOrientedTasklet.java:74)
        at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:386)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
        at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:264)
        at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:76)
        at org.springframework.batch.repeat.support.TaskExecutorRepeatTemplate$ExecutingRunnable.run(TaskExecutorRepeatTemplate.java:258)
        at org.springframework.core.task.SimpleAsyncTaskExecutor$ConcurrencyThrottlingRunnable.run(SimpleAsyncTaskExecutor.java:192)
        at java.lang.Thread.run(Unknown Source)
java.lang.UnsupportedClassVersionError: Bad version number in .class file
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
        at com.googlecode.scheme2ddl.UserObjectWriter.writeUserObject(UserObjectWriter.java:32)
        at com.googlecode.scheme2ddl.UserObjectWriter.write(UserObjectWriter.java:26)
        at org.springframework.batch.core.step.item.SimpleChunkProcessor.writeItems(SimpleChunkProcessor.java:174)
        at org.springframework.batch.core.step.item.SimpleChunkProcessor.doWrite(SimpleChunkProcessor.java:150)
        at org.springframework.batch.core.step.item.SimpleChunkProcessor.write(SimpleChunkProcessor.java:272)
        at org.springframework.batch.core.step.item.SimpleChunkProcessor.process(SimpleChunkProcessor.java:197)
        at org.springframework.batch.core.step.item.ChunkOrientedTasklet.execute(ChunkOrientedTasklet.java:74)
        at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:386)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
        at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:264)
        at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:76)
        at org.springframework.batch.repeat.support.TaskExecutorRepeatTemplate$ExecutingRunnable.run(TaskExecutorRepeatTemplate.java:258)
        at org.springframework.core.task.SimpleAsyncTaskExecutor$ConcurrencyThrottlingRunnable.run(SimpleAsyncTaskExecutor.java:192)
        at java.lang.Thread.run(Unknown Source)
Exception in thread "SimpleAsyncTaskExecutor-5" 
java.lang.UnsupportedClassVersionError: Bad version number in .class file
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
        at com.googlecode.scheme2ddl.UserObjectWriter.writeUserObject(UserObjectWriter.java:32)
        at com.googlecode.scheme2ddl.UserObjectWriter.write(UserObjectWriter.java:26)
        at org.springframework.batch.core.step.item.SimpleChunkProcessor.writeItems(SimpleChunkProcessor.java:174)
        at org.springframework.batch.core.step.item.SimpleChunkProcessor.doWrite(SimpleChunkProcessor.java:150)
        at org.springframework.batch.core.step.item.SimpleChunkProcessor.write(SimpleChunkProcessor.java:272)
        at org.springframework.batch.core.step.item.SimpleChunkProcessor.process(SimpleChunkProcessor.java:197)
        at org.springframework.batch.core.step.item.ChunkOrientedTasklet.execute(ChunkOrientedTasklet.java:74)
        at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:386)
Encountered an error executing the step
java.lang.NullPointerException
        at org.springframework.batch.repeat.support.RepeatTemplate.canContinue(RepeatTemplate.java:391)
        at org.springframework.batch.repeat.support.TaskExecutorRepeatTemplate.waitForResults(TaskExecutorRepeatTemplate.java:183)
        at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:231)
        at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:143)
        at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:250)
        at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:195)
        at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:135)
        at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:61)
        at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:60)
        at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:144)
        at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:124)
        at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:135)
        at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:293)
        at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:120)
        at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
        at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:114)
        at com.googlecode.scheme2ddl.UserObjectJobRunner.start(UserObjectJobRunner.java:42)
        at com.googlecode.scheme2ddl.Main.main(Main.java:60)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
        at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:264)
        at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:76)
        at org.springframework.batch.repeat.support.TaskExecutorRepeatTemplate$ExecutingRunnable.run(TaskExecutorRepeatTemplate.java:258)
        at org.springframework.core.task.SimpleAsyncTaskExecutor$ConcurrencyThrottlingRunnable.run(SimpleAsyncTaskExecutor.java:192)
        at java.lang.Thread.run(Unknown Source)
Written 0 ddls with user objects from total 4 in schema LRIFFEL
Skip processing 0 user objects from total 4 in schema LRIFFEL
scheme2ddl of schema LRIFFEL failed in 4 seconds
Job Terminated in error: Job {schemaName=LRIFFEL, launchedByDBA=false} 
unsuccessful
java.lang.Exception: Job {schemaName=LRIFFEL, launchedByDBA=false} unsuccessful
        at com.googlecode.scheme2ddl.UserObjectJobRunner.start(UserObjectJobRunner.java:46)
        at com.googlecode.scheme2ddl.Main.main(Main.java:60)
Exception in thread "main" java.lang.Exception: Job {schemaName=LRIFFEL, 
launchedByDBA=false} unsuccessful
        at com.googlecode.scheme2ddl.UserObjectJobRunner.start(UserObjectJobRunner.java:46)
        at com.googlecode.scheme2ddl.Main.main(Main.java:60)
=========  end of scheme2ddl Tue 05/07/2013  9:28:01.71 ==============
Could Not Find C:\_System\DropBox\Programs\DDL2SVN\connection.tmp

Original issue reported on code.google.com by [email protected] on 7 May 2013 at 1:33

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.