RAC数据库迁移到本地
1,数据库启动到mount状态,复制数据文件!
$$ startup mount copy datafile 1 to '/oradata/data/system.256.835309449'; copy datafile 2 to '/oradata/data/sysaux.257.835309449'; copy datafile 3 to '/oradata/data/undotbs1.258.835309451'; copy datafile 4 to '/oradata/data/users.259.835309451'; copy datafile 5 to '/oradata/data/undotbs2.264.835309617'; copy datafile 6 to '/oradata/data/undotbs3.265.835309619'; copy datafile 7 to '/oradata/data/undotbs4.266.835309619'; copy datafile 8 to '/oradata/data/itreasury.dbf'; copy datafile 9 to '/oradata/data/itreasury2.dbf'; copy datafile 10 to '/oradata/data/itreasury3.dbf'; copy datafile 11 to '/oradata/data/itreasury4.dbf'; copy datafile 12 to '/oradata/data/itreasury5.dbf'; copy datafile 13 to '/oradata/data/itreasury6.dbf'; copy datafile 14 to '/oradata/data/itreasury7.dbf'; copy datafile 15 to '/oradata/data/itreasury8.dbf'; copy datafile 16 to '/oradata/data/system01.dbf'; copy datafile 17 to '/oradata/data/itreasury1.dbf'; copy datafile 18 to '/oradata/data/itreasury9.dbf'; copy datafile 19 to '/oradata/data/itreasury10.dbf'; copy datafile 20 to '/oradata/data/sysaux.287.840290013'; copy datafile 21 to '/oradata/data/users01.dbf'; copy datafile 22 to '/oradata/data/ogg.304.1030128099'; switch database to copy; $$
2,复制控制文件到本地,并更改控制文件位置
$$ copy current controlfile to '/oradata/data/ctl01.ctl'; alter system set control_files='/oradata/data/ctl01.ctl' scope=spfile; $$
3,更改spfile到本地,并重启数据库
create pfile='/oradata/data/pfile.bak' from spfile;
startup mount pfile='/oradata/data/pfile.bak'
4,更改tempfile文件位置alter database rename file '+DATADG/orcl/tempfile/temp.262.874700019' to '+newdata';
alter database rename file '+DATA/db/tempfile/temp.263.835309539' to '/oradata/data/tmp1.dbf';
alter database rename file '+DATA/db/tempfile/temp.286.840289257' to '/oradata/data/tmp2.dbf';
alter database rename file '+DATA/db/tempfile/temp.297.938962957' to '/oradata/data/tmp3.dbf';
alter database rename file '+DATA/db/tempfile/dbtemp.298.938976505' to '/oradata/data/tmp4.dbf';
alter database rename file '+DATA/db/tempfile/temp.299.938976833' to '/oradata/data/tmp5.dbf';
alter database rename file '+DATA/db/tempfile/temp.300.958492795' to '/oradata/data/tmp6.dbf';
alter database rename file '+DATA/db/tempfile/temp.301.958496011' to '/oradata/data/tmp7.dbf';
5,更改redo文件到本地alter database add logfile thread 1 group 101 '/oradata/data/redo101' size 50m;
alter database add logfile thread 1 group 102 '/oradata/data/redo102' size 50m;
alter database add logfile thread 4 group 41 '/oradata/data/redo41' size 50m;
alter database add logfile thread 4 group 42 '/oradata/data/redo42' size 50m;
alter database add logfile thread 3 group 31 '/oradata/data/redo31' size 50m;
alter database add logfile thread 3 group 32 '/oradata/data/redo32' size 50m;
alter database add logfile thread 2 group 21 '/oradata/data/redo21' size 50m;
alter database add logfile thread 2 group 22 '/oradata/data/redo22' size 50m;
alter system switch logfile;
alter system checkpoint;
删除多余redo文件
alter database disable thread 3;
alter database drop logfile group 3;
alter database drop logfile group 4;
alter database drop logfile group 5;
alter database drop logfile group 6;
alter database drop logfile group 7;
alter database drop logfile group 8;
`
检查redo文件位置
select 'alter database drop logfile member '''||member||''';' from v$logfile where member like '%online%';