Computing.Net > Forums > Unix > tar and extract contain from tape.

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

tar and extract contain from tape.

Reply to Message Icon

Original Message
Name: vicchai
Date: August 5, 2005 at 20:21:57 Pacific
Subject: tar and extract contain from tape.
OS: HP-UX
CPU/Ram: NIL
Comment:

Hi all,

I have a script doing backup everyday, it look like this:

svrmgrl <<EOF
!rm /backup/log/daily_backup.backup
alter database backup controlfile to
'/backup/log/daily_backup.backup';
!tar -cvf /dev/rmt/0mn /backup/log/daily_backup.backup
alter tablespace ACN begin backup;
!tar -cvf /dev/rmt/0mn /acn/log/*.dbf
!tar -cvf /dev/rmt/0mn /var/log/acn/*.log
alter tablespace ACN end backup;
alter tablespace SAL begin backup;
!tar -cvf /dev/rmt/0mn /sal/log/*.dbf
!tar -cvf /dev/rmt/0mn /var/log/sal/*.log
alter tablespace SAL end backup;
EOF
mt -t /dev/rmt/0m offline

Now me question are:
1. How to list the contain of the tape by should of tarring method?
2. How to extract one of the file from the tape?
3. What dose those with a "alter" lines means?
4. What are those "!" for?
5. Why all are cvf? Why not using rvf?

Thanks for any reply.



Report Offensive Message For Removal


Response Number 1
Name: Luke Chi
Date: August 6, 2005 at 11:09:07 Pacific
Reply: (edit)

1. How to list the contain of the tape by should of tarring method?
===> tar tvf <tape device>

2. How to extract one of the file from the tape?
===> tar xvf <tape device> <the file wanted to be extarcted>

3. What dose those with a "alter" lines means?
===> Your whole scriprt runs in Oracle svrmgrl. Alter tablespace is an Oracle SQL command.

4. What are those "!" for?
===> To run an OS command from Oracle SQL(like svrmgrl or SQLPLUS), "!" at the beginning of the line is needed.

5. Why all are cvf? Why not using rvf?
===> r: Add the named file to the end of the archive.
c: Create a new archive.

Luke Chi


Report Offensive Follow Up For Removal

Response Number 2
Name: vicchai
Date: August 6, 2005 at 23:31:11 Pacific
Reply: (edit)

Thanks for the reply Luke Chi,

Q1. When I use tar tvf /dev/rmt/0m, it only show the first section of the file in that tape, for my case is /backup/log/daily_backup.backup, it can't list all the files in that tape.

Q5. When using cvf, it create a new archive, it means it will over write all files already in that tape, so in my script, all are using cvf, when the backup finished, it only left the last file in that tape which is wrong. Am I right?

Please advise. Thanks.


Report Offensive Follow Up For Removal

Response Number 3
Name: Jim Boothe
Date: August 8, 2005 at 06:54:32 Pacific
Reply: (edit)

Regarding the alter tablespace begin/end backup ...

You have to tell the Oracle rdbms that you are about to use an OS utility to make a backup copy of running (hot) database files. This causes the rdbm to write entire block images to the redolog instead of block fragments. If it did not do this, the OS utility could end up copying an inconsistent (fractured) block. It would be simpler (code-wise) to put all the tablespaces in hot backup mode, then copy all the files, then take all tablespaces out of hot backup mode. But this would place ALL tablespaces in hot backup mode for the entire duration of the copies, which could generate a huge amount of redo due to the full block images being journaled.

So your script is taking the recommended approach of placing only a single tablespace at a time in hot backup mode.

But a much more sophisticated approach is to use Oracle's Recovery Manager (RMAN), which comes bundled with the rdbms. You can schedule full and incremental backups, and it does these while the database is running. But it does not place the tablespaces in hot backup mode - it does not have to because it is knowledgeable of database block structure, and if it grabs an inconsistent block due to bad timing, it knows it so it just reads the block again. And RMAN backs up only in-use blocks, so a 30 GB database backup might consume only 18 GB. RMAN creates its backups files to disk, and I don't know what you get with Standard Edition, but the Enterprise Edition has tight integration with 3rd-party backup software such as Veritas.

And RMAN is very solid beginning Oracle 9i.


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 2 Days.
Discuss in The Lounge
Poll History




Data Recovery Software