Subject | Clone a table to another database |
---|---|
Author | Chee Yang |
Post date | 2011-02-12T03:51:41Z |
Hi,
When I use gbak to backup a firebird database, I encounter this error:
gbak: ERROR:database file appears corrupt (C:\USERS\CODER\DOCUMENTS\DB\SQL.ACCOU
NT.4\DAMAGE.FDB)
gbak: ERROR: wrong page type
gbak: ERROR: page 116717 is of wrong type (expected 7, found 4)
gbak:Exiting before completion due to errors
I have tried gfix and it doesn't fix the problem.
I can only rescue my database by using qli or Interbase DataPump component from clevercomponent to migrate the rows and tables to a new database.
The rescue process need few operations in series:
1. Create a new database
2. Extract metadata from corrupt database
3. Inject metadata into new database
4. clone table one by one from corrupt database to new database
5. clone view from corrupt database to new database
6. clone generators from corrupt database to new database
7. update generators value
8. create indexes
9. clone triggers from corrupt database to new database
and etc...
I wish to create a Windows GUI application that able to handle the job automatically.
I am using the firebird api from fbclient.dll to perform the job. I am able to retrieve the rows from corrupt database into XSQLVAR structures. However, I don't have ideas how to make use of the XSQLVar to inject it into new database.
Is using the firebird api the most fastest in performance to perform such migration in terms of cpu cycles?
Please advice. Thank you.
When I use gbak to backup a firebird database, I encounter this error:
gbak: ERROR:database file appears corrupt (C:\USERS\CODER\DOCUMENTS\DB\SQL.ACCOU
NT.4\DAMAGE.FDB)
gbak: ERROR: wrong page type
gbak: ERROR: page 116717 is of wrong type (expected 7, found 4)
gbak:Exiting before completion due to errors
I have tried gfix and it doesn't fix the problem.
I can only rescue my database by using qli or Interbase DataPump component from clevercomponent to migrate the rows and tables to a new database.
The rescue process need few operations in series:
1. Create a new database
2. Extract metadata from corrupt database
3. Inject metadata into new database
4. clone table one by one from corrupt database to new database
5. clone view from corrupt database to new database
6. clone generators from corrupt database to new database
7. update generators value
8. create indexes
9. clone triggers from corrupt database to new database
and etc...
I wish to create a Windows GUI application that able to handle the job automatically.
I am using the firebird api from fbclient.dll to perform the job. I am able to retrieve the rows from corrupt database into XSQLVAR structures. However, I don't have ideas how to make use of the XSQLVar to inject it into new database.
Is using the firebird api the most fastest in performance to perform such migration in terms of cpu cycles?
Please advice. Thank you.