Sunday, February 24, 2008

Oracle Move from one computer/directory to another

1. Edit and replace paths in

/etc/oratab
/etc/rc.d/rc5.d/S99zzoracle_orasid
/etc/rc.d/init.d/orastop_orasid
/etc/rc.d/init.d/listener_orasid
/etc/rc.d/init.d/orastart_orasid
/etc/rc.d/rc6.d/K10zzoracle_orasid
/etc/rc.d/rc0.d/K10zzoracle_orasid
/etc/rc.d/rc3.d/S99zzoracle_orasid
/etc/rc.d/rc1.d/K10zzoracle_orasid
/etc/oraInst.loc

2. Edit and replace paths in
listener.ora tnsnames.ora

3. login as sys as sysdba (listener must be on and database mounted)
create pfile='/apps/oracle/OraHome1/dbs/initorasid.ora' from spfile='/apps/oracle/OraHome1/dbs/spfileorasid.ora'

4. Edit /apps/oracle/OraHome1/dbs/initorasid.ora and change paths

5. Now do the reverse
create spfile='/apps/oracle/OraHome1/dbs/spfileorasid.ora' from pfile='/apps/oracle/OraHome1/dbs/initorasid.ora'

6. The last step is to alter internal files names:
alter database rename file '/home/gf_admin/oradata/gftt/control01.ctl' to '/apps/gf_admin/oradata/gftt/control01.ctl';
alter database rename file '/home/gf_admin/oradata/gftt/control02.ctl' to '/apps/gf_admin/oradata/gftt/control02.ctl';
alter database rename file '/home/gf_admin/oradata/gftt/control03.ctl' to '/apps/gf_admin/oradata/gftt/control03.ctl';
alter database rename file '/home/gf_admin/oradata/gftt/redo01.log' to '/apps/gf_admin/oradata/gftt/redo01.log';
alter database rename file '/home/gf_admin/oradata/gftt/redo02.log' to '/apps/gf_admin/oradata/gftt/redo02.log';
alter database rename file '/home/gf_admin/oradata/gftt/redo03.log' to '/apps/gf_admin/oradata/gftt/redo03.log';
alter database rename file '/home/gf_admin/oradata/gftt/system.dbf' to '/apps/gf_admin/oradata/gftt/system.dbf';
alter database rename file '/home/gf_admin/oradata/gftt/temp.dbf' to '/apps/gf_admin/oradata/gftt/temp.dbf';
alter database rename file '/home/gf_admin/oradata/gftt/tsdata.dbf' to '/apps/gf_admin/oradata/gftt/tsdata.dbf';
alter database rename file '/home/gf_admin/oradata/gftt/tsindex.dbf' to '/apps/gf_admin/oradata/gftt/tsindex.dbf';
alter database rename file '/home/gf_admin/oradata/gftt/undotbs.dbf' to '/apps/gf_admin/oradata/gftt/undotbs.dbf';

No comments: