oracle schema with multiple tables

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

oracle schema with multiple tables

Zdeněk Vráblík-3
Hi all,

I have problem with loading metadata for all database schema I am
getting exception AmbiguousTableNameException

I have Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

There are some tables from schema, but some (OL$) which seems like
oracle tables.

The recycle bin is empty.

I haven't found any other database object with same name.

I have commented the exception out and seems the dbUnit works fine. At
least import/export + small unit test.

Stack:
OrderedTableNameMap.add(String, Object) line: 200
DatabaseDataSet.initialize() line: 227
DatabaseDataSet.getTableMetaData(String) line: 275
AbstractOperation.getOperationMetaData(IDatabaseConnection,
ITableMetaData) line: 80
RefreshOperation.execute(IDatabaseConnection, IDataSet) line: 98
dbUnitTest.fullDatabaseImport(File) line: 91
dbUnitTest.testImport() line: 68
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not
available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 597
dbUnitTest(TestCase).runTest() line: 164



The tables which are reported as duplicated are :
table name twice! table name: COLORSCHEME
table name twice! table name: COLORSCHEME_DETAIL
table name twice! table name: COUNTRIES
table name twice! table name: GRID_METADATA
table name twice! table name: COUNTRIES
table name twice! table name: CUSTOMERS
table name twice! table name: PROMOTIONS
table name twice! table name: AQ$_SCHEDULES
table name twice! table name: OL$
table name twice! table name: OL$HINTS
table name twice! table name: OL$NODES
table name twice! table name: COLORSCHEME
table name twice! table name: COLORSCHEME_DETAIL
table name twice! table name: COUNTRIES
table name twice! table name: GRID_METADATA
table name twice! table name: COUNTRIES
table name twice! table name: CUSTOMERS
table name twice! table name: PROMOTIONS
table name twice! table name: AQ$_SCHEDULES
table name twice! table name: OL$
table name twice! table name: OL$HINTS
table name twice! table name: OL$NODES


How could I remove the duplicate database objects?

Thanks.

Regards,
Zdenek

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: oracle schema with multiple tables

Matthias Gommeringer
Hi Zdenek,

you could try to use the constructor

public DatabaseDataSet(IDatabaseConnection connection, boolean caseSensitiveTableNames, ITableFilterSimple tableFilter)

which takes a http://www.dbunit.org/xref/org/dbunit/dataset/filter/ITableFilterSimple.html argument. You can write a ITableFilterSimple implementation that filters all duplicate table names.

Regards,
matthias

> -----Ursprüngliche Nachricht-----
> Von: "Zdenìk Vráblík" <[hidden email]>
> Gesendet: 07.06.09 16:32:14
> An: [hidden email]
> Betreff: [dbunit-user] oracle schema with multiple tables


> Hi all,
>
> I have problem with loading metadata for all database schema I am
> getting exception AmbiguousTableNameException
>
> I have Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
> With the Partitioning, OLAP and Data Mining options
>
> There are some tables from schema, but some (OL$) which seems like
> oracle tables.
>
> The recycle bin is empty.
>
> I haven't found any other database object with same name.
>
> I have commented the exception out and seems the dbUnit works fine. At
> least import/export + small unit test.
>
> Stack:
> OrderedTableNameMap.add(String, Object) line: 200
> DatabaseDataSet.initialize() line: 227
> DatabaseDataSet.getTableMetaData(String) line: 275
> AbstractOperation.getOperationMetaData(IDatabaseConnection,
> ITableMetaData) line: 80
> RefreshOperation.execute(IDatabaseConnection, IDataSet) line: 98
> dbUnitTest.fullDatabaseImport(File) line: 91
> dbUnitTest.testImport() line: 68
> NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not
> available [native method]
> NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
> DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
> Method.invoke(Object, Object...) line: 597
> dbUnitTest(TestCase).runTest() line: 164
>
>
>
> The tables which are reported as duplicated are :
> table name twice! table name: COLORSCHEME
> table name twice! table name: COLORSCHEME_DETAIL
> table name twice! table name: COUNTRIES
> table name twice! table name: GRID_METADATA
> table name twice! table name: COUNTRIES
> table name twice! table name: CUSTOMERS
> table name twice! table name: PROMOTIONS
> table name twice! table name: AQ$_SCHEDULES
> table name twice! table name: OL$
> table name twice! table name: OL$HINTS
> table name twice! table name: OL$NODES
> table name twice! table name: COLORSCHEME
> table name twice! table name: COLORSCHEME_DETAIL
> table name twice! table name: COUNTRIES
> table name twice! table name: GRID_METADATA
> table name twice! table name: COUNTRIES
> table name twice! table name: CUSTOMERS
> table name twice! table name: PROMOTIONS
> table name twice! table name: AQ$_SCHEDULES
> table name twice! table name: OL$
> table name twice! table name: OL$HINTS
> table name twice! table name: OL$NODES
>
>
> How could I remove the duplicate database objects?
>
> Thanks.
>
> Regards,
> Zdenek
>
> ------------------------------------------------------------------------------
> OpenSolaris 2009.06 is a cutting edge operating system for enterprises
> looking to deploy the next generation of Solaris that includes the latest
> innovations from Sun and the OpenSource community. Download a copy and
> enjoy capabilities such as Networking, Storage and Virtualization.
> Go to: http://p.sf.net/sfu/opensolaris-get
> _______________________________________________
> dbunit-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/dbunit-user
>


____________________________________________________________
Text: GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: oracle schema with multiple tables

Gopal Patwa
In reply to this post by Zdeněk Vráblík-3
I had similar issue and I found this

http://www.dbunit.org/faq.html#AmbiguousTableNameException

Why am I getting an "AmbiguousTableNameException"?

    This error occurs when no schema is specified and that DbUnit detect that it is getting columns information from multiple tables having the same name and located in different schemas.

    You can solve this problem in three different ways:

       1. Provide the schema name when creating the database connection. Note that for Oracle you must specify the schema name in uppercase.
       2. Ensure that the connection is restricted to access only one schema.
       3. Enable the qualified table names feature.


Zdeněk Vráblík-3 wrote
Hi all,

I have problem with loading metadata for all database schema I am
getting exception AmbiguousTableNameException

I have Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

There are some tables from schema, but some (OL$) which seems like
oracle tables.

The recycle bin is empty.

I haven't found any other database object with same name.

I have commented the exception out and seems the dbUnit works fine. At
least import/export + small unit test.

Stack:
OrderedTableNameMap.add(String, Object) line: 200
DatabaseDataSet.initialize() line: 227
DatabaseDataSet.getTableMetaData(String) line: 275
AbstractOperation.getOperationMetaData(IDatabaseConnection,
ITableMetaData) line: 80
RefreshOperation.execute(IDatabaseConnection, IDataSet) line: 98
dbUnitTest.fullDatabaseImport(File) line: 91
dbUnitTest.testImport() line: 68
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not
available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 597
dbUnitTest(TestCase).runTest() line: 164



The tables which are reported as duplicated are :
table name twice! table name: COLORSCHEME
table name twice! table name: COLORSCHEME_DETAIL
table name twice! table name: COUNTRIES
table name twice! table name: GRID_METADATA
table name twice! table name: COUNTRIES
table name twice! table name: CUSTOMERS
table name twice! table name: PROMOTIONS
table name twice! table name: AQ$_SCHEDULES
table name twice! table name: OL$
table name twice! table name: OL$HINTS
table name twice! table name: OL$NODES
table name twice! table name: COLORSCHEME
table name twice! table name: COLORSCHEME_DETAIL
table name twice! table name: COUNTRIES
table name twice! table name: GRID_METADATA
table name twice! table name: COUNTRIES
table name twice! table name: CUSTOMERS
table name twice! table name: PROMOTIONS
table name twice! table name: AQ$_SCHEDULES
table name twice! table name: OL$
table name twice! table name: OL$HINTS
table name twice! table name: OL$NODES


How could I remove the duplicate database objects?

Thanks.

Regards,
Zdenek

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
dbunit-user mailing list
dbunit-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbunit-user