Operating System - HP-UX
1753477 Members
4657 Online
108794 Solutions
New Discussion юеВ

Re: Oracle standby database

 
SOLVED
Go to solution
Tilak Gamalath
Occasional Contributor

Oracle standby database

I want to create a standby database of the primary database. My problem is that the primary database uses raw volumes. (uncooked). I want the standby database to be on UFS. Have someone done this? Please help.
4 REPLIES 4
Ian Dennison_1
Honored Contributor

Re: Oracle standby database

Tilak,

The more differences between a production and standby system, the more chance there is for problems.

Unless raw volumes is unsupported or unworkable on the standby server, I would stick to the same standard as the production server.

Share and Enjoy! Ian
Building a dumber user
Tilak Gamalath
Occasional Contributor

Re: Oracle standby database

Thanks Ian,

is it still a possibility? If so, how do you do that? How do you convert datafiles from raw to ufs for the standby database.

Yogeeraj_1
Honored Contributor
Solution

Re: Oracle standby database

hi,

It is possible to move from raw volumes to filesystems by using "dd" command.

You can do this by just copying the number of oracle blocks(oracle block used by raw device datafile).
The count parameter will take care of actual size of datafile.

These are the following steps to move from raw volumes to filesystems :

STEP-1 :
What is the value of "db_block_size".
===================================================
show parameter db_block_size
output like:
NAME TYPE VALUE
------------------------------------ ------- ------------------
db_block_size integer 8192


STEP-2 :
Find out how many oracle block used by raw device datafile.
====================================================================
select name,blocks from v$datafile;

Output like:
NAME BLOCKS
---------------------------------------------------- ----------
/dev/rVc1.jv.816sys1 30592

Note: The oracle datafilesize always = Number of oracle blocks + 1 File Header Block
The size of file header block is same as oracle block size.

So, Your new filesystem datafile size should be like below:
/dev/rVc1.jv.816sys1 = 30592 +1 = 30593 Blocks =30593*8K in KB as the block size is 8K.

STEP-3:
Now you are in a position to configure your dd command to copy the exact portion of the raw device to filesystem datafile.
==========================================================================================================================
So you know how many bytes you have to copy. Lets build the dd command.

"bs"=BlockSize - Specifies both the input and output block size, superceding the ibs and obs flags. The block size values specified with
the bs flag must always be a multiple of the physical block size for the media being used. We have to choose the value of "bs"
like 1K or 2K or 4K .

"skip"=SkipInputBlocks - Skips the specified SkipInputBlocks value of input blocks before starting to copy.
So if we choose "bs"=4k, we have to choose "skip"=1 or for "bs"=2k, we have to choose "skip"=2.

"count" is for how many blocks ("bs") we should copy. Our case total number of oracle block need to be copied is 30593, which is of 8K.
So as the value of "bs" is 4k , count should be =30593*2=61186 or if the value of "bs" is 2k , count should be =30593*4=122372.

So the command should be like below:
---------------------------------------
dd if=< input raw device > bs= skip= count= of=
dd if=/dev/rVc1.jv.816sys1 bs=4096 skip=1 count=61186 of=/oracle/datafile/system.dbf


Hope this helps!

regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Massimo Bianchi
Honored Contributor

Re: Oracle standby database

Hi,
as stated, it's best if you adere to your production layout.


If you want to change from raw to fs, you can use rman.

When doing the restore, you specify different name for the datafiles, and rman takes care of skipping the right number of bytes.
You can check on Metalink or in rman manuals.

HTH,
Massimo