[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

454.0. "Can I repair this bad SYSUAF.DAT file?" by LA780::LONGO (Bob Longo) Mon Apr 27 1987 06:59

    I have a SYSUAF.DAT file that is corrupt.  UAF> LIST * dies at a
    particular user's record with a "RMS-E-RTB, record too big" error.
    
    I cannot delete or rename this particular user's record, but UAF
    is able to process records after the bad user.
    
    ANALYZE/RMS shows no errors.
    
    CONVERT/MERGE/TRUNCATE (and any other combination of CONVERT qualifiers
    I can think of) terminates my process when this record is encountered
    with a non-fatal bugcheck.
    
    Does anyone know of a way to repair the SYSUAF.DAT file?  Maybe
    via a patch utility?
    
    -Bob (suffering my punishment for not having a good backup)
T.RTitleUserPersonal
Name
DateLines
454.1BISTRO::HEINIf We don't Have it,You don't Need it!Mon Apr 27 1987 11:0126
    Bob,
    	I can see several solutions:
    
    	- Write a small BASIC to FIND and DELETE or COBOL program that
    	  simply DELETES the record. Both use a SYS$FIND to position to
    	  the record. The record contents would not be moved and the
    	  RTB error should not occur though other error due to the same
    	  corruption may happen. Work on a backup!
    
    	- Write a small program to read the records up to the bogus
    	  record and another to read the records after it. The use
    	  CONVERT to combine the two (sequential) files.
    	  $RUN GET_FIRST_BIT
    	  $RUN GET_REST
    	  $ANA/RMS/FDL SYSUAF
    	  $CONV/STAT/FAST/NOSORT FIRST_BIT,REST SYSUAF/FDL=SYSUAF
    
    	- Patch the file. To quickly find which VBN to attack print
    	  out the RFA for the bogus record or the one just before it.
    	  Dump the offending bucket and post the output here. Perhaps
    	  someone can hint you how to zap it.
    
    	DTR can probably also be used for the first and the second method.
    
    Hope this helps,
    			Hein van den Heuvel.
454.2me too!ACE::BREWERJohn Brewer Component Engr. @ABOMon Apr 27 1987 21:535
    
    	If you get it to work... let me know plz!!!! I have the exact
    same problem!
    
    	-John
454.3Trust me, I only want SYSPRV!UFP::MURPHYEuropean or African Swallow?Tue Apr 28 1987 03:273
    post the output from ANALYZE/RMS. If you'll let me at your system,
    I'll see what I can do to fix it..
    	-Rick
454.4I used BASICCHOVAX::YOUNGBack from the Shadows Again,Tue Apr 28 1987 03:5018
    I had the exact same problem about 4 months ago on a cluster with
    4000+ user entries (don't ya love it!).  I basically used a method
    similar to what Hien recommended.
    
    1.  I wrote a BASIC program that just read records and wrote them
    to an identical output file (CONVERT/FDL) until a read failed.
    
    2.  Then the program would take the value of the last primary key
    that was read successfully, add a small value to it, and try a
    keyed read from the file.  If that also failed it would increment
    the value and try again and again until it succeded.
    
    3.  Then it would write this record to the output, and return to
    the cycle of reading and writing until the end of the file.

    Worked like a charm.
    
    --  Barry
454.5Bad SYSUAF.DAT fixed!SRFSUP::LONGOBob LongoWed May 06 1987 21:4371
    I was able to recover almost all of my bad SYSUAF.DAT file with the
    attached program that was provided to my by Barry (CHOVAX::) Young.
    Thanks to everyone who responded, and especially to Barry for the
    nifty program.
    
    -Bob
    
!$ BACKUP /IGNORE=INTERLOCK sysuaf.dat sysuaf.back
!$ ANALYZE /RMS /FDL sysuaf.back
!$ RUN sysuaf_fix
!$ CONVERT /FDL=sysuaf sysuaf.new sysuaf.dat
!$ EXIT

Option type=explicit

Declare long more_data
Declare long step_over
Declare long character
Declare string test_key

Map (sysuaf) string dummy=1412
Map (sysuaf) string fill=4, username=32, long uic

Open "sysuaf.back" for input as file #1%,          &
    map sysuaf,     organization indexed variable,  &
    recordtype none,                                &
    primary key username noduplicates nochanges ,    &
    alternate key uic duplicates changes

Open "sysuaf.new" for output as file #2%,            &
    map sysuaf,     organization indexed variable,  &
    recordtype none,                                &
    primary key username noduplicates nochanges ,    &
    alternate key uic duplicates changes

More_data = -1%

While more_data

    When error in
        Get #1%
        Put #2%
    Use
        If ( err = 11% ) then
            Step_over = 0%
            More_data = 0%
        Else
            Step_over = -1%
        End if
    End when

    Character = 1%
    Test_key  = username
    While ( step_over )
        When error in
            Mid$ ( test_key, 33%-character, 1% ) = Chr$ ( 255% )
            Get #1%, key #0% ge test_key
            Step_over = 0%
        Use
            Character = character + 1%
            Step_over = 0% if character > 32%
            More_data = 0% if character > 32%
        End when
    Next

Next

Close #1%
Close #2%

End