Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Unexpected tables in list

 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 2660
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
They are your recycle bin.

Try running this statement from sql*plus:Regards, Jan
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic