数据文件迁移:
1、通过dba_data_files;v$datafile;v$controlfile;v$logfile;数据字典查找要迁移的数据文件。
2、将数据库shutdown immediate;
3、用操作系统命令将要迁移的文件移动到目标位置
4、在参数文件中修改控制文件位置。
设置好数据库实例名
conn /nolog
create pfile from spfile;
在形成的pfile中将控制文件的位置修改为目标位置。
create spfile from pfile;
5、将数据库启动到mount状态
startup mount
6、修改要迁移的数据文件在控制文件中的位置。
alter database
rename file
'/apps/oracle/oradata/edmtest/edmtest/sysaux01.dbf',
'/apps/oracle/oradata/edmtest/edmtest/system01.dbf',
'/apps/oracle/oradata/edmtest/edmtest/epdm_DATA_01.dbf',
'/apps/oracle/oradata/edmtest/edmtest/epdm_index_01.dbf',
'/apps/oracle/oradata/edmtest/edmtest/EDCDMS_DATA_01.dbf',
'/apps/oracle/oradata/edmtest/edmtest/MANAGE_DATA_01.dbf',
'/apps/oracle/oradata/edmtest/edmtest/MANAGE_DATA_INDEX_01.dbf',
'/apps/oracle/oradata/edmtest/edmtest/MANAGE_LOB_01.dbf',
'/apps/oracle/oradata/edmtest/edmtest/posc.dbf',
'/apps/oracle/oradata/edmtest/edmtest/redo01.log',
'/apps/oracle/oradata/edmtest/edmtest/redo02.log',
'/apps/oracle/oradata/edmtest/edmtest/redo03.log'
to
'/data/oradata/sysaux01.dbf',
'/data/oradata/system01.dbf',
'/data/oradata/epdm_DATA_01.dbf',
'/data/oradata/epdm_index_01.dbf',
'/data/oradata/EDCDMS_DATA_01.dbf',
'/data/oradata/MANAGE_DATA_01.dbf',
'/data/oradata/MANAGE_DATA_INDEX_01.dbf',
'/data/oradata/MANAGE_LOB_01.dbf',
'/data/oradata/posc.dbf',
'/data/oradata/redo01.log',
'/data/oradata/redo02.log',
'/data/oradata/redo03.log';
7、启动数据库
alter database open;
8、移动临时文件并重用
将临时文件移动到目标位置
SQL> alter database tempfile '/apps/oracle/oradata/edmtest/edmtest/temp01.dbf' drop;
1、通过dba_data_files;v$datafile;v$controlfile;v$logfile;数据字典查找要迁移的数据文件。
2、将数据库shutdown immediate;
3、用操作系统命令将要迁移的文件移动到目标位置
4、在参数文件中修改控制文件位置。
设置好数据库实例名
conn /nolog
create pfile from spfile;
在形成的pfile中将控制文件的位置修改为目标位置。
create spfile from pfile;
5、将数据库启动到mount状态
startup mount
6、修改要迁移的数据文件在控制文件中的位置。
alter database
rename file
'/apps/oracle/oradata/edmtest/edmtest/sysaux01.dbf',
'/apps/oracle/oradata/edmtest/edmtest/system01.dbf',
'/apps/oracle/oradata/edmtest/edmtest/epdm_DATA_01.dbf',
'/apps/oracle/oradata/edmtest/edmtest/epdm_index_01.dbf',
'/apps/oracle/oradata/edmtest/edmtest/EDCDMS_DATA_01.dbf',
'/apps/oracle/oradata/edmtest/edmtest/MANAGE_DATA_01.dbf',
'/apps/oracle/oradata/edmtest/edmtest/MANAGE_DATA_INDEX_01.dbf',
'/apps/oracle/oradata/edmtest/edmtest/MANAGE_LOB_01.dbf',
'/apps/oracle/oradata/edmtest/edmtest/posc.dbf',
'/apps/oracle/oradata/edmtest/edmtest/redo01.log',
'/apps/oracle/oradata/edmtest/edmtest/redo02.log',
'/apps/oracle/oradata/edmtest/edmtest/redo03.log'
to
'/data/oradata/sysaux01.dbf',
'/data/oradata/system01.dbf',
'/data/oradata/epdm_DATA_01.dbf',
'/data/oradata/epdm_index_01.dbf',
'/data/oradata/EDCDMS_DATA_01.dbf',
'/data/oradata/MANAGE_DATA_01.dbf',
'/data/oradata/MANAGE_DATA_INDEX_01.dbf',
'/data/oradata/MANAGE_LOB_01.dbf',
'/data/oradata/posc.dbf',
'/data/oradata/redo01.log',
'/data/oradata/redo02.log',
'/data/oradata/redo03.log';
7、启动数据库
alter database open;
8、移动临时文件并重用
将临时文件移动到目标位置
SQL> alter database tempfile '/apps/oracle/oradata/edmtest/edmtest/temp01.dbf' drop;
Database altered.
SQL> select * from v$tempfile;
no rows selected
SQL> alter tablespace temp add tempfile '/data/oradata/temp01.dbf' size 5g reuse;
Tablespace altered.
SQL> select * from v$tempfile;
FILE# CREATION_CHANGE# CREATION_TIME TS# RFILE# STATUS ENABLED BYTES BLOCKS CREATE_BYTES BLOCK_SIZE NAME
---------- ---------------- ------------------ ---------- ---------- ------- ---------- ---------- ---------- ------------ ---------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 1.1313E+13 24-NOV-10 3 1 ONLINE READ WRITE 5368709120 655360 5368709120 8192 /data/oradata/temp01.dbf
---------- ---------------- ------------------ ---------- ---------- ------- ---------- ---------- ---------- ------------ ---------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 1.1313E+13 24-NOV-10 3 1 ONLINE READ WRITE 5368709120 655360 5368709120 8192 /data/oradata/temp01.dbf
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/196700/viewspace-680219/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/196700/viewspace-680219/