I'm using the java.sql.DatabaseMetaData.getTables() method to get a list of all the tables owned by a specific user. On SQL Server and Oracle 9 it works fine, but on Oracle 10, as well as the table names I am expecting, I also get about 94 tables that I am not expecting. Examples of the names are : BIN$1gnqElALRcCTTM0Bon/Gpw==$0 BIN$2Hq1Y1sDQMGGRQM13s4pJQ==$0 BIN$3FSZSlxgQuiClzYz54Y4qQ==$0
I've checked all the users on the database for tables with these names, but can't find anything. Does anyone know where they might be coming from (and more importantly how I can avoid listing them) ? I'll admit now that I'm a Java programmer rather than a db expert, so please feel free to make what may seem obvious suggestions.
The exact code I'm using isThe Connection object is retrieved from a pool. I don't think the problem is anything to do with that (as I do get the table names I'm expecting), but let me know if you think it's relevant and I'll try to post it. I've checked the value of the owner variable and it is correct.
Thanks for that Jan. Is there any way, other than the name starting with BIN$, to distinguish a table from the recyle bin from a normal table. I'm just looking at the table objects in the ResultSet, but it might save me some time if you know of anything.
Unless anyone suggests a better solution I'm going to get a list of all the table names from the recycle bin (SELECT OBJECT_NAME FROM RECYCLEBIN) and then when I fetch the table list I'll ignore any that are in the that list.