Operating System - HP-UX
1833062 Members
3020 Online
110049 Solutions
New Discussion

Backup Oracle home software with "cp" command.

 
Gulam Mohiuddin
Regular Advisor

Backup Oracle home software with "cp" command.

I need to backup complete Oracle Home software binaries (No database or data files).

Oracle recommends using tar or cpio commands for eample:
$tar -cf - . | (cd /u01/Disk1; tar -xpvf - )

But, can I simply use UNIX “cp” command and copy complete Oracle Home mount point instaed?

In this case what’s difference using cp command compared to using tar or cpio.

Thanks,

G
Everyday Learning.
6 REPLIES 6
Fred Ruffet
Honored Contributor

Re: Backup Oracle home software with "cp" command.

tar and cpio are preserving ownership and rights on file and directories.

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
A. Clay Stephenson
Acclaimed Contributor

Re: Backup Oracle home software with "cp" command.

A vanilla copy will lose the setuid/setgid ownership/group settings. A cp -p will help but you will be far better off using using either cpio or tar. Sometimes, it does make sense to follow the vendor's instructions.
If it ain't broke, I can fix that.
Jean-Luc Oudart
Honored Contributor

Re: Backup Oracle home software with "cp" command.

Gulam,

for a full mount point I would use cpio. I would use cp only for a selection of files usually within same directory.

man cpio

Regards
Jean-Luc
fiat lux
Yogeeraj_1
Honored Contributor

Re: Backup Oracle home software with "cp" command.

hi,

doing 'cp -p -R / should be ok. (preferrably as "root" user)

regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Mic V.
Esteemed Contributor

Re: Backup Oracle home software with "cp" command.

I also recommend using tar rather than cp. It may no longer be true, but it seems to me that once upon a time, tar gave better error handling than cp.

cp won't give you an indication of how far it's gotten. The "v" in the syntax above will print out each filename as it's processed and you have an idea where things stand. I also seem to recall that errors can pop up from a cp command without any indication about where the command was in the filesystem when the error happened; not so with tar because of the v (I basically don't use cp like this much any more).

The tar syntax recommended by Oracle is a useful tip to keep in mind.
What kind of a name is 'Wolverine'?
twang
Honored Contributor

Re: Backup Oracle home software with "cp" command.

I prefer 'cpio', but of course you may use cp, for instance,
# cd/u01/app
# cp -rp ora92olap ora92bak