Rick Hillegas <richard.hille...@...> writes: > > 1) Using two schemas in one database, how does Derby store the filesystem? > > Currently, I've got a Data directory, containing a couple files, a log > > folder, and a seg0 folder with many data files. If the two schemas are > > stored separately (or in separate subfolders), adding database updates to > > my program should be trivial. If the data from the two schemas is merged > > into the same data files, updating the non-user data would be more tricky. > > > You'll see one file per table in the seg0 folder. The schemas will not > share data files.
So I've successfully got two schemas in my database: data and user_data. Both have 19 tables, and each corresponding table has the same columns, with the exception that the tables in user_data have a column 'delete_row' at the end. All 38 tables have a single index. Aside from the two schemas I've created, the following exist in my database, according to RazorSQL <http://www.razorsql.com/>: Schema SQLJ contains 3 procedures: install_jar, remove_jar, and replace_jar. Schema SYS contains 19 system tables and 42 indices. Schema SYSCS_UTIL contains 26 procedures. Schema SYSIBM contains 1 system table (sysdummy1) and 22 procedures. All told, that's 58 tables (20 are system tables), 51 procedures, and 80 indices. My seg0 folder contains 139 data files, which neither matches the total number of tables in my database, nor the total number of items (189). So, I'm not exactly sure which files represent what, and there's no noticeable naming scheme to the DAT files I can go off of. Most importantly, I don't want to overwrite the files representing user_data tables when I push an update, so if worst comes to worst, I could programatically delete the user_data tables from *my* copy before pushing an update, and I would be overwriting the data and system tables/procedures/whatever. Ideally, I would want to only overwrite the data schema tables, as that would be a smaller download, but it also means I need a way of identifying which files correspond to what, but I can't exactly read them, so it's a problem. In short: Is there any way to identify what data files in the seg0 folder correspond to what tables, and if so what is it? Or do I just have to suck it up and lop off my user_data before pushing an update?
