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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ufsdump solution 1

Status
Not open for further replies.

cnull

MIS
Oct 30, 2003
56
US
So I have been given the responsability of administrating all of our Solaris servers(7 for now). I have built a few RH boxes and AIX(over 8 years ago), butI have very little knowledge of Solaris 10. I have training scheduled for August! But until then...

I need to backup a server ASAP. This is my plan, please tell me if I am on the right track or I should rethink the whole thing. Just keep in mind that I do not have any TLS or software(i.e. Netbackup) curretly at my disposal. What I have is a lot of SAN space to save backups on.

FYI this is an Oracle Server 10g with a running Database.
df -h looks like this:
/dev/dsk/c1t0d0s0 15G 66M 15G 1% /
/devices 0K 0K 0K 0% /devices
ctfs 0K 0K 0K 0% /system/contract
proc 0K 0K 0K 0% /proc
mnttab 0K 0K 0K 0% /etc/mnttab
swap 4.4G 960K 4.4G 1% /etc/svc/volatile
objfs 0K 0K 0K 0% /system/object
/dev/dsk/c1t0d0s3 29G 4.8G 24G 17% /usr
/platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1 15G 66M 15G 1% /platform/sun4u-us3/lib/libc_psr.so.1
/platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1 15G 66M 15G 1% /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1
fd 0K 0K 0K 0% /dev/fd
/dev/dsk/c1t0d0s5 4.8G 2.1G 2.7G 44% /var
swap 4.4G 552K 4.4G 1% /tmp
swap 4.4G 80K 4.4G 1% /var/run
/dev/dsk/c4t1d0s0 295G 29G 264G 10% /ora2
/dev/dsk/c1t0d0s4 4.8G 83M 4.7G 2% /opt
/dev/dsk/c1t1d0s7 67G 22G 44G 34% /ora1
/dev/dsk/c4t1d0s1 20G 35M 19G 1% /ora3
/dev/dsk/c4t1d0s2 603G 57G 539G 10% /ora4
/dev/dsk/c1t0d0s7 8.7G 6.0G 2.5G 71% /export/home


So I go into Single User Mode by typing "init S"
then I run the following commands...

/usr/sbin/ufsdump 0uf /ora4/backups/Backups_(DATE)/root.backup /
/usr/sbin/ufsdump 0uf /ora4/backups/Backups_(DATE)/usr.backup /usr
/usr/sbin/ufsdump 0uf /ora4/backups/Backups_(DATE)/var.backup /var
/usr/sbin/ufsdump 0uf /ora4/backups/Backups_(DATE)/opt.backup /opt
/usr/sbin/ufsdump 0uf /ora4/backups/Backups_(DATE)/export_home.backup /export/home
/usr/sbin/ufsdump 0uf /ora4/backups/Backups_(DATE)/oradsd.backup /oradsd
/usr/sbin/ufsdump 0uf /ora4/backups/Backups_(DATE)/ora1_shared.backup /ora1/shared

Then to bring it all back up I run "init 6"

Please tell methisis okay and I won't screw it all up, because to be honest I already started. LOL


Thanks,
cnull
 
oh one last thing. I figured that since I am dumping to multiple files that I should gzip the files that I am dumping to reduce the drive space used?

I run grep /ora4/backups/Backups_3_24_2007/*

Does that make sense or is there some better solution? (tar?)

thanks,
cnull
 
Looks fine to me.

The fact that you are dumping to multiple files is irrelevant, the data would still take up the same amount of space regardless of whether it was in one file or many.

I presume you meant to type gzip /ora4/backups/Backups_3_24_2007/*? That would compress them all fine, into separate files, e.g. root.backup.gz, usr.backup.gz, etc. You could tar them as well to join them together, but there's no need.

Annihilannic.
 
Although I see no oradsd filesystem in that df listing, so why do you need to back that up separately? I'm presuming you're ignoring ora1-4 because they are backed up using Oracle RMan or similar.

Annihilannic.
 
Annihilannic,
Thanks for the confirmation.... yeah I ment gzip not grep and I removed the oradsd(it was a duplicate). I used the following script:

#! /bin/ksh
## This is the FULL backup script for DSDM33
## Written by Chris Null 03/22/2007
##file name example… /ora4/backups/Backup32407/root.backup

mkdir Backup$(date +%m%d%y)
/usr/sbin/ufsdump 0uf /ora4/backups/Backup$(date +%m%d%y)/root.backup /
/usr/sbin/ufsdump 0uf /ora4/backups/Backup$(date +%m%d%y)/usr.backup /usr
/usr/sbin/ufsdump 0uf /ora4/backups/Backup$(date +%m%d%y)/var.backup /var
/usr/sbin/ufsdump 0uf /ora4/backups/Backup$(date +%m%d%y)/opt.backup /opt
/usr/sbin/ufsdump 0uf /ora4/backups/Backup$(date +%m%d%y)/export_home.backup /export/home
/usr/sbin/ufsdump 0uf /ora4/backups/Backup$(date +%m%d%y)/ora1_shared.backup /ora1/shared

tar cvf /ora4/backups/FullBackup$(date +%m%d%y).tar /ora4/backups/Backup$(date +%m%d%y)
gzip /ora4/backups/FullBackup$(date +%m%d%y).tar

### Script complete


Also I don't like re-using the date command over and over. I need to set it to a variable in case the process goes over into another day.

Thanks again!
It is nice to just run these things by someone else sometimes.

cnull

 
You can change the last line to:

Code:
tar cvf - /ora4/backups/Backup$(date +%m%d%y) | 
gzip -c > /ora4/backups/FullBackup$(date +%m%d%y).tar.gz

That would do the tar and gzip in one step.


Annihilannic.
 
I use fssnap for snapshot del file system without unmounting or run at level S.
Then I run ufsdup level 0 if i want a full backup.
level 1,2,3 ... if i want an incremental backup

Hi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top