The Relook database file stored in /var/db.dat or /var/data/db.dat on hard disk machines. It is an SQL database file and sqlite3 (http://www.sqlite.org) is used to maintain this file.
PCEditor by Jon Doe is a great utility for manipulating this file and normally will be used to make any changes required. This article attempts to give some of the underlying basics of SQL.
Sqlite can be used either on the Windows PC or directly on the Relook to inspect and update a database file.
On the Windows PC:
1) Find the file sqlite3.exe which is in the bin folder of PCEditor and copy this file to a new folder for testing.
2) Copy a db.dat file into this folder.
3) Run cmd from the start bar and cd to the folder.
4) To start Sqlite the command is: sqlite3 db.dat
SQLite version 3.2.8
Enter ".help" for instructions
sqlite>
On the Relook: (by the way - if you are going to play with your database on the Relook, back it up first !)
1) Telnet to the Relook as: telnet 192.168.1.10 (use your ip address) and login as user=root and password = relook (usually)
2) cd /var/data
3) To start Sqlite, the command is the same: sqlite3 db.dat
SQLite version 3.3.8
Enter ".help" for instructions
sqlite>
Entering .help will list the meta commands available. These are commands which control the sqlite processor and not the database commands. These meta commands all start with "." There are three important meta commands. .exit will quit the sqlite3 processor and save the database and any changes made. .tables will show the database tables.
sqlite> .tables
CamInfo HistoryInfo OptionInfo UserOption
ChannelInfo LNBInfo SATInfo bookmark_info
EpgMap MasterCode SDTInfo deleted_media_info
FAVGRPInfo NITEpgInfo ScheduleInfo media_info
FAVListInfo NITInfo ScrambleInfo options
.schema will show the database layout of all the tables in the loaded database.
sqlite> .schema
CREATE TABLE CamInfo ( CAM_ID int,
CAM_Name char(32),
CAM_Type int
);
CREATE TABLE ChannelInfo ( CH_ID int primary key,
ch_seq int,
Name varchar(16),
NIT_ID int,
PG_ID int,
SAT_ID int,
CAS_Type int,
Media_Mode int,
Video_PID int,
Audio_PID int,
PCR_PID int,
PMT_PID int,
pch_id int,
tuner_id int,
audio_mode int,
Lock int,
Hide int,
Day int,
ch_order int,
SDT_ID int,
epg_mode int
);
(this is the first two table definitions) . . .