Operating System - HP-UX
1752280 Members
4954 Online
108786 Solutions
New Discussion юеВ

Re: rsync and Oracle database files

 
Kevin Liquori_1
Regular Advisor

rsync and Oracle database files

Does anyone know if rsync can be used to refresh Oracle database files? Say I want to refresh my development environment with the data from production.

thanks

...Kevin
6 REPLIES 6
Jeff_Traigle
Honored Contributor

Re: rsync and Oracle database files

I would say it can only if the database was down when the sync occurred. It wouldn't be any different than using cp or any other method of copying the files at the OS level for a cold backup and restoring from those. Control files and all would need to be replaced.
--
Jeff Traigle
Geoff Wild
Honored Contributor

Re: rsync and Oracle database files

DB would have to be down - on both ends.

It would be better to refresh DEV from your tape backups - that way you kill 2 birds with 1 stone.

1 - refresh DEV
2 - test your backup/restore procedure

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
A. Clay Stephenson
Acclaimed Contributor

Re: rsync and Oracle database files

If you have OnlineJFS then I would do it this way:

1) Shutdown the production database.
2) Create snapshot vxfs mounts of all the Oracle filesystems. (This takes only seconds per filesystem).
3) Restart the production database
4) Rsync your files.
5) Unmount the snapshot mounts.

You will probably need to rename your directories on the test environment to their production counterparts (e.g. /snap_u01 becomes /u01).

In any event your database will need to be down when the rsync is done but doing a snapshot mount means that you can do this with as little as 2 minutes of production downtime. This does assume that you have already created the snapshot buffer raw volumes for each filesystem before downing the database.
If it ain't broke, I can fix that.
Jean-Luc Oudart
Honored Contributor

Re: rsync and Oracle database files

Kevin,

if the database can be shutdown (for cold backup, etc...) I believe you can use this method.

Otherwise, you must use RMAN.

cf. http://www.oracle.com/technology/deploy/availability/htdocs/RMAN_Overview.htm

Regards
Jean-Luc
fiat lux
Indira Aramandla
Honored Contributor

Re: rsync and Oracle database files

Hi Kevin,

As others mentioned, if you can afford to have down time for the database then use this method.

But if you have tape backups or disk backup on a different location, then you can just copy from the disk backup or restore from the tape backup to your DEV server.

This will test your backup/restore procedures as Geoff mentioned.

The third oprion for you DEV database refresh is if your database is not very large, then use the logical export and then inport into you dev database. This will tkae more time then the obove options.


IA
Never give up, Keep Trying

Re: rsync and Oracle database files

If the goal is to refresh dev/test environments with prod data, I'd use RMAN and use the duplicate database functionality.

hth
/M