help with back up please

Can anyone please tell me how safe is the following backup script?
Does it really backing up the WHOLE system or just part of it?
I do that with the system running an oracle database.
Will I be able to restore the system in case of a fault?

<pre>
Here is the output of 'df -k'

isgsi01(root)10: df -k
Filesystem kbytes used avail capacity Mounted on
/proc 0 0 0 0% /proc
/dev/dsk/c0t0d0s0 1987399 943500 984278 49% /
fd 0 0 0 0% /dev/fd
/dev/dsk/c0t0d0s3 962571 842773 62044 94% /var
/dev/dsk/c0t0d0s4 962571 675979 228838 75% /home
/dev/dsk/c0t0d0s5 3009327 2065069 884072 71% /u01
/dev/dsk/c0t1d0s0 3009327 2262450 686691 77% /u02
/dev/dsk/c0t1d0s1 3009327 2318909 630232 79% /u03
/dev/dsk/c0t1d0s3 3009327 2939083 10058 100% /u04
swap 2814480 3024 2811456 1% /tmp

Here is the backup script:

mt -f /dev/rmt/0cn rewind
ufsdump 0uf /dev/rmt/0cn /dev/dsk/c0t0d0s0
ufsdump 0uf /dev/rmt/0cn /dev/dsk/c0t0d0s3
ufsdump 0uf /dev/rmt/0cn /dev/dsk/c0t0d0s4
ufsdump 0uf /dev/rmt/0cn /dev/dsk/c0t0d0s5
ufsdump 0uf /dev/rmt/0cn /dev/dsk/c0t1d0s0
ufsdump 0uf /dev/rmt/0cn /dev/dsk/c0t1d0s1
ufsdump 0uf /dev/rmt/0cn /dev/dsk/c0t1d0s3

</pre>
Thanks in advance

Yeah,

but before start the backup, shutdown the oracle database for an offline backup.

regards
Michael

The problem is that I can not shut down the database,
needs to be up 24/7.
I know there are some other utilities for that, but I would like to know if it's a full system back up (0 level)
why when I try to ufsrestore interactivily I only see the / (root)level ?

Thanks

So you have to run the database in archive mode.
See oracle manuels for online backup(backup controlfile, tablespaces, archive files).

If you need more information send me an email
::email removed::

regards

The trailing n in /dev/rmt/0cn means "no rewind". This means that there is no automativ rewind of the tape when the file is closed. So your first statement does an explicit rewind to get the tape at the beginning.

Then the next command backs up root. When it finishes, the tape is left positioned after the root backup.

Then you backup the /usr filesystem. And so on.

So you have several backups on one tape. When you put the tape on and do a ufsrestore, you see only the first backup.

Want to see the second backup? Do:
mt -f /dev/rmt/0cn fsf 1
first. This will skip the first backup and leave you positioned at the second.

Thanks Perderabo,

To make things a bit more clear,
I use:

<pre>

mt -f /dev/rmt/0cn rewind // no rewind, so I have everything in the same dat tape

ufsdump 0uf /dev/rmt/0cn /dev/dsk/c0t0d0s0 //mounted on /
ufsdump 0uf /dev/rmt/0cn /dev/dsk/c0t0d0s3 //mounted on /var

ufsdump 0uf /dev/rmt/0cn /dev/dsk/c0t0d0s4 //mounted on /home

ufsdump 0uf /dev/rmt/0cn /dev/dsk/c0t0d0s5 //mounted on /u01
ufsdump 0uf /dev/rmt/0cn /dev/dsk/c0t1d0s0 //mounted on /u02
ufsdump 0uf /dev/rmt/0cn /dev/dsk/c0t1d0s1 //mounted on /u03

ufsdump 0uf /dev/rmt/0cn /dev/dsk/c0t1d0s3 //mounted on /u04
</pre>

So the above commands back up the root filesystem. When it finishes, the tape is left positioned after the root backup.

How do I backup the rest (inside files). I mean when for instance I backup /var/ does this mean that I back up everything inside the /var directory including all the sub-directories?

So I have several backups on the same tape. When I put the tape on and do a ufsrestore, you see only the first backup.(I suppose I have to rewind the tape before the restore , correct?

"Want to see the second backup? Do:
<pre>
mt -f /dev/rmt/0cn fsf 1
</pre>
first. This will skip the first backup and leave you positioned at the second."
what happens when I do a ufsrestore -i
Am I able to choose ??

Thank you for your help

Hi if you,re using ufsrestore -ivf you got into the first filesystem backed up if you want to see the next one you just type "q" wait for a while and automatically the rmt device got forward the next filesystem.

Information about what filesystem you are step in is displayed at the begining of the next rmt reading so you can read if it is /usr or /var etc

if you're using the same tape for variuos backups then you do not need to rewind the tape if not, rewind it at all and run your script.

Your script is ok BUT if you cant stop DB runing for God's (and you) sake you Must be sure that nobody is logged in even in a telnet session this will avoid garbage in your backup.

Thank you very much for your help guys.
Any other ideas will be appreciated.

1) Yeah ufsdump will get all the files and subdirectories of /var provided that they are all in the same filesystem. If you create a separate mounted volume called /var/adm, well now you have to dump that separately. When you back up root, you get all of /bin and /lib, and so on. But you you still need /usr and /var as separate runs.

2) Yeah, you would need a rewind if you go to the restore immediately after the backup. Usually the restore comes long after the tape has been removed from the drive.

3) Yeah, the -i will let you pick and choose...a very cool feature.

"When you back up root, you get all of /bin and /lib, and so on. But you you still need /usr and /var as separate runs."

Why do I have to do that?

I thought you said that ufsdump takes a snapshot of the sub-directories as well ( on the same file system)

Here is the output of the df -k

<pre>
Filesystem kbytes used avail capacity Mounted on
/proc 0 0 0 0% /proc
/dev/dsk/c0t0d0s0 1987399 935141 992637 49% /
fd 0 0 0 0% /dev/fd
/dev/dsk/c0t0d0s3 962571 667662 237155 74% /var
/dev/dsk/c0t0d0s4 962571 675981 228836 75% /home
/dev/dsk/c0t0d0s5 3009327 2065125 884016 71% /u01
/dev/dsk/c0t1d0s0 3009327 2262450 686691 77% /u02
/dev/dsk/c0t1d0s1 3009327 2318909 630232 79% /u03
/dev/dsk/c0t1d0s3 3009327 2938883 10258 100% /u04
swap 2811408 3296 2808112 1% /tmp
</pre>

Thanks again

We better go back a review filesystems here. When most kernels boot they initialize the system by automatically mounting root and they fire up init and a few other processes. At this point, the only thing mounted is root:
/dev/dsk/c0t0d0s0 1987399 935141 992637 49% /
If you are going into single user mode, it stops here and that is all you see. If you examined /var or /usr you would only have empty directiores since they are not yet mounted. All of the subdirecties and files that we do see are on /dev/dsk/c0t0d0s0.

But we have another disk device called c0t0d0s3 which we can now mount on /var. Once we do that we suddenly see /var/spool spring into existence. But /var/spool is on c0t0d0s3 while /etc/mail is on c0t0d0s0. They may seem to equally situated in some respects, but the difference is important.

Most people also will have a separate /usr filesystem. Looking again, I see that you don't. So I misspoke earlier when I said that you also needed /usr. In your case, you don't. You could possibly configure your system to only have one very large root filesystem...if you did, one ufsdump would do it all.

When you tell ufsdump to save a copy of c0t0d0s0, that is what it does. Sure it will pick up the /var empty directory that root uses as a mount point, but nothing under /var will be there. That's why we need another run of ufsdump to also save a copy of c0t0d0s3.

The 'kernel' and 'init' issues was a good lesson, things that already new. I appreciate the correction though, now everything is clear. You really confused me when you said that I had to backup /usr as well, beacause I have already gave my file systems (partitions)above.
The reason that I didn't use one large file system is only for reduntancy.
Thank you very much for your help.

Aris :=)