Oracle数据库文件迁移步骤

前端之家收集整理的这篇文章主要介绍了Oracle数据库文件迁移步骤前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

(1)首先确认需要迁移的数据库文件

sql> select name from v$controlfile;

NAME

-----------------------------------------

D:\ORACLE\ORADATA\XSFREE\CONTROL01.CTL

D:\ORACLE\ORADATA\XSFREE\CONTROL02.CTL

sql> select name from v$datafile;

D:\ORACLE\ORADATA\XSFREE\SYSTEM01.DBF

D:\ORACLE\ORADATA\XSFREE\SYSAUX01.DBF

D:\ORACLE\ORADATA\XSFREE\UNDOTBS01.DBF

D:\ORACLE\ORADATA\XSFREE\USERS01.DBF

sql> select member from v$logfile;

MEMBER

---------------------------------------------

D:\ORACLE\ORADATA\XSFREE\REDO01.LOG

D:\ORACLE\ORADATA\XSFREE\REDO02.LOG

D:\ORACLE\ORADATA\XSFREE\REDO03.LOG

sql> select name from v$tempfile;

--------------------------------------

D:\ORACLE\ORADATA\XSFREE\TEMP01.DBF

(2)创建pfile,备份spfile

sql> create pfile from spfile;

move SPFILEXSFREE.ORA SPFILEXSFREE.ORA_bak

(3)关闭数据库

sql> shutdown immediate;

(4)迁移数据库文件

将D:\oracle\oradata下的文件复制到D:\oracle\oradata_bak下(本测试是将oradata目录下的数据库文件迁移至oradata_bak下)

(5)修改pfile中控制文件路径

*.control_files='D:\oracle\oradata_bak\xsfree\control01.ctl','D:\oracle\oradata_bak\xsfree\control02.ctl'

(6)rename文件

sql> startup mount pfile='D:\oracle\product\11.2.0\dbhome_1\database\INITxsfree.ORA';

sql> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\SYSTEM01.DBF' to 'D:\ORACLE\ORADATA_BAK\XSFREE\SYSTEM01.DBF';

sql> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\SYSAUX01.DBF' to 'D:\ORACLE\ORADATA_BAK\XSFREE\SYSAUX01.DBF';

sql> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\UNDOTBS01.DBF' to 'D:\ORACLE\ORADATA_BAK\XSFREE\UNDOTBS01.DBF';

sql> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\USERS01.DBF' to 'D:\ORACLE\ORADATA_BAK\XSFREE\USERS01.DBF';

sql> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\REDO01.LOG' to 'D:\ORACLE\ORADATA_BAK\XSFREE\REDO01.LOG';

sql> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\REDO02.LOG' to 'D:\ORACLE\ORADATA_BAK\XSFREE\REDO02.LOG';

sql> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\REDO03.LOG' to 'D:\ORACLE\ORADATA_BAK\XSFREE\REDO03.LOG';

sql> alter database rename file 'D:\ORACLE\ORADATA\XSFREE\TEMP01.DBF' to 'D:\ORACLE\ORADATA_BAK\XSFREE\TEMP01.DBF';

(7)打开数据库

sql> alter database open;

sql> create spfile from pfile='D:\oracle\product\11.2.0\dbhome_1\database\INITxsfree.ORA';

原文链接:https://www.f2er.com/oracle/206805.html

猜你在找的Oracle相关文章