Operating System - HP-UX
1752810 Members
5649 Online
108789 Solutions
New Discussion юеВ

Re: moving raw device to filesystem

 
SOLVED
Go to solution
miki leon
Advisor

moving raw device to filesystem

Hi To All

i have an oracle database that seets on raw devices .

i want to move this data to file systems .

i think that i need to create the a new logical colume and file system and to do a dd from the raw device to the raw device of the new filesystem , but what about all the file header of the file system ,

so i m lost .

how can it be done ( from someone that did it )
love unix
13 REPLIES 13
harry d brown jr
Honored Contributor

Re: moving raw device to filesystem


Normally one would export the database, recreate your database in a filesystem, and then import.

I'm not sure that dd'ing a raw device file to some filename is going to work, but then again, I've never tried to either.

live free or die
harry
Live Free or Die
Leif Halvarsson_2
Honored Contributor

Re: moving raw device to filesystem

Hi

Leif Halvarsson_2
Honored Contributor

Re: moving raw device to filesystem

Sorry,
I hit the submit button by mistake.

Doing a dd from the Oracle raw device to another raw device will (at best) create another raw Oracle database (and destroy the filesystem). I have not done a such database move but I think you must do a Oracle export, create a complete new database and import the data to the new database.
Ashwani Kashyap
Honored Contributor

Re: moving raw device to filesystem

I think an export of the database from the raw devices anf then import into file systems is the best way to go for it .
Bill Hassell
Honored Contributor

Re: moving raw device to filesystem

A raw device, whether Oracle or Sybase or any other database contains no files at all. Instead, the database manages the space based on block address and nothing else. The only possible way to convert is to export the entire database. Note that the exported data may need a bit more space than the raw device since general-purpose HP-UX directories must be created.


Bill Hassell, sysadmin

Re: moving raw device to filesystem

Hi, I think only export and import the tablespace is enough.
Yogeeraj_1
Honored Contributor
Solution

Re: moving raw device to filesystem

hi,

There is another way besides EXPORT/IMPORT. IT CAN BE DONE!

Below a quote from Oracle:

goal: How to convert datafile from raw device to file system
fact: Oracle Server - Enterprise Edition



fix:

Use RMAN to move datafiles from raw devices to file system.

1. Connect to the database:

$ sqlplus system/manager@orcl

2. Put the tablespace with the datafile, which should be converted, offline:

SQL> alter tablespace test_ts offline;

3. Start rman and connect it to the database:

$ rman nocatalog target rman/rman@orcl

4. Move the datafile to file system:

RMAN> run {
2> allocate channel c1 type disk;
3> copy datafile '/dev/raw1' to '/u01/oradata/orcl/test_ts.dbf';
4> }

5. Rename the moved datafile:

SQL> alter database rename file '/dev/raw1' to '/u01/oradata/orcl/test_ts.
dbf';

6. Put the tablespace back online:

SQL> alter tablespace test_ts online;


Notes:
======
1. If you are using RMAN as the backup tool then a backup after the performed
steps is recommended, because otherwise RMAN treats the copied file as a
backup.

2. Usually Oracle datafiles are moved from filesystem to raw devices using
the dd command. Using dd is the fastest method to accomplish it. However, it is
necessary to know how many blocks to skip in the raw device (e.g. it is
necessary to skip 64K on Tru64 Unix), so that the information necessary for
the Operating System is not overwritten. The information on how many blocks to
skip is different on the different platforms. Using RMAN there's no necessity
to know such platform specific information.



Hope this helps!
Best Regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
T G Manikandan
Honored Contributor

Re: moving raw device to filesystem

Leon,


you can bring down the database take a full cold backup.

Then you can use dd to copy the data from the raw datafiles to filesystem.
Like

dd if=/dev/r.... of=
Then you can do a
svrmgr>statup mount
svrmgr>alter database rename file '' to ''

The above command is to move a single datafile to another location.
If you have multiple files for each datafile you have to repeat the step.

Then you can do a alter database open
svrmgr>alter database open

If you have datafiles on raw devices for only one or two non-system tablespaces then you can follow the link given by Yogeeraj.

Taking the tablespace offline,moving the datafiles and again bringing back the tablespace online.


Also if you have less number of users then you can take a user level export and import it.


Thanks
miki leon
Advisor

Re: moving raw device to filesystem

Hi

First , thanks a lot for the reply .
i think that i will go with the way of T G Manikandan .

this was what i was thinking .


i will let you know which way i deside to do and if it work fine .

again thanks a lot for replying and helping me
love unix