- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Copying Oracle database
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
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
09-16-2005 05:39 AM
09-16-2005 05:39 AM
Just found out that our DBA's don't trust cpio to make a backup copy of the DB.
I need to know the BEST method of copy an Oracle database. Either using tar / cpio or some other utility.
Also if anyone can verify there are issues with using cpio to copy and Oracle I'd like to know why. Just for my own sanity check.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2005 05:41 AM
09-16-2005 05:41 AM
Re: Copying Oracle database
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2005 05:50 AM
09-16-2005 05:50 AM
Re: Copying Oracle database
Question, if the DBAs do not trust cpio for backups, what do you use for backups?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2005 05:58 AM
09-16-2005 05:58 AM
Re: Copying Oracle database
Are you moving to another server? Same Server, and just building a new database before the upgrade?
I really like (and have used to clone Oracle databases) using:
cd /sourcedrive/oradata/OLDINSTNAME
find . | cpio pdmvu /targetrive/oradata/NEWINSTNAME
And I like it becuase it keeps file and dir permissions and ownerships correct - saving a lot of work and worry after the copy. Not so much for db files (b/c you can fix them all at once fell swoop if the dir names are organized consistently, but for ORACLE_HOMEs and APPL_TOPs, etc.
You can also use tar:
cd /sourcedrive/oradata/OLDINSTNAME
tar cvf - . | (cd /destdrive/oradata/NEWINSTNAME; tar xvf - )
The problem gets into whether or not you have files that are over 2G in size. Some tools fail with files larger than this. I'm not sure which ones b/c I don't have any that large.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2005 06:01 AM
09-16-2005 06:01 AM
Re: Copying Oracle database
We do a snapshot of the disk to separate SAN disk.
Then we take that snapshot and mount it on a separate server. Then we bring up the copy of the database on that server. Once the database is verified we fracture the LUNs from that server and mount them to our backup server. The snapshot is then copied to tape.
This method is nice because the snapshot and verification takes 15 minutes. And then we can bring up our production environment and continue working while the snapshot is backed up to tape.
So you're probably wondering why I'm asking about cpio? The answer is that this will be our 2nd level backup. Yet another level of redundancy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2005 06:06 AM
09-16-2005 06:06 AM
Re: Copying Oracle database
As long as the database is closed, your choices of copy are fairly broad. I have used 'cpio' with Oracle datafiles to move them from one logical volume to another without any problem. You could use 'tar' or 'fbackup' either piped from one filesystem to another or (of course) to tape.
The only "copy" mechanism that I would *not* use would be 'cp' since it will expand (pad with zeros) any sparse Oracle files.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2005 06:11 AM
09-16-2005 06:11 AM
Re: Copying Oracle database
Our DBAs use RMAN to copy database files. Very high rate of data transfer with parallel streams and compression, etc.
Here is simple script for copying files:
A. On different systems:
cd $sourcedir
find . -xdev -depth | cpio -ocax | \
remsh $destcpu "cd $destdir ; cpio -icduxm"
B. On the same system:
1. cd /dir
find . -depth -xdev -print | cpio -pdum /newdir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2005 06:23 AM
09-16-2005 06:23 AM
Re: Copying Oracle database
Whereas "fbackup and frecover" has more file checking.
Any comments out there on this thought?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2005 06:34 AM
09-16-2005 06:34 AM
Re: Copying Oracle database
You can use tar as well,
1. shutdown oracle
# /sbin/init.d/oracle stop
# cd $ORACLE_HOME
# tar -cvf /dev/rmt/0m *
Also you need to copy the other oracle configuration files as well ,
/etc/oratab etc.
I have done that many times , with Oracle Workgroup server ,and restored successfully.
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2005 06:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2005 06:43 AM
09-16-2005 06:43 AM
Re: Copying Oracle database
Do you happen to have the version number for cpio/tar which handle files > 2 Gb?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2005 07:01 AM
09-16-2005 07:01 AM
Re: Copying Oracle database
Which version of hp-ux do you have , is it 11.00 or 11.11.
If you are having B.11.11 and tar cumulative patch installed it will support larger than 2GB file size.
You can check with this :
# what /usr/bin/tar
/usr/bin/tar:
tar.c $Date: 2003/05/19 02:55:16 $Revision: r11.11/6 PATCH_11.11 (PHCO_28992)
$Revision: @(#) all CUP11.11_BL2003_0522_1 PATCH_11.11 PHCO_28992
Thu May 22 03:24:02 PDT 2003 $
This will enable you to backup larger than 2GB and upto 8GB ,
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2005 07:17 AM
09-16-2005 07:17 AM
Re: Copying Oracle database
Well, as far as 'cpio' goes, it will *not* always preserve the "sparseness" of files. I guess I never evalulated the number of blocks allocated after using it and crossing mountpoints!
It turns out that if you are copying files with 'cpio' between directories that reside in the same filesystem, *and* you use the '-l' option to tell 'cpio' to relink files whenever possible, then "sparseness" is preserved. If you cross mountpoints, however, padding occurs.
If this is an issue for you, I suggest you use 'fbackup' like this:
# cd /srcdir
# fbackup -i . -f - | (cd /dstdir; frecover -Xsrf -)
Be sure to include the '-s' option of 'frecover'.
Too, 'fbackup' & 'frecover' handle files larger than 2GB.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2005 07:21 AM
09-16-2005 07:21 AM
Re: Copying Oracle database
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2005 08:03 AM
09-16-2005 08:03 AM
Re: Copying Oracle database
I think we'll stay with our current cpio method. As I discovered that early this year when they had the cpio backup fail that the backup was run at the same time as the regular tape backup.
So most likely files were open for the tape backup when the cpio > file backup was run. cpio wouldn't know files were open and would have backed up garbage right?
Of course if I discover we have files > 2Gb we'll switch to tar since we don't have the current version of cpio which supports files > 2 Gb.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2005 08:31 AM
09-16-2005 08:31 AM
Re: Copying Oracle database
You are having hp-ux 11.11 , with latest tar , so seems no problem.
---
Though if you feel file is larger than 8GB support required, you can try with gtar .
Although tar is supplied with HP-UX, gtar has more options and handles absolute paths as relative paths, restores the original dates of directories when extracting and also supports large file systems. The gettext and libiconv packages should be installed first, prior to installing tar.
Here is the link: [need to install 1, then 2 , then 3. ]
1. http://gatekeep.cs.utah.edu/hppd/hpux/Gnu/gettext-0.14.5/
2. http://gatekeep.cs.utah.edu/hppd/hpux/Development/Libraries/libiconv-1.10/
3. http://gatekeep.cs.utah.edu/hppd/hpux/Gnu/tar-1.15.1/
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2005 09:41 AM
09-16-2005 09:41 AM
Re: Copying Oracle database
Once database instances are not running you can treat it like a set of plain files and archive it using any preferred way. Another method of backing ORACLE it putting tablespaces in backup mode one by one. Check oraback.sh on google for free tool that are using this method. However database media recovery might be tricky in that case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2005 12:40 PM
09-16-2005 12:40 PM
Re: Copying Oracle database
Neither cpio nor tar (or pax or dump, etc) have data integrity features. Like most classic Unix tools, they rely solely on the hardware and driver to do the right thing and they terminate if an error is returned from the driver. In that case, your DBAs are correct.
As far as sparse files, no general backup program can 'see' sparse files, much less preserve their exact layout. A sparse file is created with holes but Unix always 'fills' in the holes with zeros when the file is read serially (like a backup). Even fbackup cannot determine where a file may be sparse versus filled with zeros. The -s option in frecover simply looks for a string of zeros and lseeks over to the next non-zero record. This will approximate the original file and in all cases (expanded or sparse), the file will be the same to Oracle (and sum/cksum values).
As fr as reliability, fbackup/frecover are by far the best choice for data reliability and versatility. They will handle any sized file, creates a program-generated checksum on tape, provide re-sync ability for bad spots on a tape, handles multi-tape backups and has a central index of all files on every tape. Even when used in a pipe, fbackup is much faster than cpio/tar as it starts multiple file readers that work in parallel and store their data records in shared memory to keep fbackup running at full speed.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2005 12:56 AM
09-21-2005 12:56 AM
Re: Copying Oracle database
Here's a nice article on Oracle Metalink howto clone a database on windows using RMAN:
http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=228257.1
In case you do not have an acount on metalink, see the attachment.
Hope that helps,
Renarios
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2005 01:30 AM
09-21-2005 01:30 AM
Re: Copying Oracle database
I think you make a mistake.
The highest oracle version is 10.x
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2005 02:23 AM
09-21-2005 02:23 AM
Re: Copying Oracle database
Our upgrade went well and thankfully we didn't need to recover from backup.
But we did end up using cpio. With all the information everyone provided we did a few extra checks to do as much integrity checking as possible. (File counts, block counts etc.)