Working with GE Security's Picture Perfect™ History Tapes
Codebench CBADUMP
To extract history and backup data from old CASI-RUSCO Picture Perfect archive and backup tapes, you can use cbadump. The cbadump utility:
- Allows the user to select one or more tables to be extracted
- Saves the tables in delimited files rather than restoring them directly to the database
- Creates an Informix dbload command file for each table extracted
- Creates a CPIO archive file of regular files
- Shows the byte offset of each table on the media
To use this utility, download it from the appropriate folder:
- AIX - binary installation
- Linux - binary installation
- UNIX_SV - binary installation
- Generic - source code with full support for Windows, AIX, Linux, Unixware, MinGW, Msys, and most GNU-based platforms
Copy the downloaded GZIP file to a scratch directory and, depending on your operating system type:
sh cbadump-1.8-3.aix.shx
orsh cbadump-1.8-3.unix_sv.shx
orrpm -i cbadump-1.8-3.i386.rpm
The software should now be installed as /usr/bin/cbadump.
Usage
cbadump [-r] -f device OR file [ table1 [ table2 [ table3 [...]]]]
Options
| -r | Read only mode. Displays tables and media offsets but does not create copies of tables |
| -f device or file | Specifies that the name following the -f option is a tape device (such as /dev/st0) or a file name |
| table1, table2 | Specifies which tables to copy from the media into the local directory |
Example: Extract the badges from the backup and load them into the database.
# cbadump -f backup.cba badge
badge 0
# ls -l
-rw-r--r-- 1 root root 31759097 Mar 21 16:28 badge.dat
-rw-r--r-- 1 root root 54 Mar 21 16:28 ld_badge
# dbload -d proteus -c ld_badge -e 10 -l badge.log
100 rows loaded to table badge...
200 rows loaded to table badge...
Or, rip this script:
# Drop every table for which there is a flat delimited file.
for F in `ls *.dat`
do
G=`basename $F .dat`
if [ $G != "country" ]; then
sqlstmt "DROP TABLE $G"
fi
done
# Recreate those tables that were just dropped.
driturbo -p base
# Load each table with the contents of the delimited file.
for F in `ls *.dat`
do
G=`basename $F .dat`
dbload -d proteus -c ld_$G -e 10 -l $G.log
if [ ! -s $G.log ]; then
rm -f $G.log
rm -f ld_$G
fi
done
# Manually load the hist_report and report_setup files.
if [ -f hist_report.cba ]; then
cbr -cavd hist_report.cba >/dev/null 2>&1
fi
if [ -f report_setup.cba ]; then
cbr -cavd report_setup.cba >/dev/null 2>&1
fi



