[Zope-DB] Unpickling data from OracleStorage

Randy Jay Yarger ryarger@webelite.com
10 Oct 2002 17:56:18 -0400


Hello!

I'm trying to 'manually' unpickle some objects from OracleStorage and am
not having much luck. Here is the situation in brief:

* A bad block on a disk caused part of the ZODB_RECORD table to become
corrupt.
* Oracle allowed me to export all of the rest of the tables and at least
part of ZODB_RECORD
* Zope won't start with this new configuration (I'm assuming that it's
because the newest T_IDs are missing from the truncated ZODB_RECORD, but
that's just a guess)
* Giving up on getting Zope working I'm now trying to resurrect my old
objects out of ZODB_PICKLE
* I wrote a small JDBC Java program to read the contents of ZODB_PICKLE
(I haven't tackled Pythons database modules yet)
* I'm feed the contents of a pickle field into the 'decode_str' function
found in the Full.py module of OracleStorage (which seems to be what it
does right after reading from the database)
* I then send the resulting string to pickle.loads() and get:

>>> pickle.loads(decode_str(l))
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.2/pickle.py", line 985, in loads
    return Unpickler(file).load()
  File "/usr/lib/python2.2/pickle.py", line 596, in load
    dispatch[key](self)
KeyError: =DB


Has anyone tried anything like this before? Here's an example pickle
that I invite any brave soul to try to unpickle... (The pickle was done
using Python 2.1.3 on Win32 if that matters...):

2828550F4F46532E4170706C69636174696F6E7101550B4170706C69636174696F6E7102747=
1034E742E7D710428
550D436F6E74726F6C5F50616E656C7105285508000000000000000271062855164170702E4=
170706C69636174696
F6E4D616E61676572710755124170706C69636174696F6E4D616E6167657271087474515510=
5F5F616C6C6F775F67
726F7570735F5F71092855080000000000000003710A285512416363657373436F6E74726F6=
C2E55736572710B550
A55736572466F6C646572710C747451550961636C5F7573657273710D28680A28680B550A55=
736572466F6C646572
710E74745155085F6F626A65637473710F287D71102855096D6574615F747970657111550B5=
573657220466F6C646
5727112550269647113680D757D7114286811550D436F6E74726F6C2050616E656C71156813=
68057574752E

That's the first copy of z_oid #1 in ZODB_PICKLE.

I can send the script I'm using to decode if anyone is interested.

Thanks in advance!
-Randy Yarger
Web Elite
ryarger@webelite.com