[
https://issues.apache.org/jira/browse/DERBY-6136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Rick Hillegas updated DERBY-6136:
---------------------------------
Attachment: RawDBReader.java
Attaching the first rev of RawDBReader, a custom tool for dumping the data in a
corrupt database. This tool makes use of DataFileVTI. The tool creates schemas,
table functions, and wrapper views for reading all user tables in a corrupt
database. To use the tool you must specify the bootpassword (if applicable) and
the credentials of the owner of the corrupt database. The tool takes the
following arguments:
o The name of a control schema to create in your local database. The control
schema will hold views against the core catalogs in t e corrupt database.
o A prefix to prepend to the names of user schemas. For each schema in the
corrupt database, the tool creates a corresponding lo al schema with this
prefix prepended to its name.
o The location of the corrupt database directory. That is, the directory which
holds its service.properties file.
o The bootpassword of the corrupt database.
o The username of the owner of the corrupt database.
o The password of the owner of the corrupt database.
You load the tool like this:
call syscs_util.syscs_register_tool
(
'customTool',
true,
'RawDBReader',
'CONTROL',
'RAW_',
'/Users/corruptdbs/badDB',
null,
'FRED_THE_DBO',
'fredspassword'
);
If the corrupt database has a table named T1 in schema S1, you can dump its
data like this:
select * from RAW_S1.T1;
When you are done dumping the data, you can unload the tool as follows. This
will drop all of the schema objects which were created when the tool was loaded:
call syscs_util.syscs_register_tool
(
'customTool',
false,
'RawDBReader',
'CONTROL',
'RAW_'
);
> Create a custom/optional tool for dumping the data in a corrupted database.
> ---------------------------------------------------------------------------
>
> Key: DERBY-6136
> URL: https://issues.apache.org/jira/browse/DERBY-6136
> Project: Derby
> Issue Type: Improvement
> Components: Tools
> Affects Versions: 10.11.0.0
> Reporter: Rick Hillegas
> Attachments: DataFileVTI.java, dataFileVTI.sql, RawDBReader.java
>
>
> It would be useful to have a tool for dumping the data in a corrupted
> database. This could start out as a custom tool. After we debug the tool and
> get some experience with it, we can consider promoting it to be a (possibly
> undocumented) optional tool which we ship with the product. I think the tool
> should have the following behavior:
> 1) The tool should not subvert the security of the corrupted database. If the
> corrupted database is password-protected, then you would need to present its
> DBO's credentials in order to use the tool. Naturally, an encryption key
> would have to be presented in order to decode an encrypted database.
> 2) The tool should not stop reading a table when it hits a corrupt record.
> Instead, the tool should soldier on and collect a list of warnings on bad
> records.
> Such a tool would be useful in situations where some part of a heap table is
> corrupt but the following heap conglomerates are intact:
> i) SYSSCHEMAS
> ii) SYSTABLES
> iii) SYSCONGLOMERATES
> iv) SYSCOLUMNS
> v) property conglomerate
> Such a tool would be useful for some situations where data can't be dumped
> even after you delete the log files in order to short-circuit recovery.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira