Re: bcheck syntax
Posted in 1997
Sandy Livingston wrote: > > Could someone please give me the syntax for > bcheck (standard engine). > > I need to check 1 table & it's indexes for > corruption, and / or fix the problems. > > Thanks for your help. I have the syntax for secheck (available in SE 7.1x and above): secheck -+--+------+---+------+---+------+---+------+--+-- filename ---| | | | | | | | | | | | +- -n -+ +- -q -+ +- -l -+ +- -s -+ | | | | | | +- -y -+ | | | +------------------- -V ----------------------+ where: filename specifies the table name as listed in the *.dbs directory, e.g. customer table is custome100. -l lowercase L, directs secheck to check and repair indexes and lists all index-key values. -n responds negatively to all prompts. -q suppresses banner display. -s converts and index file from its existing node size to the current computer hardware node size. -V displays software version information. -y responds affirmatively to all prompts. I don't have the manuals for the 4.x version; form memory I used to do the following to check all tables in a database: - cd test.dbs - ls *.dat > tabfile - vi tabfile Remove the .dat from all lines; this would leave tabfile containing the list of all table names. - vi mybcheck This is a script to read the contents of tabfile and run bcheck on each table name: MYOUTPUT=mybcheck.out # Filename and path for output for TABNAME in `cat tabfile` do echo "Checking $TABNAME." bcheck -y $TABNAME >> $MYOUTPUT done echo echo "Completed mybcheck." - chmod 700 mybcheck So only root could run it. - Execute mybheck. When complete, all tables listed in tabfile would have been checked, and if there were any errors, they would have been automatically corrected since I used the -y option. To check for errors, grep $MYOUTPUT file for the string ERROR (use grep -i error $MYOUTPUT; I can't remember the case of the ERROR tag). To run on one table: bcheck -y <tabname> Hope this helps. Best regards, Nigel -- +--------------------------------------------------------------------+ | Name : Edmund Nigel Gall Address: 9A Stanmore Avenue | | Title : Account Executive Port of Spain | | Company : Stratis Caribbean Ltd. Trinidad & Tobago, W.I. | | | | Contact Information: | | Office Personal | | Voice : (809) 623 6530/1 (809) 662 6611 | | Fax : (809) 623 8370 (809) 662 6611 | | Email : ngall@stratis-caribbean.com nigelg@trinidad.net | +----------------- http://www.stratis-caribbean.com -----------------+