rawsync, rsync for database on raw devices

Links: http://www.dbatools.net/mytools/rsync_for_raw_devices.html

    I took few hours to make some changes to rsync's source code, to fit for copy contents in raw devices to remote host's raw devices. I am an Oracle DBA, and some of our databases are using raw devices for stability and fast performance. When we were building standbys & dataguards in remote data center, I found we need a rsync for raw devices. -- rawsync

    Supposed that we have local server and remote server, and have some soft links created for an Oracle databases.

ln -s /opt/oracle/oradata/system01.dbf /dev/rsystem01
ln -s /opt/oracle/oradata/undo01.dbf /dev/rundo01
ln -s /opt/oracle/oradata/users01.dbf /dev/rusers01
ln -s /opt/oracle/oradata/users02.dbf /dev/rusers02
......

    Now we need to copy this file to remote server to create a remote standby for local Oracle database. With rawsync, I just stop the Oracle database on local server (if possible), and run the following command.

1, create the soft links on remote server.
2, rawsync -az /opt/oracle/oradata/*.dbf remotesrv:/opt/oracle/oradata/

    The "-z" option of rsync and rawsync can greatly improve the transfer spped under low network bandwidth. The most important is that we can write a script easily and robustly to build the remote standby automatically, even for very busy or large databases.

1, Install Oracle on standby, and get the storage ready.
2, Create a standby parameter file and start the instance.
3, Create a standby controlfile and mount the standby intance.
4, Configure the log_archive_dest_* parameters to transfer the archive logs.
5, Offline drop all the data files on standby.
6, Copy some files out to temporary space on primary with rman.
7, Transfer these files to standby host with rawsync.
8, Online transfered data files on standby.
9, Recover standby database to save archive log space
10, Stop standby recovery, turn to step 6 until all datafiles done.

    With Perl or even shell, we can write the script. But I haven't time to write it recently.

Comments (1)

Still have some problems to read from raw devices, because rsync have to know the file size before transfer, but I did not know how to get the raw device size.

Post a comment

« Previous | Main | Next »

Powered by
Movable Type 3.36