Menu

Oracle - does not get columns

Help
pabloj
2005-01-24
2012-11-28
  • pabloj

    pabloj - 2005-01-24

    Hi, I'm testing dbmonster 1.0.2 against Oracle 9.2.0.4 with JDBC driver ojdbc14.jar.
    Running: dbmonster --grab -o c:/schema.xml leads to an empty schema (it does not get any table)

    Running: dbmonster --grab -t (list of tables here) -o c:/schema.xml leads to an xml file containing only table names, and no column info!!!

    Can you please help me?
    Thanks in advance.

     
    • Piotr Maj

      Piotr Maj - 2005-01-24

      Did you correctly set dbmonster.jdbc.schema property in the configuration file?

      Second idea is to use table names with the schema they live in when supplying  -t argument, ie. --grab -t scott.employee.

      Hope this will help. If not it might be something specific to oracle jdbc driver, but as I do not use oracle it's hart to tell for me what might it be?

      --
      Piotr Maj

       
    • pabloj

      pabloj - 2005-01-24

      Yes, the dbmonster.jdbc.schema property is set up, I've supplied the table list without schema/owner and it grabbed them to a flat list like:

      <dbmonster-schema>
        <name>Change me!</name>
        <table name="schema.TABLE" rows="1000">
        </table>

      So, apart from the fact that the <name> tag is not populated it seems to me that it finds the tables, but just does not get the metadata associated to them.
      I tested your suggestion and specifying -t schema.table leads to a table not found error (maybe it already prepends the schema):

      12:42:41,392 FATAL SchemaGrabber - No such table <SCHEMA.TABLE>.
      java.sql.SQLException: No such table <SCHEMA.TABLE>.
              at pl.kernelpanic.dbmonster.SchemaGrabber.addTable(SchemaGrabber.java:39
      9)

      Please help! Thanks

       
    • Piotr Maj

      Piotr Maj - 2005-01-24

      I'll try to reproduce this error after I download Oracle 9i and set up a simple instance (which may take some hours...). Then I'll try to find out what's happening. Have you tried tables grabbing with an old Oracle 8i?

       
    • pabloj

      pabloj - 2005-01-24

      With Oracle it's good to use the supplied SCOTT schema to develop and test, it's built in and available to others (much like Firebird's employee.fdb).

       
    • Piotr Maj

      Piotr Maj - 2005-01-28

      hi Pablo,

      Finally I've managed to set up Oracle 10g with a sample instance.

      My test.properties file looks like:

      .:.majek@hp:ora.:.$ cat test.properties
      dbmonster.jdbc.driver=oracle.jdbc.driver.OracleDriver
      dbmonster.jdbc.url=jdbc:oracle:thin:scott/tiger@127.0.0.1:1521:HPORA
      dbmonster.jdbc.username=scott
      dbmonster.jdbc.password=tiger
      dbmonster.jdbc.schema=

      The command I've used:

      .:.majek@hp:ora.:.$ dbmonster -c test.properties --grab -t emp

      The result:

      2005-01-28 10:01:06,756 INFO  SchemaGrabber - Grabbing schema from database. 1 tables to grab.
      2005-01-28 10:01:07,179 INFO  SchemaGrabber - Grabbing table EMP. 100% done.
      2005-01-28 10:01:07,181 INFO  SchemaGrabber - Grabbing schema from database complete.
      <?xml version="1.0"?>
      <!DOCTYPE dbmonster-schema PUBLIC "-//kernelpanic.pl//DBMonster Database Schema DTD 1.1//EN" "http://dbmonster.kernelpanic.pl/dtd/dbmonster-schema-1.1.dtd">
      <dbmonster-schema>
        <name>Change me!</name>
        <table name="EMP" rows="1000">
          <key databaseDefault="false">
            <generator type="pl.kernelpanic.dbmonster.generator.MaxKeyGenerator">
              <property name="columnName" value="EMPNO"/>
            </generator>
          </key>
          <column name="ENAME" databaseDefault="false">
            <generator type="pl.kernelpanic.dbmonster.generator.StringGenerator">
              <property name="allowSpaces" value="true"/>
              <property name="excludeChars" value=""/>
              <property name="maxLength" value="10"/>
              <property name="minLength" value="0"/>
              <property name="nulls" value="10"/>
            </generator>
          </column>

      [... followed by all remaining collumns definitions...]

      So it looks like dbmonster works pretty well with Oracle 10g using ojdbc14.jar as JDBC driver.

       
      • pabloj

        pabloj - 2005-01-31

        My bad, it was a case problem, I specified the schema in the .properties file and I wrote it lowercase. This caused the problem.
        I redid it with the schema specified in uppercase and it worked.
        Sorry

         

Log in to post a comment.