Re: Database recovery after unexpected system shutdown

Tobias Downer <[email protected]> Wed, 27 Apr 2005 15:09:11 -0700
Newsgroups gmane.comp.db.mckoi
Message-ID <[email protected]>
It's possible that a database file can get truncated during an 
unexpected crash with some filesystems.  Would it be possible to zip up 
the database and send it to me at '[email protected]' to look at?

Thanks,
Toby.


Jarosław Pałka wrote:

> Hello!!
> 
> I have w problem with corrupted database from out client (version 
> 1.0.3). He reported to me that his PC had a power failure when our 
> application was running. When he tries to run application it stops 
> because of this exception:
> 
> **** Debug log started: Wed Apr 27 14:21:15 CEST 2005 ****
> % Storage System: v1 file storage mode.
> % Internal Data Cache size:          4194304
> % Internal Data Cache max cell size: 8192
> % lookup_comparison_list = false
> % read_only = false
> % transaction_error_on_dirty_select = true
> % ignore_case_for_identifiers = false
> % Java NIO API is available.
> % io_safety_level = 10
> % Using stardard IO API for heap buffered file access.
> % [Buffer Manager] Using IO API: Java IO
> % [Buffer Manager] Page Size: 8192
> % [Buffer Manager] Max pages: 256
> % Using regex bridge: gnu.regexp
> % No 'function_factories' config property found.
> % statement_cache = true
> % Max worker threads set to: 4
> % Starting Database Server
> **** Debug log started: Wed Apr 27 14:21:16 CEST 2005 ****
> % Storage System: v1 file storage mode.
> % Internal Data Cache size:          4194304
> % Internal Data Cache max cell size: 8192
> % lookup_comparison_list = false
> % read_only = false
> % transaction_error_on_dirty_select = true
> % ignore_case_for_identifiers = false
> % Java NIO API is available.
> % io_safety_level = 10
> % Using stardard IO API for heap buffered file access.
> % [Buffer Manager] Using IO API: Java IO
> % [Buffer Manager] Page Size: 8192
> % [Buffer Manager] Max pages: 256
> % Using regex bridge: gnu.regexp
> % No 'function_factories' config property found.
> % statement_cache = true
> % Max worker threads set to: 4
> % Starting Database Server
> [ TIME: Wed Apr 27 14:21:16 CEST 2005 ]
> % java.io.IOException: File corrupt: last_area_pointer at the end of the 
> file.
>    at com.mckoi.store.AbstractStore.open(AbstractStore.java:209)
>    at 
> com.mckoi.database.V1FileStoreSystem.openStore(V1FileStoreSystem.java:145)
>    at 
> com.mckoi.database.V2MasterTableDataSource.open(V2MasterTableDataSource.java:377) 
> 
>    at 
> com.mckoi.database.TableDataConglomerate.readVisibleTables(TableDataConglomerate.java:383) 
> 
>    at 
> com.mckoi.database.TableDataConglomerate.open(TableDataConglomerate.java:1096) 
> 
>    at com.mckoi.database.Database.init(Database.java:1803)
>    at 
> com.mckoi.database.control.DBController.startDatabase(DBController.java:131) 
> 
>    at 
> com.mckoi.database.jdbcserver.DefaultLocalBootable.boot(DefaultLocalBootable.java:135) 
> 
>    at com.mckoi.database.jdbc.MDriver.connectToLocal(MDriver.java:448)
>    at com.mckoi.database.jdbc.MDriver.connect(MDriver.java:484)
>    at java.sql.DriverManager.getConnection(Unknown Source)
>    at java.sql.DriverManager.getConnection(Unknown Source)
>    at 
> org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:51) 
> 
>    at 
> org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290) 
> 
>    at 
> org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:771) 
> 
>    at 
> org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95) 
> 
>    at 
> net.sf.hibernate.connection.DBCPConnectionProvider.getConnection(DBCPConnectionProvider.java:41) 
> 
>    at 
> net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84)
>    at 
> net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1172)
>    at 
> net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:803) 
> 
>    at 
> com.mrt.service.hibernate.impl.DefaultHibernateService.initialize(DefaultHibernateService.java:436) 
> 
>    at 
> org.apache.avalon.framework.container.ContainerUtil.initialize(ContainerUtil.java:244) 
> 
>    at 
> org.apache.avalon.activation.impl.DefaultComponentFactory.incarnation(DefaultComponentFactory.java:402) 
> 
>    at 
> org.apache.avalon.activation.impl.DefaultComponentFactory.incarnate(DefaultComponentFactory.java:130) 
> 
>    at 
> org.apache.avalon.activation.impl.SingletonLifestyleManager.refreshReference(SingletonLifestyleManager.java:144) 
> 
>    at 
> org.apache.avalon.activation.impl.SingletonLifestyleManager.commission(SingletonLifestyleManager.java:60) 
> 
>    at 
> org.apache.avalon.activation.impl.DefaultAppliance.commission(DefaultAppliance.java:94) 
> 
>    at 
> org.apache.avalon.activation.impl.DefaultRuntime.commission(DefaultRuntime.java:86) 
> 
>    at 
> org.apache.avalon.composition.model.impl.DefaultSystemContext.commission(DefaultSystemContext.java:362) 
> 
>    at 
> org.apache.avalon.composition.model.impl.DefaultDeploymentModel.commission(DefaultDeploymentModel.java:122) 
> 
>    at 
> org.apache.avalon.composition.model.impl.Commissioner.run(Commissioner.java:185) 
> 
>    at java.lang.Thread.run(Unknown Source)
> 
> I tried to run recovery tool but it is unable to repair this database.
> 
> + Found state store: DefaultDatabase_sf
> + Initialized the state store: DefaultDatabase_sf
> + Repairing V2MasterTableDataSource 000SYS_INFO_sUSRSequenceInfo
> - Store: [ JournalledFileStore: 000SYS_INFO_sUSRSequenceInfo ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 65 Free count = 31
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 001SYS_INFO_sUSRSequence
> - Store: [ JournalledFileStore: 001SYS_INFO_sUSRSequence ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 0 Free count = 0
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 002SYS_INFO_sUSRPKeyInfo
> - Store: [ JournalledFileStore: 002SYS_INFO_sUSRPKeyInfo ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 50 Free count = 46
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 003SYS_INFO_sUSRFKeyInfo
> - Store: [ JournalledFileStore: 003SYS_INFO_sUSRFKeyInfo ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 80 Free count = 16
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 004SYS_INFO_sUSRUniqueInfo
> - Store: [ JournalledFileStore: 004SYS_INFO_sUSRUniqueInfo ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 15 Free count = 17
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 005SYS_INFO_sUSRCheckInfo
> - Store: [ JournalledFileStore: 005SYS_INFO_sUSRCheckInfo ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 0 Free count = 0
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 006SYS_INFO_sUSRPrimaryColumns
> - Store: [ JournalledFileStore: 006SYS_INFO_sUSRPrimaryColumns ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 74 Free count = 22
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 007SYS_INFO_sUSRUniqueColumns
> - Store: [ JournalledFileStore: 007SYS_INFO_sUSRUniqueColumns ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 20 Free count = 12
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 008SYS_INFO_sUSRForeignColumns
> - Store: [ JournalledFileStore: 008SYS_INFO_sUSRForeignColumns ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 80 Free count = 16
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 009SYS_INFO_sUSRSchemaInfo
> - Store: [ JournalledFileStore: 009SYS_INFO_sUSRSchemaInfo ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 3 Free count = 29
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 010SYS_INFO_sUSRDatabaseVars
> - Store: [ JournalledFileStore: 010SYS_INFO_sUSRDatabaseVars ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 1 Free count = 31
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 011SYS_INFO_sUSRPassword
> - Store: [ JournalledFileStore: 011SYS_INFO_sUSRPassword ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 1 Free count = 31
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 012SYS_INFO_sUSRUserPriv
> - Store: [ JournalledFileStore: 012SYS_INFO_sUSRUserPriv ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 1 Free count = 31
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 013SYS_INFO_sUSRUserConnectPriv
> - Store: [ JournalledFileStore: 013SYS_INFO_sUSRUserConnectPriv ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 2 Free count = 30
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 014SYS_INFO_sUSRGrant
> - Store: [ JournalledFileStore: 014SYS_INFO_sUSRGrant ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 115 Free count = 109
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 015SYS_INFO_sUSRService
> - Store: [ JournalledFileStore: 015SYS_INFO_sUSRService ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 0 Free count = 0
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 016SYS_INFO_sUSRFunctionFactory
> - Store: [ JournalledFileStore: 016SYS_INFO_sUSRFunctionFactory ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 0 Free count = 0
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 017SYS_INFO_sUSRFunction
> - Store: [ JournalledFileStore: 017SYS_INFO_sUSRFunction ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 1 Free count = 31
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 018SYS_INFO_sUSRView
> - Store: [ JournalledFileStore: 018SYS_INFO_sUSRView ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 15 Free count = 17
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 019SYS_INFO_sUSRLabel
> - Store: [ JournalledFileStore: 019SYS_INFO_sUSRLabel ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 0 Free count = 0
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 020SYS_INFO_sUSRDataTrigger
> - Store: [ JournalledFileStore: 020SYS_INFO_sUSRDataTrigger ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 0 Free count = 0
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 021APP_summary_ingredient_types
> - Store: [ JournalledFileStore: 021APP_summary_ingredient_types ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 0 Free count = 0
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 022APP_summary_product_types
> - Store: [ JournalledFileStore: 022APP_summary_product_types ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 0 Free count = 0
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 023APP_coinslots
> - Store: [ JournalledFileStore: 023APP_coinslots ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 0 Free count = 0
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 024APP_summary_ingredient_machines
> - Store: [ JournalledFileStore: 024APP_summary_ingredient_machines ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 0 Free count = 0
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 025APP_report_types
> - Store: [ JournalledFileStore: 025APP_report_types ]
> - Store areas are intact.
> + Rebuilding free bins.
> - Store repair complete.
> - Checking record integrity.
> * Record count = 62 Free count = 34
> - Rebuilding all table index information.
> - Table check complete.
> + Repairing V2MasterTableDataSource 026APP_venezia_ingredients
> [com.mckoi.debug.Debug - Exception thrown: 'File corrupt: 
> last_area_pointer at t
> he end of the file.']
> java.io.IOException: File corrupt: last_area_pointer at the end of the 
> file.
>        at com.mckoi.store.AbstractStore.open(AbstractStore.java:209)
>        at 
> com.mckoi.database.V1FileStoreSystem.openStore(V1FileStoreSystem.java
> :145)
>        at 
> com.mckoi.database.V2MasterTableDataSource.checkAndRepair(V2MasterTab
> leDataSource.java:818)
>        at 
> com.mckoi.database.TableDataConglomerate.checkVisibleTables(TableData
> Conglomerate.java:438)
>        at 
> com.mckoi.database.TableDataConglomerate.fix(TableDataConglomerate.ja
> va:2323)
>        at 
> com.mckoi.tools.DBConglomerateRepairTool.repair(DBConglomerateRepairT
> ool.java:57)
>        at 
> com.mckoi.tools.DBConglomerateRepairTool.main(DBConglomerateRepairToo
> l.java:87)
> Exception in thread "main" java.lang.RuntimeException: IO Error: File 
> corrupt: l
> ast_area_pointer at the end of the file.
>        at 
> com.mckoi.database.V1FileStoreSystem.openStore(V1FileStoreSystem.java
> :155)
>        at 
> com.mckoi.database.V2MasterTableDataSource.checkAndRepair(V2MasterTab
> leDataSource.java:818)
>        at 
> com.mckoi.database.TableDataConglomerate.checkVisibleTables(TableData
> Conglomerate.java:438)
>        at 
> com.mckoi.database.TableDataConglomerate.fix(TableDataConglomerate.ja
> va:2323)
>        at 
> com.mckoi.tools.DBConglomerateRepairTool.repair(DBConglomerateRepairT
> ool.java:57)
>        at 
> com.mckoi.tools.DBConglomerateRepairTool.main(DBConglomerateRepairToo
> l.java:87)
> 
> Is it possible to recover this database?
> 
> Thanks,
> Jaroslaw Palka
> 
> 
> ---------------------------------------------------------------
> Mckoi SQL Database mailing list  http://www.mckoi.com/database/
> To unsubscribe, send a message to [email protected]
> 
> 



---------------------------------------------------------------
Mckoi SQL Database mailing list  http://www.mckoi.com/database/
To unsubscribe, send a message to [email protected]