Re: Archecker Problem
Posted in 1998
Pat - I have included 4 files for you to review, look at, etc. I was "once bitten" by the archive bug... Never again! runit: the script that our operators call via a menu system ( runit ) which sets the AC_CONFIG env var and calls archecker. After archecker runs it calls a C program I wrote to read reserved page 1 version A and version B to tell you when the archive was created ( It does you no good if you have a verified archive that was created 3 months ago when you were under the impression it was created 3 days ago ). ac_7config.std: the config file that specifies the tape device, blocking, etc od_Respage.sh: the shell script that retrieves the timestamp of the archive ( from both page 0x0010000A and page 0x0010000B ) and calls the C program ArcStamp. ArcStamp.c: the C source to convert the time stamp to something we can read and presents a message on the screen. Please bear in mind that my C was a little rusty when I wrote this, and I haven't had time to see if I can clean it up -- Hey, it works! I know that this is a rather long message to say that it appears that you haven't set the AC_TAPEDEV & AC_TAPEBLOCK variables, but, I am hoping that this information is useful, and may even help with catching another problem we ran into here - operators incorrectly inserting tapes in the drive for archives ( If it doesn't say informix archive on the label -- I'm not going to grab it for a restore! ). Let me know if you need any additional information - Eric P. Melillo Sr. Database Administrator Associated Grocers, Inc. Seattle, WA 98118 vmail: (206) 767-8178 email: eric_melillo@agsea.com ====== files begin =====EPM oslo:/users/informix/archecker> cat runit export AC_CONFIG=ac_7config.std archecker.HP904 -dsvt od_Respage.sh oslo:/users/informix/archecker> cat ac_7config.std AC_TAPEDEV /dev/rmt/1_8mmDFAULTb AC_TAPEBLOCK 32 AC_STORAGE /users/informix/archecker AC_MSGPATH /users/informix/archecker/msg.log AC_OL_VERSION 7 oslo:/users/informix/archecker> cat od_Respage.sh A=`od -x SAVE/RS.0010000A | cut -c 29-32,34-37 | head -2 | tail -1` echo $A > ASTAMP B=`od -x SAVE/RS.0010000B | cut -c 29-32,34-37 | head -2 | tail -1` echo $B >> ASTAMP echo >> ASTAMP echo echo tail -1 msg.log ArcStamp rm ASTAMP oslo:/users/informix/archecker> cat ArcStamp.c #include <stdio.h> #include <time.h> #include <string.h> #define MAXLINE 11 time_t nowA, nowB; int ats_A, ats_B; void main () { int linelen, numval, intval; int rpower, j; char line[MAXLINE]; FILE *fopen(), *fp; if ((fp = fopen("ASTAMP", "r")) != NULL ) { while (!feof(fp)) { fscanf (fp, "%s", line); linelen = strlen(line); intval = 0; for (j=linelen - 1; j>=0; j--) { rpower = linelen - (j + 1) ; switch (line[j]) { case '0': numval=0; intval+= numval * power(16,rpower); break; case '1': numval=1; intval+= numval * power(16,rpower); break; case '2': numval=2; intval+= numval * power(16,rpower); break; case '3': numval=3; intval+= numval * power(16,rpower); break; case '4': numval=4; intval+= numval * power(16,rpower); break; case '5': numval=5; intval+= numval * power(16,rpower); break; case '6': numval=6; intval+= numval * power(16,rpower); break; case '7': numval=7; intval+= numval * power(16,rpower); break; case '8': numval=8; intval+= numval * power(16,rpower); break; case '9': numval=9; intval+= numval * power(16,rpower); break; case 'a': numval=10; intval+= numval * power(16,rpower); break; case 'b': numval=11; intval+= numval * power(16,rpower); break; case 'c': numval=12; intval+= numval * power(16,rpower); break; case 'd': numval=13; intval+= numval * power(16,rpower); break; case 'e': numval=14; intval+= numval * power(16,rpower); break; case 'f': numval=15; intval+= numval * power(16,rpower); break; } /* eod of switch stmt */ } /* eod of for stmt */ if ( ats_A == 0 ) { ats_A = intval; } else ats_B = intval; } /* end of while statement */ fclose(fp); } else { printf("Error opening file ASTAMP\\n"); exit(1); } nowA = ats_A; nowB = ats_B; if ( nowA > nowB ) { printf("\\n\\nThe INFORMIX Archive just verified was created on %s\\n", ctime(&nowA)); } else printf("\\n\\nThe INFORMIX Archive just verified was created on %s\\n", ctime(&nowB)); } /* end of main() */ int power( a, b) int a; int b; { int pow = 1; int i; for (i = 1; i <= b; i++ ) pow *= a; return pow; } /* end of power function */ ===== files end ===== EPM pmilitzer@ultracom.com on 09/14/98 12:16:33 PM Please respond to pmilitzer@ultracom.com To: informix-list@iiug.org cc: (bcc: Eric Melillo/AGInc) Subject: Archecker Problem Hi there, We got the Archecker program from our vendor who in turn got it from informix. The program is suppose to check the validity of your level zero backup. at the command line typed : archecker -dsv In the msg.log I get the following response. STATUS: INFORMIX-OnLine Version 7.14.U Program Name: archecker Version: 4.1 Released: 06/16/97 18:00 Compiled: 06/27/97 13:39 on SunOS 5.4 generic STATUS: AC_STORAGE /users1/archeckertmp STATUS: AC_MSGPATH /users1/archeckertmp/msg.log STATUS: AC_VERBOSE on TIME: [Tue Aug 25 08:39:54 1998] All old validation files removed. ERROR: Device type not set properly ERROR: No device selected. STATUS: Scan FAILED The Tape drive was setup the same way as it was setup in the onconfig file. The informix version in the status line is the wrong version the we are running is 7.23 on solaris 2.6 Does anyone know what is wrong? thanks in advance Pat Militzer pmilitzer@ultracom.com