Recovering logfile in Informix SE
Posted in 2000
Topics: General Discussion
Does anybody know how to recover data from a logfile of an Informix SE database. I cannot find anything about it in the informix manuals I have . The only thing we found is the selog command which shows the content of a logfile , but seems to have no option to get data back into a table or ascii-file Thanks for help Jan Leyssens
"Gery.Laeremans@village.uunet.be" wrote:
> Does anybody know how to recover data from a logfile of an Informix SE
> database.
ROLLFORWARD DATABASE dbname; -- Instead of DATABASE dbname
> I cannot find anything about it in the informix manuals I have .
>
> The only thing we found is the selog command which shows the content of
> a logfile, but seems to have no option to get data back into a table or
> ascii-file
The intention behind ROLLFORWARD DATABASE is that you:
1. Recover the database from archives to the state when the logical log
file was last truncated to zero length.
2. Run the ROLLFORWARD DATABASE command to replay the completed
transactions in the logical log.
This means that when you backup the database, you should also truncate
the transaction log. In between backups of the database, backing up
the transaction log should be sufficient.
--
Yours,
Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h>
Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN
"I don't suffer from insanity; I enjoy every minute of it!"
Sample session:
$ sqlcmd5SQL[1729]: create database torrid with log in
"/work/jleffler/tmp/junk/torrid.log";
SQL[1730]: create table samizdat (id serial(1000) not null, data
char(100) not null);
SQL[1731]: begin work;
SQL[1732]: insert into samizdat values(0, "Mikhail Gorbachev");
SQL[1733]: insert into samizdat values(0, "Perestroika");
SQL[1734]: insert into samizdat values(0, "Lech Walesa");
SQL[1735]: commit work;
SQL[1736]: select * from samizdat;
1000|Mikhail Gorbachev
1001|Perestroika
1002|Lech Walesa
SQL[1737]: !cp -rp torrid.dbs backup.dbs
SQL[1738]: !ls -l
total 12
drwxrwx--- 2 jleffler cmkt 1536 Nov 28 16:36 backup.dbs
drwxrwx--- 2 jleffler informix 1536 Nov 28 16:36 torrid.dbs
-rw-rw---- 1 jleffler informix 1536 Nov 28 16:37 torrid.log
SQL[1739]: !cp /dev/null torrid.log
SQL[1740]: insert into samizdat values(0, "Poland");
SQL[1741]: insert into samizdat values(0, "Russia");
SQL[1742]: !ls -l
total 10
drwxrwx--- 2 jleffler cmkt 1536 Nov 28 16:36 backup.dbs
drwxrwx--- 2 jleffler informix 1536 Nov 28 16:36 torrid.dbs
-rw-rw---- 1 jleffler informix 580 Nov 28 16:39 torrid.log
SQL[1743]: close database;
SQL[1744]: !mv torrid.dbs outoftheway.dbs
SQL[1745]: !mv backup.dbs torrid.dbs
SQL[1746]: rollforward database torrid;
SQL[1747]: select * from samizdat;
1000|Mikhail Gorbachev
1001|Perestroika
1002|Lech Walesa
1003|Poland
1004|Russia
SQL[1748]: exit
$