Please enable JavaScript to view this site.

R:BASE 11 Beginners Tutorial

Your data is, of course, the most important part of the database. The structure can be recreated, but it may take months to reenter data. Some of the data may go back years and not be recoverable. The UNLOAD DATA command creates an ASCII file with SET commands at the beginning to set the environment, then a LOAD tblname command followed by the data in ASCII delimited format.

 

If you backup form, report and label data with the structure, do not use the UNLOAD DATA command to backup your data tables. That command includes the data for forms, reports and labels. Instead, use the UNLOAD DATA FOR tblname command and do each table individually. Some tables, such as lookup tables that do not change frequently, are backed up together. Create command or application files to do the backup process. Setting up a backup routine is a one-time process, but it pays for itself the first time you need to restore.

 

For example:

 

OUTPUT looktab.dat

UNLOAD DATA FOR looktab1

UNLOAD DATA FOR looktab2

UNLOAD DATA FOR looktab3

OUTPUT SCREEN

 

OUTPUT tblname1.dat

UNLOAD DATA FOR tblname1

OUTPUT SCREEN

 

OUTPUT tblname2.dat

UNLOAD DATA FOR tblname2

OUTPUT SCREEN

 

If you do not wish to backup form, report and label data separately within their own files, you can easily include all of the data in one file.

 

For example:

 

OUTPUT dbname.dat

UNLOAD DATA

OUTPUT SCREEN

 

When backing up data, it is important to set the NULL symbol in the database to -0- or some other character that does not appear in your data. When R:BASE loads the data during the restore, it checks the first four characters of each data field to see if it matches the NULL symbol. If it matches, the field is loaded as a NULL. This is why backing up and restoring forms and reports with the NULL symbol set to a blank causes problems - part of the form and report data is blank lines, these blank lines become NULL if restored with the NULL symbol set to a blank and the forms and reports do not work correctly.

 

In R:BASE, you will have large object (LOB) data in your database. All forms, reports, and labels are stored as LOB data rather than ASCII data. When the output from the UNLOAD command is sent to a backup file, (e.g. db_backup.all) the LOB data will be placed into a separate LOB file, only it will have a .LOB file extension (e.g. db_backup.lob). The backup output file contains references to the LOB file where the table data is loaded. Both files are required in order to restore the database, and they must reside in the same folder location.