Retrievive index definations
Brian K. White
bw.aljex at gmail.com
Fri Oct 18 04:39:33 PDT 2019
On 10/18/19 3:01 AM, Stan-Lyn, Stanley Barnett via Filepro-list wrote:
> Hi Richard,
>
> What you are doing is what I want to switch to.
>
> What I need is a fast way or a function that can read the definition of an existing index and output its syntax so it can be added to the batch script. I'm moving away from the -ra switch, as it cannot deal with corrupted or missing indexes. Currently, when I run into a corrupted index, I have to search all my selection processing, menus, scripts so I can figure out how to recreate the index, and what a pain.
The only thing that can be scripted that I know of is to copy the first
140 bytes of each index file, and just keep those off to the side. When
you need to re-create an index, you replace the bad index with a copy of
the header, and then tell dxmaint to rebuild the index. It doesn't show
you what the current index definition is, just saves it whatever it is,
and restores it.
You can also script scanning through all indexes to detect differences
between the headers of all indexes and the saved headers. It won't tell
you if the change was a programming update or damage, but presumably you
would know that. So, you could have an automated periodic scan that
automatically replaces any indexes whose headers changed, in cases where
you know there should be no changes.
I think you'd have to pick the header apart and only look at certain
bytes to check for changes, and ignore changes in other bytes.
Actually parsing the existing definitions, I don't know of an easy way,
but you could possibly write something to pick the headers apart based
on the index file documentation.
You do all that with generic os tools and/or the language of your choice
except for calling dxmaint to rebuild. The 140 bytes is just one chunk
from the beginning of the file, not per record.
automatic index format from fp 4.5 to 5.8:
https://web.archive.org/web/20081012185355/http://www.fptech.net/Products/Docs/FPFormat/autoix45.shtml
--
bkw
>
> Thanks,
> Stanley
>
>
>
>
> -----Original Message-----
> From: Richard Kreiss <rkreiss at verizon.net>
> Sent: Tuesday, October 15, 2019 3:54 PM
> To: Stan-Lyn, Stanley Barnett <stanley at stanlyn.com>
> Subject: RE: Retrievive index definations
>
> Try this as it takes into account corrupted indexes and/ort missing indexes
>
> I use this menu option to avoid clients calling me if an index disappears or get corrupted.
>
> This method can be used on both auto indexes and demand indexes
>
> Check the Index help for the reasons for why there are what appears to be extra commas.
>
> Richard Kreiss
> GCC Consulting
>
> C R E A T E B A T C H F I L E 6.0
> ------------------------------------------------------------------------
> @dprodir un_hnote -L
> @ECHO ****** UPDATING SALESNOTE INDEXES *************
> @dxmaint un_hnote -oa -e -rf 1 -h "Reconstructing Note Index A"
> @dxmaint un_hnote -ob -e -rf 2:1 -h "Reconstructing Note Index B"
> @dxmaint un_hnote -oc -e -rf 3:1 -h "Reconstructing Note Index C"
> @dxmaint un_hnote -od -e -rf 10:11:1 -h "Reconstructing Note Index D"
> @dxmaint un_hnote -oe -e -rf 11:10:1 -h "Reconstructing Note Index E"
> @dxmaint un_hnote -of -e -rf 74 -h "Reconstructing Note Index F"
> @dxmaint un_hnote -og -e -rf 66 -h "Reconstructing Note Index G"
> @dxmaint un_hnote -oh -e -rf 73 -h "Reconstructing Note Index H"
> @dxmaint un_hnote -oi -e -rf 81:1 -h "Reconstructing Note Index I"
> @dxmaint un_hnote -oj -e -rf 91:81,,d:1 -h "Reconstructing Note Index J"
> @dxmaint un_hnote -ok -e -rf 4:81,,d -h "Reconstructing Note Index K"
>
>> -----Original Message-----
>> From: Stan-Lyn, Stanley Barnett <stanley at stanlyn.com>
>> Sent: Tuesday, October 15, 2019 1:20 PM
>> To: Richard Kreiss <rkreiss at verizon.net>
>> Subject: RE: Retrievive index definations
>> Importance: High
>>
>> Hi Richard,
>>
>> You may not be understanding what I need. As I understand what you
>> are saying, will only work if the index exists and NOT deleted or corrupted.
> The
>> normal filepro tools allows you to create new, and update existing (so
> long as
>> they are not corrupted). Instead of using the -ra switch to rebuild
>> all
> of a tables
>> indexes, it would be much better to create then again from scratch
>> using
> the
>> dxmaint tool with the full definition for each index executed by a
>> single
> dxmaint
>> command in a script, like...
>>
>> So instead of doing this:
>> /appl/fp /dxmaint sdequip -RA -m _sla -E
>>
>> I need to do this so I can build or rebuild a deleted or corrupted
>> index
> without
>> tracking down of guessing the details on how and why it was built.
>> Also
> note the
>> arguments for the automatic indexes A-Cx shown below is not correct
>> and
> used
>> only to convey what I am trying to do:
>> /appl/fp /dxmaint comments -o0 -e -r -a -x0 -h "Rebuilding Index 0 for
> Comment
>> File"
>> /appl/fp /dxmaint comments -o1 -e -r -a -x1 -h "Rebuilding Index 1 for
> Comment
>> File"
>> /appl/fp /dxmaint comments -oA -e -r -a -xA -h "Rebuilding Index A for
>> Comment File"
>> /appl/fp /dxmaint comments -oB -e -r -a -xB -h "Rebuilding Index B for
>> Comment File"
>> /appl/fp /dxmaint comments -oC -e -r -a -xC -h "Rebuilding Index C for
>> Comment File"
>>
>> Thanks,
>> Stanley
>>
>>
>>
>>
>> -----Original Message-----
>> From: Richard Kreiss <rkreiss at verizon.net>
>> Sent: Monday, October 14, 2019 4:54 PM
>> To: Stan-Lyn, Stanley Barnett <stanley at stanlyn.com>
>> Subject: Re: Retrievive index definations
>>
>> Depending on your version, FPTech fad supplied an index rebuild
>> program
> that
>> does what you ask
>>
>> Also you could just add a menu option.
>>
>> Dxmaint !! -e
>>
>> This will present the list of filePro files and allow for selecting
>> the
> file and index
>> wanted. The -e will return to the menu when the rebuild is done.
>>
>> RichardKreiss
>> Sent from my iPhone
>>
>>> On Oct 14, 2019, at 4:07 PM, Stan-Lyn, Stanley Barnett via
>>> Filepro-list
> <filepro-
>> list at lists.celestial.com> wrote:
>>> Hi,
>>>
>>>
>>> Is there a way to retrieve the index definitions of a data file
>>> where
> its indexes
>> were built via the gui? So instead of ./dxmaint table -bs -ra -e -h
> "Rebuilding All
>> Indexes" that rebuilds all the indexes without knowing anything about
>> the indexes, I need to build them individually with the dxmaint command.
>> Sometimes an index gets deleted and without this info, I have to spend
>> a
> lot of
>> time tracking down the process that uses the deleted index and then
>> try
> and
>> figure out how it was constructed. If this info can be gathered near
> creation
>> time, I would have a library of the index definitions. I'm using SCO
>> Unix
> here. So
>> is there a filepro function or a storage location where the definition
>> can
> be
>> retrieved?
>>>
>>> Thanks,
>>>
>>> Stanley
>>>
>>>
>>> -------------- next part -------------- An HTML attachment was
>>> scrubbed...
>>> URL:
>>> <http://mailman.celestial.com/pipermail/filepro-list/attachments/201
>>> 91
>>> 014/1c785552/attachment.html>
>>> _______________________________________________
>>> Filepro-list mailing list
>>> Filepro-list at lists.celestial.com
>>> Subscribe/Unsubscribe/Subscription Changes
>>> http://mailman.celestial.com/mailman/listinfo/filepro-list
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
More information about the Filepro-list
mailing list