db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hillegas <rick.hille...@gmail.com>
Subject Re: database in a jar : conglomerate does not exists
Date Sat, 12 Sep 2020 16:08:25 GMT
I am not an expert on the storage layer, but some cursory reading of the 
code suggests the following:

* When a table is created, a file is created for it in the seg0 
directory having the name cXXX.dat where XXX is the hex representation 
of the table's heap conglomerate number.

* When a table is dropped, the cXXX.dat file is deleted and a stub file 
called dXXX.dat is created in the seg0 directory. I don't understand the 
purpose of the stub file.

So it appears that at some point, some process issued a "DROP TABLE 
authors" command. I don't have a theory about why the system catalogs 
think that the table still exists.

-Rick

On 9/10/20 11:06 PM, RAPPAZ Francois wrote:
> Hi Rick
>
> Thanks for helping !
>
> The query return 11 rows
> SCHEMANAME                                                                          
                                           |TABLENAME                                    
                                                                                  |CONGLOMERATENAME
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> APP                                                                                 
                                           |AUTHORS                                      
                                                                                  |08264012-0124-bfb9-c84d-ffffa7816d66
> NULLID                                                                              
                                           |AUTHORS                                      
                                                                                  |08264012-0124-bfb9-c84d-ffffa7816d66
> SQLJ                                                                                
                                           |AUTHORS                                      
                                                                                  |08264012-0124-bfb9-c84d-ffffa7816d66
> SYS                                                                                 
                                           |AUTHORS                                      
                                                                                  |08264012-0124-bfb9-c84d-ffffa7816d66
> SYSCAT                                                                              
                                           |AUTHORS                                      
                                                                                  |08264012-0124-bfb9-c84d-ffffa7816d66
> SYSCS_DIAG                                                                          
                                           |AUTHORS                                      
                                                                                  |08264012-0124-bfb9-c84d-ffffa7816d66
> SYSCS_UTIL                                                                          
                                           |AUTHORS                                      
                                                                                  |08264012-0124-bfb9-c84d-ffffa7816d66
> SYSFUN                                                                              
                                           |AUTHORS                                      
                                                                                  |08264012-0124-bfb9-c84d-ffffa7816d66
> SYSIBM                                                                              
                                           |AUTHORS                                      
                                                                                  |08264012-0124-bfb9-c84d-ffffa7816d66
> SYSPROC                                                                             
                                           |AUTHORS                                      
                                                                                  |08264012-0124-bfb9-c84d-ffffa7816d66
> SYSSTAT                                                                             
                                           |AUTHORS                                      
                                                                                  |08264012-0124-bfb9-c84d-ffffa7816d66
>
> 11 rows selected
> ij>
>
> There is no C560.dat file in docentries/Seg0 directory in the jar file. (there is a d560.dat
and a c460.dat).
>
> The thing that has changed (possibly since a long time ago) is the java version himself
since it is update automatically on my pc .
>
> But the code I'm using have been made years ago and it went well for a long time without
any change from my side.
>
> I did rebuild the table in the database on my disc once in a year, either by deleting
+ adding new rows, or by dropping the table and creating a new then adding the row.
> The database in the docentries folder is ok, I can run a select again the table.
> Then I build the jar (with an ant task that didn't change for years.)
>
> François
>
> -----Original Message-----
> From: Rick Hillegas <rick.hillegas@gmail.com>
> Sent: 11 September 2020 00:49
> To: Derby Discussion <derby-user@db.apache.org>; RAPPAZ Francois <francois.rappaz@unifr.ch>
> Subject: Re: database in a jar : conglomerate does not exists
>
> Also, look inside the jar file for a directory called docentries/seg0.
> Does it contain a file called c560.dat?
>
> On 9/10/20 8:53 AM, Rick Hillegas wrote:
>> Sorry. Make that query:
>>
>> SELECT s.schemaName, t.tableName, c.conglomerateName
>>
>> FROM sys.sysConglomerates c, sys.sysSchemas s, sys.sysTables t
>>
>> WHERE c.conglomerateNumber = 1376
>>
>> AND c.tableID = t.tableID
>>
>> AND t.schemaID = s.schemaID
>>
>> ;
>>
>>
>> On 9/10/20 8:22 AM, Rick Hillegas wrote:
>>> Hi François,
>>>
>>> Do you have any information or theories about how your database
>>> became corrupted? I have never encountered this situation before. A
>>> database in a jar file should be read-only, so the only theory I have
>>> is that the jar file itself was corrupted by some process outside Derby.
>>>
>>> Please run the following query in order to find out what table/index
>>> is corrupted:
>>>
>>> SELECT s.schemaName, t.tableName, c.conglomerateName
>>>
>>> FROM sys.sysConglomerates c, sys.sysSchemas s, sys.sysTables t
>>>
>>> WHERE c.conglomerateNumber = 376
>>>
>>> AND c.tableID = t.tableID
>>>
>>> AND t.schemaID = s.schemaID
>>>
>>> ;
>>>
>>>
>>> Thanks,
>>> -Rick
>>>
>>> On 9/10/20 3:09 AM, RAPPAZ Francois wrote:
>>>> Hi
>>>> I have a one table database embedded in a jar file. I tried to
>>>> access it from ij with java -jar %DERBY_HOME%/lib/derbyrun.jar ij -p
>>>> ij.properties
>>>>
>>>> ij.properties is
>>>> derby.ui.codeset=utf8
>>>> ij.connection.doc=jdbc:derby:jar:(U:/docs/OA/articles/zlib/autconv/a
>>>> utconv.jar)docentries
>>>>
>>>>
>>>> I can see that my table (authors) is in the the database with SHOW
>>>> TABLES; I can see the columns
>>>> ij> DESCRIBE authors;
>>>> COLUMN_NAME
>>>> |TYPE_NAME|DEC&|NUM&|COLUM&|COLUMN_DEF|CHAR_OCTE&|IS_NULL&
>>>> --------------------------------------------------------------------
>>>> ----------
>>>>
>>>> NAME1               |VARCHAR  |NULL|NULL|20    |NULL |40       
|NO
>>>> NAME2               |VARCHAR  |NULL|NULL|20    |NULL |40       
|NO
>>>> DATA                |VARCHAR  |NULL|NULL|50    |NULL |100      
|YES
>>>> AUTHOR_ID           |INTEGER  |0   |10  |10 |AUTOINCRE&|NULL
>>>> |NO
>>>>
>>>> 4 rows selected
>>>> But I can't run a select statement:
>>>> ij> select * from authors;
>>>> ERROR XSAI2: Le conglomerat (1,376) demande n'existe pas.
>>>> ij> exit;
>>>>
>>>> I have derby 10.8.2.2
>>>> Thanks for any help.
>>>>
>>>> François
>>>>
>>>
>>


Mime
View raw message