Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using unix "Tar" as the backup for Informix

Status
Not open for further replies.

retroman

Programmer
Feb 18, 2001
18
0
0
SG
Hi there,
I'm new to administration of Informix Universal Server. I really need precise advice from you ppl out there.

I'm using the normal unix tar compress (all files in the server) as the backup after a data dump (to files) process from all the tables in the database. Will that be suffucient for me to restore back the database if a crash happens? why? I was told that i need to have level 0,1,2 backup together logical files backup, why?

I am having IUS 9.14 running on Irix 6.5. Any informative comments is appreciate.

thanks
 
You don't necessarily need level 1 and 2 backups if you do a level 0 backup every time. Informix can be set up to store its data in either unix ("cooked") files or raw drive space (which is more efficient from Informix's point of view). If you use raw space, the Unix backup will never see the informix data.

You need to backup logical logs to recover transaction that have occurred since the last checkpoint or to be able to rollback your system to a point before problems ocurred.

I'm fairly new as an Informix DBA, but here is what I do:
Backup the logical logs to a unix disk file (you can set the file name as the logical log tape device using onmonitor). Then, backup the Unix system using a level 0 (full backup) with tar or whatever. In addition, do a full backup (level 0) of Informix using ontape -s. Its easier if you have two tape drives (one for Unix and 1 for Informix), but you can do it with one.

I hope this helps.
 
I have a SCO Openserver 5.5 system running Informix Dynamic Server.

I have a script which contains the following lines:-

. /usr/online/bin/setonenv
time=`date`
echo "Backup was started on $time" >> /log/backup.log
ontape -s -L $1 << hit
\n
\n
\n
hit
#tape unload
time=`date`
echo &quot;Backup was finished on $time\n&quot; >> /log/backup.log

This script is then scheduled via crontab to run every morning @ 2am, for some reason this backup doesn't always run so the script is then run manually in the morning when checked.

Is there another way I can backup this Informix data rather than using ONTAPE?

Any help much appreciated.
 
What I'm saying below definitely pertains to you if you are using raw devices for your data. If you are using &quot;cooked&quot; files (or regular Unix files) then it still probably makes sense but since I don't have experience using cooked files I'm not sure:

We also do a level 0 backup nightly. It takes a little longer to do backups but would make restoring much faster. Since users can still use the system during backups and not during restores it makes sense to me to do it this way.

I do not recommend that you use 'tar' to do your backups. You should use the Informix archive utility. I'm using an older version of Informix Dynamic Server and the utility is &quot;ontape&quot;. Not sure if it's changed. By letting Informix do the backup you'll know for sure it's being done correctly. We have never had a problem restoring a backup done from Informix. If you use 'tar' then every time you add a new chunk you need to remember to include it in your 'tar' script. If you use Informix that is all done automatically. In fact I'm not even sure you can do a restore of a database that uses logging if you used 'tar'.

If you do transaction logging then you also have to have all the logs backed up since your last level 0 backup. That's the only way you can restore your database to where it was when it crashed. Otherwise you can only restore it to where it was when you started your last level 0 backup. We do not do logging because losing 1 day of input or less is acceptable. Your needs may be different.
 
You didn't tell me how you store your Informix tables. Are they on raw disk or are they in Unix files?

If they are regular Unix files in a file system then I don't think I can help you.

Jane
 
How do i know whether I'm using the raw device or unix cooked files? I wasn't the one that set up the DB server and the person has left.
 
type: onstat -d

It lists the location of all the database chunks. If it says something like:

/dev/ios/rsdisk00s4
or
/dev/vd/rvdisk5

Then it's a raw disk.

If it says something like:

/home/informix/data/file1

Then it's a regular Unix file.

If you don't know where the data is how can you be backing it up with 'tar'?

If you can post the output of the 'onstat -d' command I should be able to tell.

Have you been to Informix DBA class? If not, then I think you need to tell your employer that you need to go. Being an Informix DBA really requires some formal training. If they don't do that they aren't being fair to you or themselves.

Jane
 
hi Jane,
Thanks for the reply. we are using cooked files for chunks.
I think u misunderstood the tar backup i mentioned.
The backup process is first using &quot;unload...select...&quot; for every table in our DB into a text file. Then, come the tar command to backup of all the regular unix files which include all these text files also. So the dbspace/chunk location is transparent at all.

Btw, thanks for clarify my doubt and it is really nice to meet people like u (experienced DBA) in this forum.


 
Wow, that seems like an awful lot of work for a backup. Of course the good part is you can restore a single table, which you couldn't do if you used Informix to do the backup. However I don't know how you would apply your logical logs if you needed to do a restore.

As I said I don't have any experience with Dynamic Server and cooked files.

You might want to do a practice backup and restore on a test machine if you have one available just to be sure it will work the way you hope.

Jane
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top