- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- tar: how to do backup of one by one file in the ta...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2005 05:38 PM
07-04-2005 05:38 PM
tar: how to do backup of one by one file in the tape ?
alter tablespace SYSTEM begin backup;
!tar cvf /dev/rmt/c3t8d0BEST /sysprod/sysascp/testdata/system11.dbf
alter tablespace SYSTEM end backup;
alter tablespace SYSTEM begin backup;
!tar cvf /dev/rmt/c3t8d0BEST /sysprod/sysascp/testdata/system10.dbf
alter tablespace SYSTEM end backup;
alter tablespace SYSTEM begin backup;
!tar cvf /dev/rmt/c3t8d0BEST /sysprod/sysascp/testdata/system09.dbf
alter tablespace SYSTEM end backup;
alter tablespace SYSTEM begin backup;
!tar cvf /dev/rmt/c3t8d0BEST /sysprod/sysascp/testdata/system08.dbf
alter tablespace SYSTEM end backup;
alter tablespace SYSTEM begin backup;
!tar cvf /dev/rmt/c3t8d0BEST /sysprod/sysascp/testdata/system07.dbf
alter tablespace SYSTEM end backup;
alter tablespace SYSTEM begin backup;
!tar cvf /dev/rmt/c3t8d0BEST /sysprod/sysascp/testdata/system06.dbf
alter tablespace SYSTEM end backup;
This way all files should be backed up in the media.
Pls advise.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2005 06:31 PM
07-04-2005 06:31 PM
Re: tar: how to do backup of one by one file in the tape ?
why don't u tar everything from the directory, /sysprod/sysascp/testdata/?
SQL> !tar -cvf /dev/rmt/c3t8d0BEST /sysprod/sysascp/testdata/
or u may like this in your script:
svrmgrl << EOT
connect as sysdba;
alter tablespace SYSTEM begin backup;
tar -cvf /dev/rmt/c3t8d0BEST /sysprod/sysascp/testdata/
alter tablespace SYSTEM end backup;
quit
EOT
refer to this post for more info:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=600832
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2005 07:06 PM
07-04-2005 07:06 PM
Re: tar: how to do backup of one by one file in the tape ?
I just gave one example only. I have other tablespaces also which should be backed up with this (SYSTEM) tablespace. There are altogether 52 datafiles which should be backed up one by one in the tape. How the script would be then ?
Thanks....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2005 07:47 PM
07-04-2005 07:47 PM
Re: tar: how to do backup of one by one file in the tape ?
You could do this way.
Get the list of all the tablespace names and the datafile names from the view dba_data_files and spool them a list file.
Once you have the list file then cat the list file and
For each line read from the list file
do
# (eg: $TBS_NAME is the variable containing the tablespace name the first column in the list file and $FS_NAME is the datafile name in the second column of the list file)
#Alter tablespace start backup
sqlplus â s <
alter tablespace $TBS_NAME begin backup ;
exit
EOF3
tar -cvf /dev/rmt/c3t8d0BEST /sysprod/sysascp/testdata/$FS_NAME
# Alter tablespace end backup
sqlplus â s <
alter tablespace $TBS_NAME end backup ;
exit
EOF4
do
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2005 08:23 PM
07-04-2005 08:23 PM
Re: tar: how to do backup of one by one file in the tape ?
I would suggest you write the *.dbf paths into a file and use a single "fbackup -g" command.
man fbackup will certainly help
if you use "tar -c" with a "rewind" device file then after each command the tape will be rewound and your next "tar -c" will overwrite the existing tarfile on tape....
you can instead use "tar -u" to add the file to the existing tarfile on tape, or use a no-rewind device file and write several tarfiles on tape. In that case, however, it will be quite difficult to restore since you need to use mt to wind the tape to the n-th tarfile (assuming you alread know that you need the n-th tarfile) to extract it. Also performance will be quite bad in any case you are not using a single tar command.
Regards,
Bernhard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2005 08:34 PM
07-04-2005 08:34 PM
Re: tar: how to do backup of one by one file in the tape ?
Things to remember about tar:
* tar is, for the most part, platform generic (ie: a tar tape created on
a SUN machine can usually be read by an HPUX machine). However, if the
platforms are far removed from each other (ie: SunOS 4.x and HPUX
11.0), then reading the tape may be impossible.
Command Description
tar cvf /dev/rmt/0m /etc/hosts backup one file
tar cvf /dev/rmt/0m (file1) (file2) backup file1 and file2
tar tvf /dev/rmt/0m verify contents of tape
tar xvf /dev/rmt/0m restore entire tape
tar xvf /dev/rmt/0m (file) restore one file
tar tf /dev/rmt/0m | grep swp | xargs restore all files that contain
tar xvf /dev/rmt/0m the string swp
Good Luck,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2005 12:03 AM
07-06-2005 12:03 AM
Re: tar: how to do backup of one by one file in the tape ?
May I add a little remark about tar and sparse file.
tar will certainly copy your datafile on tape, but when you will extract it you will maybe not have enough space to restore it.
Sparse file are often use in Database concept to limit block usage on disk.
A following code explains this concept :
#include
#include
void main()
{
int fd;
int data = 0xdeadbeef;
fd = open("/tmp/sparse", O_WRONLY|O_CREAT|O_TRUNC, 0666);
lseek(fd, 2*1024*1024, SEEK_SET);
write(fd, &data, sizeof(int));
close(fd);
exit(0);
}
$ ll /tmp/sparse
-rw-rw-rw- 1 woof users 2097156 Aug 13 14:13 /tmp/sparse
$ du /tmp/sparse
32 /tmp/sparse
$ xd /tmp/sparse
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
0200000 dead beef
0200004
You can see a difference between spaces used for this file. In datafiles there is a lot of space wich contains no relevant information then lot of space not used. Sparse file uses only disk blocs with usable info.
Conclusion :
For this kind of file fbackup is better !
Only a little stone in this thread
Roland PIETTE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2005 03:23 AM
07-06-2005 03:23 AM
Re: tar: how to do backup of one by one file in the tape ?
See attached file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2005 03:26 AM
07-06-2005 03:26 AM
Re: tar: how to do backup of one by one file in the tape ?
-greg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2005 05:30 AM
07-06-2005 05:30 AM
Re: tar: how to do backup of one by one file in the tape ?
if writing multiple times to the same tape.
Otherwise you end up with one tar file on the tape i.s.o. many.
JP