Operating System - HP-UX
1752777 Members
6335 Online
108789 Solutions
New Discussion юеВ

Re: How to restore one file from Ignite.

 
SOLVED
Go to solution
Silver_1
Regular Advisor

How to restore one file from Ignite.

All,

Need to restore the cron file for oracle (user) to a file and need to send it to the DBA's.

I have last weeks ignite tape.

I was knowing the command but i forgot.

Any help is appeciated.

Tx
7 REPLIES 7
Mel Burslan
Honored Contributor

Re: How to restore one file from Ignite.

ignite image is a tar archive at the end, if you used the default option for the format. If this is the case,

cd /tmp
tar -xvf /dev/0m /var/spool/cron/crontabs/oracle

provided your tape drive's device path is /dev/0m and your crontabs are located at this location. If anything is different, adjust according to your specific situation.
________________________________
UNIX because I majored in cryptology...
erics_1
Honored Contributor
Solution

Re: How to restore one file from Ignite.

For future reference, the info is in the manpage for make_tape_recovery

mt -t /dev/rmt/0mn fsf 1
tar -xvf /dev/rmt/0m filename

Make sure to omit the leading / when specifying 'filename'.

Regards,
Eric
Mel Burslan
Honored Contributor

Re: How to restore one file from Ignite.

Beware, since there is a very high probabilty that this activity will write over oracle's existing crontab, better if you make a backup copy of the current crontab file.
________________________________
UNIX because I majored in cryptology...
Tim Nelson
Honored Contributor

Re: How to restore one file from Ignite.

Mel and Eric have nailed this on the head.
Have done individual file restores from Ignite tape many times.

mt -t tapen fsf 1 ( to forward past the LIF on tape, don't forget to use the no-rewind device)

tar xvf tape file to restore

Once past the LIF info you can do a "tar vtf tape" to list the contents just to be sure. Do not forget to rewind and fsf again to do the restore.


Tom Danzig
Honored Contributor

Re: How to restore one file from Ignite.

FYI, the files on the ignite tape are archive using relative pathnames. i.e.

var/spool/cron/crontabs/username

There is no leading slash so there is no fear of overwriting the existing file as long as you are not in the root (/) directory.
Bill Hassell
Honored Contributor

Re: How to restore one file from Ignite.

And a note for tar: it does an *EXACT* match on the filename as stored on the tape. So using /var/spool/cron/crontabs/username will fail. Your filename must match the entire name on the tape as in:

tar xvf /dev/rmt/0mnb var/spool/cron/crontabs/username

NOTE: ALWAYS use the Berkeley no-rewind device file. The default device file 0m will nullify any mt tape positioning commands. See man mt


Bill Hassell, sysadmin
Silver_1
Regular Advisor

Re: How to restore one file from Ignite.

All,

Given the following commands.
cd /tmp
mt -f /dev/rmt/0mn rew
mt -f /dev/rmt/0mn fsf 1
tar xvf /dev/rmt/0mn var/spool/cron/crontabs/oracle

the file was restored to /tmp.

Tx for all your help.