mapcache
mapcache copied to clipboard
BerkeleyDB: problems opening database with dbsql utility
- using master with "Berkeley DB 11g Release 2, library version 11.2.5.3.21"
- would like to use dbsql utility to examine the 'tiles' table
- command: dbsql my-mapcache.db
- no errors
- however the next command causes errors: .tables
Error: file is encrypted or is not a database
- examining, I find that when dbsql utility is used, it is trying to open another database from that same file (with a name of "my-mapache.db-journal")
- if I look inside that new -journal folder, there is a "sql-errors.txt" file, that contains:
D:\ms4w\tmp\ms_tmp\cache\my-mapache.db:BDB1014 D:\ms4w\tmp\ms_tmp\cache\my-mapache.db-journal\..\berkeley.db: multiple databases specified but not supported by file
- from the BDB docs, it seems we need to make sure our db->open code allows for multiple databases to be created (see the optional "database" parameter at http://docs.oracle.com/cd/E17076_02/html/api_reference/C/dbopen.html)
- I think this is around line#105: https://github.com/mapserver/mapcache/blob/master/lib/cache_bdb.c#L105
Thoughts?
Mapcache uses the traditional BerkeleyDB API where as dbsql is used to interact using the SQL API. See http://www.oracle.com/technetwork/database/berkeleydb/overview/sql-160887.html for more. Using dbsql to examine a BDB cache simply won't work.