"SBase Personal - 30. HOUSEKEEPING DATABASE FILES" 30 HOUSEKEEPING DATABASE FILES " link 0} Removing Database Files " link 1} Removing Index Files " link 2} Project Remove Index " link 2} Backing up Data " link 3} Operating System Commands " link 4} Directory List " link 5} Type " link 6} Delete " link 7} Rename " link 8} Copy " link 9} Documentation " link 11} Status File " link 11} Status System " link 12} Project Print Command " link 13} 30 HOUSEKEEPING DATABASE FILES Housekeeping tasks are those that lead to efficient file management: deleting files, renaming them, documenting them, and, most important of all, making backup copies of database files. Removing Database Files Use Remove on the Project menu to remove a database file from disk. This command only operates on open files and erases all the files that make up a single SBase 4 database file: the SBF file, the SBD file, and any indexes associated with the file. When you select the command, SBase presents a standard file requester with a list of all open files. You select a file in the normal way: 1. Click its file name. 2. When the name you want is in the Text box, click OK. Before finally removing the file, SBase 4 asks for confirmation that this is indeed what you wish to do. - To be able to remove a file, you must have opened it with delete privileges. You automatically have these unless more than one password has been set. Notes Do not confuse Project Remove File with the Process Remove command. The latter is used to remove specific records from a file while leaving any remaining records and the file definition (the SBD file) intact. Form files (SBV) may be deleted from within the Form Designer or with the Utilities Delete command. Removing Index Files Project Remove Index From time to time you may wish to drop an index if you find it is rarely used. This will improve performance slightly and use less memory, as SBase 4 will no longer have to update the index when you add or replace a record. As for Project Remove File, SBase 4 presents a standard requester, this time with a list of all the indexes for the current file. You select an index in the normal SBase way: 1. Click its file name. 2. When the index name you want is in the Selection box, click on OK. - As this too is irreversible, SBase 4 asks for confirmation that this is indeed what you wish to do. Note To change a unique index to duplicate index or the other way round, first use this command to remove the index; then rebuild the index, using the Index New command. Backing up Data To safeguard against accidental loss of data, it is important to make backup copies of your database files on a regular basis. One way of doing this is to use the Copy command on the Utilities menu. Remember that a single database file has several components: a SBD file containing the file definition, a SBF file containing the data, and a variable number of index files. You will need to copy each of these in turn. You may find it easier to use AmigaDOS or Workbench commands to back up your files. You could then, for example, copy all the files in a directory or all the component files of a single database file with just one command. For example, if you have exited from SBase 4, you could copy the Address database file to a floppy disk, using the AmigaDOS command: copy Address.#? to df0: The best way to backup database files from the hard disk is to use a tape streamer or special hard disk backup utility program. If these are not available, files should be copied from the directory where they are stored to a floppy disk. One of the purposes of backing up data is to insure against a hard disk failure; so it is not sensible merely to copy database files from one directory to another. Operating System Commands The Utilities menu includes five commands which are the same as or similar to the disk or file management commands provided by AmigaDOS: Directory List, Type, Delete, Rename and Copy. The advantage of using these instead of the equivalent AmigaDOS commands is that you do not have to exit from SBase 4. Directory List This produces a listing of the current directory, in sorted order. The name of the directory and the date are also given. Type The purpose of Type is to allow you to view ASCII text files, such as Export files, SBD files, or Query files (SBQ files). You cannot use it to view program files, database files, or text files which contain control characters. This last category includes text files created in the SBase 4 Text Editor (SBT files). When you select Type, SBase 4 displays a requester which lists the files for the current directory. You can then pick the file whose contents you want to view. As SBase 4 displays or prints the contents of the file it ignores tab characters. If the file contains non-printable characters (such as control characters), SBase 4 will display an error message and stop the display. Delete This command deletes a file from disk. Note the difference between Delete and the Project menu command Remove. Remove deletes the current SBF (a database file) file together with its associated SBD file and index files. Delete deletes only one file at a time. Rename This command renames a file on disk. When you have selected a file from the list, it displays another requester where you type in the new name. Copy This command copies a file to another directory or another disk. After you have selected a file from the requester list, it displays another requester where you type in the name under which the file is to be copied. A file can be copied to the same directory under a new name or to a different directory under the same name or a new name. Documentation At any time during a session with SBase 4, you can use the Status commands on the Utilities menu or the Print command on the Project menu to obtain information about the system as a whole or about individual database files. Status File This command provides a snapshot of the status and statistics of the current file. Statistics include: current index, number of records, number of fields, number of indexes, block size and file size. Also detailed are the field names, attributes, format, and Page View co-ordinates for each field, and any calculation or validation formulas. Finally, you can see whether a password has been set, the type of read/write privileges for the file, and the file's valid/invalid status. - If the SET FILE MAX ON command has been used to allow SBase to create and use extended files - those with more than 16 million records - the file size indicator is followed by the letter E. <$Ffile size> Status System This provides a summary of the data described above for all open files, but excluding statistics for the individual files. Additional data is shown for these items: Amount of free memory, amount of free disk space, current directory, number of files open and the number of files available. Project Print Command The Print command on the Project menu allows you to output to the printer information that would appear on the screen if you used the Utilities menu. You can obtain printouts of: Directory List Status File Status System Disk File Check that the printer is switched on, loaded with paper and on-line, then choose the required Print command from the Project menu.