$INCLUDE UNIVERSE.INCLUDE MTF.INCL.H $INCLUDE UNIVERSE.INCLUDE FILENAMES.H $INCLUDE UNIVERSE.INCLUDE MACHINE.NAME $INCLUDE UNIVERSE.INCLUDE TLOG.H ****************************************************************************** * * System Admin Transaction Logging - Rollforward - media recovery * * Module %M% Version %I% Date %H% * * (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved * This is unpublished proprietary source code of Ardent Software Inc. * The copyright notice above does not evidence any actual or intended * publication of such source code. * ******************************************************************************* * * Maintenence log - insert most recent change descriptions at top * * Date.... GTAR# WHO Description........................................ * 10/14/98 23801 SAP Change copyrights. * 03/25/96 18212 LAG Windows NT port * 06/27/95 16790 GMH Allow tape restore of multi logs * 06/07/95 16198 GMH Add tape support * 03/09/95 15857 DTM Changed default log # * 10/12/94 15101 DTM Changed length of log number field * 05/15/94 13286 DTM Initial Programming * ******************************************************************************* id = "%W%" ******************************************************************************* ******************************************************************************* * Call initialization routines ******************************************************************************* TPRINT @(-1) temp = NULL CALL *ISUSER.B(0, temp) IF temp = 0 THEN TPRINT UVREADMSG(071000,"") SLEEP 3 STOP END * Check for TAPE keyword locate("TAPE",convert(" ",@fm,@sentence);FROM.TAPE) else FROM.TAPE = 0 * open device file open '&DEVICE&' to DEVICE.FILE else print UVREADMSG(1520,"&DEVICE") sleep 2 end GOSUB init.form CALL *DRAW.SCRN.B( RFM.MSG0, 1 ) GOSUB init.menu CALL *MNU.BAR.PR.B(Menu.Bar,1) ******************************************************************************* * Begin processing ******************************************************************************* CALL *HELP.PRINT.B(UVREADMSG(073009,""),2) CALL *PUT.FORM.B(form.size,form,temp.form,PRMPT,1) help.loop: CALL *HELP.PRINT.B(form,1) input.loop: TPRINT form: temp=temp.form CALL *CINPUT.B(SEC.PRMPT,temp,special,form,0) IF special # 0 THEN BEGIN CASE CASE special = UP.ARROW TPRINT form:PRMPT: IF temp.form # NULL THEN TPRINT temp.form: TPRINT STR(SPACE,27-len(temp.form)): END ELSE TPRINT group.defaults: TPRINT STR(SPACE,27-len(group.defaults)): END form.line -=1 IF form.line < 1 THEN form.line = form.size END GOTO help.loop CASE special = DOWN.ARROW TPRINT form:PRMPT: IF temp.form # NULL THEN TPRINT temp.form: TPRINT STR(SPACE,27-LEN(temp.form)): END ELSE TPRINT group.defaults: TPRINT STR(SPACE,27-LEN(group.defaults)): END form.line +=1 IF form.line > form.size THEN form.line = 1 END GOTO help.loop CASE special = F.1 CALL *HELP.PRINT.B(form< form.line,5>,3) GOTO input.loop CASE special = ESCAPE STOP @(-1) CASE special = F.10 action.value=1 CALL *DO.MNU.BAR.B(Menu.Bar,action.value,form.size,form,temp.form) BEGIN CASE CASE action.value = 1 STOP @(-1) CASE action.value = 2 STOP @(-1) CASE action.value = 3 message=UVREADMSG(073634,"") CONVERT @FM TO " " IN message CALL *HELP.BOX.B(3,10,60,message) CASE action.value = 4 message=UVREADMSG(076001,"") CONVERT @FM TO " " IN message CALL *HELP.BOX.B(3,10,60,message) CASE action.value = 5 CALL *HELP.BOX.B(3,10,45,UVREADMSG(076000,"")) END CASE CALL *PUT.FORM.B(form.size,form,temp.form,PRMPT,1) GOTO help.loop CASE 1 GOTO input.loop END CASE END ELSE BEGIN CASE CASE form.line = 1 IF temp = NULL THEN CALL *HELP.PRINT.B( NULL, 3 ) CALL *HELP.BOX.B( 17, 5, 30, "Must Enter File Name" ) temp.form< form.line > = NULL TPRINT form:PRMPT:temp.form: TPRINT STR(SPACE,16-LEN(temp.form)): GOTO help.loop END IF UPCASE( temp ) # "ALL" THEN GETLIST temp TO 0 ELSE CALL * HELP.PRINT.B( NULL, 3 ) CALL * HELP.BOX.B( 17, 5, 30, "Invalid Select List Name" ) temp.form< form.line > = NULL TPRINT form:PRMPT:temp.form: TPRINT STR(SPACE,16-LEN(temp.form)): GOTO help.loop END END FileName = temp temp.form< form.line > = temp CASE form.line = 2 if not(FROM.TAPE) then Path = temp temp.form< form.line > = temp end else ArchiveList = convert(" ",@VM,temp) RESTART: IF ArchiveList = "" THEN CALL *HELP.BOX.B( 10, 10, 40, "At least ONE tape device must be defined." ) * Repaint previous line TPRINT form:PRMPT:temp.form: TPRINT STR(SPACE,16-LEN(temp.form)): * Repaint current line temp.form< form.line > = "" TPRINT form:PRMPT:temp.form: TPRINT STR(SPACE,16-LEN(temp.form)): GOTO help.loop END * Verify Devices List VAL=0 LOOP REMOVE CURDEV FROM ArchiveList SETTING MARK VAL += 1 * Check in device file READ DEVREC FROM DEVICE.FILE,CURDEV ELSE CALL *HELP.BOX.B( 10, 10, 40, CURDEV:" is not in &DEVICE& file. Removed from list." ) del ArchiveList<1,VAL> goto RESTART END * Check if tape IF DEVREC<4> # "DC" AND DEVREC<4> # "DT" THEN CALL *HELP.BOX.B( 10, 10, 40, CURDEV:" is not a tape device. Removed from list." ) del ArchiveList<1,VAL> goto RESTART END UNTIL MARK = 0 DO REPEAT temp.form = convert(@VM," ",ArchiveList) end CASE form.line = 3 BegLog = temp temp.form< form.line > = temp CASE form.line = 4 EndLog = temp temp.form< form.line > = EndLog CASE form.line = 5 Flag = UPCASE( temp ) IF Flag = "YES" OR Flag = "NO" THEN IF BegLog = "0" THEN CALL *HELP.PRINT.B( NULL, 3 ) CALL *HELP.BOX.B( 17, 5, 45, "Must enter a LogFile number other than 0" ) form.line = 3 temp.form< form.line > = NULL TPRINT form:PRMPT:temp.form: TPRINT STR(SPACE,16-LEN(temp.form)): GOTO help.loop END * Force to non-checking if (FROM.TAPE) then temp = "NO" Flag = "NO" end temp.form< form.line > = temp END ELSE CALL *HELP.PRINT.B( NULL, 3 ) CALL *HELP.BOX.B( 17, 5, 30, "Please enter either YES or NO" ) temp.form< form.line > = NULL TPRINT form:PRMPT:temp.form: TPRINT STR(SPACE,16-LEN(temp.form)): GOTO help.loop END CASE form.line = 6 IF temp # "0" AND temp # "1" and temp # "2" and temp # "3" THEN CALL *HELP.PRINT.B( NULL, 3 ) CALL *HELP.BOX.B( 17, 5, 45, "Please enter either a number between 0 and 3" ) temp.form< form.line > = "0" TPRINT form:PRMPT:temp.form: TPRINT STR(SPACE,16-LEN(temp.form)): GOTO help.loop END Verbosity = temp temp.form< form.line > = temp END CASE TPRINT form:PRMPT:temp.form: TPRINT STR(SPACE,16-LEN(temp.form)): form.line+=1 IF form.line <= form.size THEN GOTO help.loop END ELSE GOSUB roll.forward END END STOP @(-1) ************************************************************************* * roll.forward ************************************************************************* roll.forward: retry = 1 msg = "Do you wish output to go to the Screen?" CALL *YES.NO.BOX.B( 6, msg, retry ) Exec.Sentence = OS.EXEC:" '":UV.BIN:"/uvrolf " if not(FROM.TAPE) then Exec.Sentence := "-l":Path IF retry THEN Exec.Sentence := " -s " END IF (UPCASE(FileName) = "ALL") THEN Exec.Sentence := " -m -a " END ELSE Exec.Sentence := " -m ":FileName END IF Flag = "YES" THEN Exec.Sentence := " -c ":BegLog:" ":EndLog END ELSE Exec.Sentence := " -u ":BegLog:" ":EndLog END if FROM.TAPE then Exec.Sentence := " -t ":change(ArchiveList,@vm," -t ",-1) end Exec.Sentence := " -v":Verbosity:"'" TPRINT @(-1) IF retry = 0 THEN ****************** ** Windows NT port ** IF OS.TYPE = "UNIX" THEN Exec2 = OS.EXEC:" '":"rm -f ":UV.ROOT:"/uvrolf.res":"'" END ELSE Exec2 = OS.EXEC:" '":UV.BIN:"/rm -f ":UV.ROOT:"/uvrolf.res":"'" END ** ****************** EXECUTE Exec2 CAPTURING junk END TPRINT @(-1) EXECUTE Exec.Sentence IF retry = 0 THEN PRINT PRINT PRINT "Results of rollforward :" ****************** ** Windows NT port ** IF OS.TYPE = "UNIX" THEN Exec2 = OS.EXEC:" '":"cat ":UV.ROOT:"/uvrolf.res | more":"'" END ELSE Exec2 = OS.EXEC:" '":"type ":UV.ROOT:"/uvrolf.res | more":"'" END ** ****************** EXECUTE Exec2 CALL *HELP.BOX.B( 17,5,50, UVREADMSG(001403,"")) END ELSE CALL *HELP.BOX.B( 17, 5, 50, "Press return to continue" ) END RETURN ************************************************************************* * Init.form * This routine is used TO initialize the form TO be printed on the * screen for data input. It also sets up the default answers, if * any * ************************************************************************* init.form: form = NULL temp.form = NULL temp.form<1> = "" temp.form<2> = "" if not(FROM.TAPE) then Path="" RECIO( Path, RECIO$PATH ) temp.form<2> = Path end else Dev="" RECIO( Dev, 0, RECIO$DEVICELIST ) temp.form<2> = convert(@vm," ",Dev) end temp.form<3> = "1" temp.form<4> = "1" temp.form<5> = "NO" temp.form<6> = "0" form.size = 6 form.line = 1 form<1,1> = @(5,3) form<1,2> = @(40,3) form<1,3> = RFM.MSG1 form<1,4> = RFM.MSG2 form<1,5> = "This field should contain either 'ALL', to use all the files in the UV.TRANS file, " form<1,5> := "or the name of an active select list. The format of the select list should contain " form<1,5> := "the fully qualified pathnames of all the uniVerse files that should be checked." form<1,6> = 30 form<2,1> = @(5,5) form<2,2> = @(40,5) if not(FROM.TAPE) then form<2,3> = "Directory to restore from" form<2,4> = "Directory to restore from" end else form<2,3> = "Device list to restore from" form<2,4> = "Space delimited list of &DEVICE& entries." end form<2,5> = form<2,4> form<2,6> = 36 form<3,1> = @(5,7) form<3,2> = @(40,7) form<3,3> = RFF.MSG3 form<3,4> = RFF.MSG4 form<3,5> = form<3,4> form<3,6> = 9 form<4,1> = @(5,9) form<4,2> = @(40,9) form<4,3> = RFF.MSG5 form<4,4> = RFF.MSG6 form<4,5> = form<4,4> form<4,6> = 9 form<5,1> = @(5,11) form<5,2> = @(40,11) form<5,3> = RFF.MSG7 form<5,4> = RFF.MSG8 form<5,5> = form<5,4> form<5,6> = 36 form<6,1> = @(5,13) form<6,2> = @(40,13) form<6,3> = "Verbosity Level (0, 1, 2, 3)" form<6,4> = "Verbosity level refers to the amount of data to be displayed/output to the log files/screen." form<6,5> = "Verbosity level refers to the amount of data to be displayed/output to the log files/screen." form<6,5> := " 0 = No Output, 1 = Warning Output, 2 = General Output, 3 = All output" form<6,6> = 36 group.defaults = NULL group.defaults<1> = NULL group.defaults<2> = NULL group.defaults<3> = NULL group.defaults<4> = NULL group.defaults<5> = NULL RETURN *************************************************************************** * init.menu - initializes menu bar *************************************************************************** init.menu: scratch=UVREADMSG(073087,"") Menu.Bar = NULL Menu.Bar<1,1> = 3 ;* Number of Items in Menu.Bar Menu.Bar<1,2> = 1 ;* Line # on which to print the Menu Bar * First Item Menu.Bar<2,1,1>=scratch<1> ;* SubMenu Title Menu.Bar<2,1,2>=1 ;* # of items in SubMenu * SubMenu #1 Menu.Bar<2,2,1>=scratch<6> ;* SubMenu Item Menu.Bar<2,2,2>=1 ;* Action Code (Returned to calling process) Menu.Bar<2,2,3>=scratch<7> * Second Item Menu.Bar<3,1,1>=scratch<8> ;* SubMenu Title Menu.Bar<3,1,2>=1 ;* # of items in SubMenu * SubMenu #1 Menu.Bar<3,2,1>=scratch<6> ;* SubMenu Item Menu.Bar<3,2,2>=2 ;* Action Code Menu.Bar<3,2,3>=scratch<7> scratch=UVREADMSG(073089,"") Menu.Bar<4,1,1>=scratch<1> Menu.Bar<4,1,2>=3 Menu.Bar<4,2,1>=scratch<2> Menu.Bar<4,2,2>=3 Menu.Bar<4,2,3>=scratch<3> Menu.Bar<4,3,1>=scratch<4> Menu.Bar<4,3,2>=4 Menu.Bar<4,3,3>=scratch<5> Menu.Bar<4,4,1>=scratch<6> Menu.Bar<4,4,2>=5 Menu.Bar<4,4,3>=scratch<7> RETURN STOP @(-1) END