Hi,

the / disk of my bacula (1.38.5) server crashed Friday night. The postgres
db is on a separate disk. I restored the filesystem from a second backup
system. Since I only perform full backups on weekend the db should have
been in a consistent state. But to get some experience with desaster
recovery, I restored the postgres db from my bacula.sql dump file from
last weeks backup (cat bacula.sql | psql bacula) and ran dbcheck with the
fix option.

After that, a backup started from bconsole immediately throws an error
message.

24-Jul 14:11 bacula-dir: SMTCZB0003.2006-07-24_14.11.07 Fatal error:
sql_create.c:85 sql_create.c:85 insert INSERT INTO Job
(Job,Name,Type,Level,JobStatus,SchedTime,JobTDate) VALUES
('SMTCZB0003.2006-07-24_14.11.07','SMTCZB0003','B','F','C','2006-07-24
14:10:29',1153743029) failed:

ERROR:  duplicate key violates unique constraint "job_pkey"



24-Jul 14:11 bacula-dir: sql_create.c:85 INSERT INTO Job
(Job,Name,Type,Level,JobStatus,SchedTime,JobTDate) VALUES
('SMTCZB0003.2006-07-24_14.11.07','SMTCZB0003','B','F','C','2006-07-24
14:10:29',1153743029)

24-Jul 14:11 bacula-dir: SMTCZB0003.2006-07-24_14.11.07 Fatal error:
sql_create.c:87 Create DB Job record INSERT INTO Job
(Job,Name,Type,Level,JobStatus,SchedTime,JobTDate) VALUES
('SMTCZB0003.2006-07-24_14.11.07','SMTCZB0003','B','F','C','2006-07-24
14:10:29',1153743029) failed. ERR=ERROR:  duplicate key violates unique
constraint "job_pkey"




I've now restored the db from the bacula.sql file again but this time with
the whole drop_bacula_tables/make_bacula_tables/grant_bacula_privileges
procedure before. I have not fixed the db with dbcheck. Everything seems
to be fine now, I could start a new backup job (the missed job from the
weekend). But I'm a bit afraid about the state of the db.

This is now the output of dbcheck without the fix option. I don't know if
it is exactly the same output as before. But I think the orphaned
File/Path/Filename numbers are about the same. But this shouldn't be a
problem

Checking for Filenames with a trailing slash
Found 0 bad Filename records.
Checking for Paths without a trailing slash
Found 0 bad Path records.
Checking for duplicate Filename entries.
Found 0 duplicate Filename records.
Checking for duplicate Path entries.
Found 0 duplicate Path records.
Checking for orphaned JobMedia entries.
Found 0 orphaned JobMedia records.
Checking for orphaned File entries. This may take some time!
Found 3 orphaned File records.
Checking for orphaned Path entries. This may take some time!
Found 22877 orphaned Path records.
Checking for orphaned Filename entries. This may take some time!
Found 67673 orphaned Filename records.
Checking for orphaned FileSet entries. This takes some time!
Found 2 orphaned FileSet records.
Checking for orphaned Client entries.
Found 1 orphaned Client records.
Checking for orphaned Job entries.
Found 3 orphaned Job records.
Checking for Admin Job entries.
Found 0 Admin Job records.
Checking for Restore Job entries.
Found 1 Restore Job records.


Could the problem been that I haven't dropped the bacula db before
restoring it from the bacula.sql file?

Ralf


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to