We have been looking at ways of migrating our database from it’s current home on Solaris to Linux (64-bit AMD). This migration involves two interesting changes, first off we have to change endianness due to the move from sparc archictecture to AMD, but as we are also using RAC we are moving from a clustered filesystem (Vxfs) to Oracle’s very own ASM. In no way is this a one step migration. Here is the method we are thinking of using:
Create your target database on the new system.
In your original database first find out what destination platforms you can use transportable tablespaces to:
sql> select * from V$transportable_platform;
Find out if the tablespace(replace TBNAME with the tablespace your are interested in) to move is self-contained:
sql> EXECUTE DBMS_TTS.TRANSPORT_SET_CHECK('TBNAME', TRUE); select * from TRANSPORT_SET_VIOLATIONS;
If there are any rows in the the output from the query, you must include the tablespaces mentioned in the transportable set.
Make all tablespaces you want to move read only:
sql> alter tablespace TBNAME read only;
Run rman to convert the datafile(s) of the tablespace you are interested in:
rman> convert tablespace TBNAME to platform 'Linux 64-bit for AMD' format='/home/oracle/%U' parallelism 4;
This rman command goes and changes the endianness of the data. Now create the transportable tablespace metadata you can use data pump or good old fashioned imp/exp:
(oracle $) exp 'as sys user' transport_tablespace=y file=tbname.dmp tablespaces=tbname
Now copy the output from rman and the export over to your new target database server and we can use imp to plug the tablespace back in. You must create the owner of the tablespace on the target database. You CAN’T plug straight into ASM you must go to a filesystem first! So if you are using RAC, you have to make it non-clustered and import on 1 side only:
(oracle $) imp 'as sys user' transport_tablespace=y file='path to export dump' datafiles='path to converted datafiles'
Now you have to use rman again to convert your datafile into ASM:
rman> convert datafile 'path_to_datafile' format 'ASM path' parallelism 4;
Finally offline the tablespace and rename the datafile in the database:
sql> alter tablespace TBNAME rename datafile 'path to os datafile' to 'path to ASM file'
So do this with all your datafiles and you have migrated your database.